From cf913621f1b3a6feb4487ea7d5cf18c6ba68a040 Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Mon, 9 Oct 2017 13:16:00 -0400 Subject: [PATCH] Use cmake to create the json-c.pc file, as suggested by PR#362. --- CMakeLists.txt | 15 ++++++++++++++- RELEASE_CHECKLIST.txt | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89cf433..15492df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,9 @@ #Licensed under the MIT license. See LICENSE file in the project root for full license information. cmake_minimum_required(VERSION 2.8.7) -project(json-c) +cmake_policy(SET CMP0048 NEW) +project(json-c VERSION 0.12.99) + include(CheckSymbolExists) @@ -121,3 +123,14 @@ install(TARGETS json-c json-c-static ) install(FILES ${JSON_C_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/json-c ) + +if (UNIX) + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin) + set(libdir ${CMAKE_INSTALL_PREFIX}/lib) + set(includedir ${CMAKE_INSTALL_PREFIX}/include) + set(VERSION ${PROJECT_VERSION}) + configure_file(json-c.pc.in json-c.pc @ONLY) + set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") + install(FILES ${CMAKE_BINARY_DIR}/json-c.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}") +endif () diff --git a/RELEASE_CHECKLIST.txt b/RELEASE_CHECKLIST.txt index 307b95c..642cefb 100644 --- a/RELEASE_CHECKLIST.txt +++ b/RELEASE_CHECKLIST.txt @@ -21,6 +21,7 @@ Make any fixes/changes *before* branching. Update the version in json_c_version.h Update the version in Doxyfile Update the version in configure.ac +Update the version in CMakeLists.txt Use ${release}. Update the libjson_la_LDFLAGS line in Makefile.am to the new version. @@ -88,6 +89,7 @@ Add new section to ChangeLog Update the version in json_c_version.h Update the version in Doxyfile Update the version in configure.ac +Update the version in CMakeLists.txt Use ${release}.99 to indicate a version "newer" than anything on the branch. Leave the libjson_la_LDFLAGS line in Makefile.am alone.