From 5fab18c9c86d7ae275fdeeb2d895c6894a88f330 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Sat, 13 Jul 2019 12:40:55 +1200 Subject: [PATCH] Generate version file to ensure proper version check Signed-off-by: Kimball Thurston --- IlmBase/config/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/IlmBase/config/CMakeLists.txt b/IlmBase/config/CMakeLists.txt index 5376c80d..0e596532 100644 --- a/IlmBase/config/CMakeLists.txt +++ b/IlmBase/config/CMakeLists.txt @@ -101,7 +101,17 @@ endif() # The main export of the configuration - This is the # moral equivalent of a pkg-config file for cmake # and replaces the Find*.cmake of the "old" cmake +include(CMakePackageConfigHelpers) +write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${ILMBASE_VERSION} + COMPATIBILITY SameMajorVersion +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +) install(EXPORT ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} + FILE ${PROJECT_NAME}Config.cmake NAMESPACE ${PROJECT_NAME}:: + EXPORT_LINK_INTERFACE_LIBRARIES )