From 2289029fabe919c670e19ed24baeac74846bc7b3 Mon Sep 17 00:00:00 2001 From: minus Date: Wed, 26 Aug 2015 23:49:38 +0200 Subject: added json-c lib and implemented IPC get_version --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index bbf61299..e30b52e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,12 +22,15 @@ find_package(XKBCommon REQUIRED) find_package(WLC REQUIRED) find_package(A2X REQUIRED) find_package(PCRE REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(JSON REQUIRED json-c) FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) include_directories( ${WLC_INCLUDE_DIRS} ${PCRE_INCLUDE_DIRS} + ${JSON_INCLUDE_DIRS} include/ ) @@ -39,6 +42,7 @@ target_link_libraries(sway ${WLC_LIBRARIES} ${XKBCOMMON_LIBRARIES} ${PCRE_LIBRARIES} + ${JSON_LIBRARIES} ) INSTALL( -- cgit v1.2.3 From c948432fb460fbd6d9304034293dcf691a30a628 Mon Sep 17 00:00:00 2001 From: minus Date: Thu, 27 Aug 2015 00:06:09 +0200 Subject: fixed json-c CMake inclusion --- CMake/FindJsonC.cmake | 17 +++++++++++++++++ CMakeLists.txt | 7 +++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 CMake/FindJsonC.cmake (limited to 'CMakeLists.txt') diff --git a/CMake/FindJsonC.cmake b/CMake/FindJsonC.cmake new file mode 100644 index 00000000..2ca0df39 --- /dev/null +++ b/CMake/FindJsonC.cmake @@ -0,0 +1,17 @@ +# - Find json-c +# Find the json-c libraries +# +# This module defines the following variables: +# JSONC_FOUND - True if JSONC is found +# JSONC_LIBRARIES - JSONC libraries +# JSONC_INCLUDE_DIRS - JSONC include directories +# + +find_package(PkgConfig) +pkg_check_modules(PC_JSONC QUIET JSONC) +find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS}) +find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS) +mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS) diff --git a/CMakeLists.txt b/CMakeLists.txt index e30b52e0..aad7f54d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,15 +22,14 @@ find_package(XKBCommon REQUIRED) find_package(WLC REQUIRED) find_package(A2X REQUIRED) find_package(PCRE REQUIRED) -find_package(PkgConfig REQUIRED) -pkg_check_modules(JSON REQUIRED json-c) +find_package(JsonC REQUIRED) FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) include_directories( ${WLC_INCLUDE_DIRS} ${PCRE_INCLUDE_DIRS} - ${JSON_INCLUDE_DIRS} + ${JSONC_INCLUDE_DIRS} include/ ) @@ -42,7 +41,7 @@ target_link_libraries(sway ${WLC_LIBRARIES} ${XKBCOMMON_LIBRARIES} ${PCRE_LIBRARIES} - ${JSON_LIBRARIES} + ${JSONC_LIBRARIES} ) INSTALL( -- cgit v1.2.3