]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Use cmake to create the json-c.pc file, as suggested by PR#362.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 9 Oct 2017 17:16:00 +0000 (13:16 -0400)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Mon, 9 Oct 2017 17:16:00 +0000 (13:16 -0400)
CMakeLists.txt
RELEASE_CHECKLIST.txt

index 89cf4330ae7ae39b49d2ba95a522adf32bf5b5fa..15492df83912840e087a523e372b25632ddaaca5 100644 (file)
@@ -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 ()
index 307b95c8cb34d40c1b20fa7963f9afb0d686a03b..642cefbba51fe321b3dc3f331c0deb8aef471357 100644 (file)
@@ -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.