From 414dfa8155fcf2233472e60847be5c64f752c6d5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 19 Jan 2018 06:23:29 +0100 Subject: [PATCH] libgluonutil: simplify CMakeLists.txt libgluonutil is not usable outside the OpenWrt/LEDE environment anyways, so it doesn't make much sense to make the CMakeLists.txt overly generic. --- package/libgluonutil/src/CMakeLists.txt | 17 ++++------------- package/libgluonutil/src/FindJSON_C.cmake | 20 -------------------- 2 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 package/libgluonutil/src/FindJSON_C.cmake diff --git a/package/libgluonutil/src/CMakeLists.txt b/package/libgluonutil/src/CMakeLists.txt index ba92a3e1..7df17b1a 100644 --- a/package/libgluonutil/src/CMakeLists.txt +++ b/package/libgluonutil/src/CMakeLists.txt @@ -1,24 +1,15 @@ cmake_minimum_required(VERSION 2.6) -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) - project(libgluonutil C) -set(LIBDIR "lib${LIB_SUFFIX}") - -find_package(JSON_C REQUIRED) - set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE) add_library(gluonutil SHARED libgluonutil.c) -set_property(TARGET gluonutil PROPERTY COMPILE_FLAGS "-Wall -std=c99 ${JSON_C_CFLAGS_OTHER}") -set_property(TARGET gluonutil PROPERTY LINK_FLAGS "${JSON_C_LDFLAGS_OTHER}") -set_property(TARGET gluonutil APPEND PROPERTY INCLUDE_DIRECTORIES ${JSON_C_INCLUDE_DIR}) -target_link_libraries(gluonutil ${JSON_C_LIBRARIES}) +set_property(TARGET gluonutil PROPERTY COMPILE_FLAGS "-Wall -std=c99") +target_link_libraries(gluonutil json-c) install(TARGETS gluonutil - ARCHIVE DESTINATION ${LIBDIR} - LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib ) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libgluonutil.h DESTINATION include) diff --git a/package/libgluonutil/src/FindJSON_C.cmake b/package/libgluonutil/src/FindJSON_C.cmake deleted file mode 100644 index f6abee65..00000000 --- a/package/libgluonutil/src/FindJSON_C.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# Defines the following variables: -# JSON_C_FOUND -# JSON_C_INCLUDE_DIR -# JSON_C_LIBRARIES -# JSON_C_CFLAGS_OTHER -# JSON_C_LDFLAGS_OTHER - - -find_package(PkgConfig REQUIRED QUIET) - -pkg_check_modules(_JSON_C json-c) - -find_path(JSON_C_INCLUDE_DIR NAMES json-c/json.h HINTS ${_JSON_C_INCLUDE_DIRS}) -find_library(JSON_C_LIBRARIES NAMES json-c HINTS ${_JSON_C_LIBRARY_DIRS}) - -set(JSON_C_CFLAGS_OTHER "${_JSON_C_CFLAGS_OTHER}" CACHE STRING "Additional compiler flags for json-c") -set(JSON_C_LDFLAGS_OTHER "${_JSON_C_LDFLAGS_OTHER}" CACHE STRING "Additional linker flags for json-c") - -find_package_handle_standard_args(JSON_C REQUIRED_VARS JSON_C_LIBRARIES JSON_C_INCLUDE_DIR) -mark_as_advanced(JSON_C_INCLUDE_DIR JSON_C_LIBRARIES JSON_C_CFLAGS_OTHER JSON_C_LDFLAGS_OTHER)