From 0155f38b5b6b8e8d2b5806df0729cb3663ee1070 Mon Sep 17 00:00:00 2001 From: Olivier LIESS Date: Mon, 3 Jun 2019 12:39:50 +0200 Subject: [PATCH] added cmake config version file for proper cmake delivery --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a992437..4c910af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,9 +168,15 @@ if(JSONCPP_WITH_PKGCONFIG_SUPPORT) endif() if(JSONCPP_WITH_CMAKE_PACKAGE) + include (CMakePackageConfigHelpers) install(EXPORT jsoncpp DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp FILE jsoncppConfig.cmake) + write_basic_package_version_file ("${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jsoncppConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/jsoncpp) endif() if(JSONCPP_WITH_TESTS)