Added rudimentary package configuration files.
These files will allow cmake based projects to find the library using find_package(cJSON). If successful, they can use CJSON_LIBRARIES and CJSON_INCLUDE_DIRS. Other build systems can use a similar approach to pkg-config: cmake --find-package -DNAME=cJSON -DCOMPILER_ID=GNU -DLANGUAGE=C -DCMAKE_PREFIX_PATH=<path-to-non-sytem-installation-path> -DMODE=LINK or with MODE COMPILE or EXISTS.
This commit is contained in:
committed by
Max Bruckner
parent
8a7f9a2101
commit
251e5a5e34
11
cJSONConfigVersion.cmake.in
Normal file
11
cJSONConfigVersion.cmake.in
Normal file
@@ -0,0 +1,11 @@
|
||||
set(PACKAGE_VERSION "@PROJECT_VERSION@")
|
||||
|
||||
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user