From fe7873e96324701648d70c3f4f69e2272219016f Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Sun, 11 Mar 2018 10:37:15 -0400 Subject: [PATCH] Fix package version config generation --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b113fb..de6aa61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ set(JANSSON_TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/tmp) # Give the debug version a different postfix for windows, # so both the debug and release version can be built in the # same build-tree on Windows (MSVC). -if (WIN32) +if (WIN32 AND NOT CMAKE_DEBUG_POSTFIX) set(CMAKE_DEBUG_POSTFIX "_d") endif (WIN32) @@ -627,11 +627,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/janssonConfig.cmake.in # Generate the config file for the installation tree. -include(WriteBasicPackageVersionFile) +include(CMakePackageConfigHelpers) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/cmake/janssonVersionConfig.cmake" - VERSION ${PROJECT_VERSION} + VERSION ${JANSSON_VERSION} + COMPATIBILITY ExactVersion ) configure_package_config_file(