From f9ce93029ac906b70addb9f2212b3973d76b8fb3 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 6 Nov 2016 14:54:43 +0700 Subject: [PATCH] Buildsystem: Fix paths Fix library and include paths in pkg-config, CMakeLists.txt and the CMake config files. --- CMakeLists.txt | 3 ++- cJSONConfig.cmake.in | 2 +- cJSONConfigVersion.cmake.in | 2 +- libcjson.pc.in | 7 +++---- libcjson_utils.pc.in | 7 +++---- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea32cd1..5ad3a0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,9 @@ endif() #variables for pkg-config set(prefix "${CMAKE_INSTALL_PREFIX}") -set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") +set(libdir "${CMAKE_INSTALL_LIBDIR}") set(version "${CJSON_VERSION}") +set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") option(BUILD_SHARED_LIBS "Build shared libraries" ON) diff --git a/cJSONConfig.cmake.in b/cJSONConfig.cmake.in index da8e588..06696ad 100644 --- a/cJSONConfig.cmake.in +++ b/cJSONConfig.cmake.in @@ -8,7 +8,7 @@ set(CJSON_UTILS_LIBRARY @CJSON_UTILS_LIB@) # The cJSON library set(CJSON_LIBRARY @CJSON_LIB@) # The include directories used by cJSON -set(CJSON_INCLUDE_DIRS @CMAKE_INSTALL_PREFIX@/include) +set(CJSON_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@") get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) include("${_dir}/cJSONConfigTargets.cmake") diff --git a/cJSONConfigVersion.cmake.in b/cJSONConfigVersion.cmake.in index 22ffec0..868727b 100644 --- a/cJSONConfigVersion.cmake.in +++ b/cJSONConfigVersion.cmake.in @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION "@PROJECT_VERSION@") +set(PACKAGE_VERSION "@CJSON_VERSION@") # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") diff --git a/libcjson.pc.in b/libcjson.pc.in index aac3262..106ac7d 100644 --- a/libcjson.pc.in +++ b/libcjson.pc.in @@ -1,10 +1,9 @@ prefix=@prefix@ -libdir=@libdir@ -includedir=${prefix}/include/cJSON -version=@version@ +libdir=${prefix}/@libdir@ +includedir=${prefix}/@includedir@ Name: libcjson -Version: ${version} +Version: @version@ Description: Ultralightweight JSON parser in ANSI C Libs: -L${libdir} -lcjson Cflags: -I${includedir} diff --git a/libcjson_utils.pc.in b/libcjson_utils.pc.in index 67effb4..679aef6 100644 --- a/libcjson_utils.pc.in +++ b/libcjson_utils.pc.in @@ -1,10 +1,9 @@ prefix=@prefix@ -libdir=@libdir@ -includedir=${prefix}/include/cJSON -version=@version@ +libdir=${prefix}/@libdir@ +includedir=${prefix}/@includedir@ Name: libcjson_utils -Version: ${version} +Version: @version@ Description: An implementation of JSON Pointer, Patch and Merge Patch based on cJSON. Libs: -L${libdir} -lcjson_utils Cflags: -I${includedir}