diff options
author | Joakim Soderberg <joakim.soderberg@gmail.com> | 2014-01-13 17:13:44 +0100 |
---|---|---|
committer | Joakim Soderberg <joakim.soderberg@gmail.com> | 2014-01-27 12:48:52 +0100 |
commit | 3fe8f74e7f292f856717f7c0a3dccd4a45e574c1 (patch) | |
tree | 7e38f9d91359d1bdce323b790f188462b0f85135 /CMakeLists.txt | |
parent | 913937c98d2b530292e35b7c3fb6c21b576698e9 (diff) | |
download | jansson-3fe8f74e7f292f856717f7c0a3dccd4a45e574c1.zip jansson-3fe8f74e7f292f856717f7c0a3dccd4a45e574c1.tar.gz jansson-3fe8f74e7f292f856717f7c0a3dccd4a45e574c1.tar.bz2 |
Renamed config.h -> jansson_private_config.h
This is because it's really easy to get a name collission if compiling
Jansson as a subproject in a larger CMake project. If one project includes
several subprojects each having their own config.h, this will cause the
wrong file to be loaded.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 75c0523..1463f9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,13 +246,11 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/jansson_config.h.cmake file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/jansson.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/) +add_definitions(-DJANSSON_USING_CMAKE) # configure the private config file -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/private_include/config.h) - -# and tell the source code to include it -add_definitions (-DHAVE_CONFIG_H) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/jansson_private_config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/private_include/jansson_private_config.h) include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) include_directories (${CMAKE_CURRENT_BINARY_DIR}/private_include) @@ -299,7 +297,7 @@ if (JANSSON_BUILD_DOCS) if (NOT SPHINX_FOUND) message(WARNING "Sphinx not found. Cannot generate documentation! - Set -DJSON_BUILD_DOCS=0 to get rid of this message.") + Set -DJANSSON_BUILD_DOCS=OFF to get rid of this message.") else() if (Sphinx_VERSION_STRING VERSION_LESS 1.0) message(WARNING "Your Sphinx version is too old! @@ -501,6 +499,7 @@ export(PACKAGE jansson) set(JANSSON__INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") +set(JANSSON_INCLUDE_DIRS ${JANSSON__INCLUDE_DIRS} CACHE PATH "Jansson include directories") configure_file(${PROJECT_SOURCE_DIR}/cmake/JanssonConfig.cmake.in ${PROJECT_BINARY_DIR}/JanssonConfig.cmake @ONLY) @@ -565,3 +564,5 @@ install(FILES install(EXPORT JanssonTargets DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev) +# For use when simply using add_library from a parent project to build jansson. +set(JANSSON_LIBRARIES jansson CACHE STRING "Jansson libraries") |