From 295e3ceca7c18336c59d555b381d65e14c416ca6 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Mon, 2 Jan 2017 15:38:39 +0000 Subject: [PATCH] fix CMake definitions to properly install DCMTKConfigVersion.cmake --- CMake/GenerateCMakeExports.cmake | 10 +++++----- CMakeLists.txt | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMake/GenerateCMakeExports.cmake b/CMake/GenerateCMakeExports.cmake index 2cc3de4c2..c38cb4d10 100644 --- a/CMake/GenerateCMakeExports.cmake +++ b/CMake/GenerateCMakeExports.cmake @@ -2,7 +2,7 @@ # and 'DCMTKConfig.cmake'. These files are created within the build tree # but also are installed with DCMTK. # The files can be utilized (no matter whether they are installed or just -# located within the build tree) by external projects in order to use +# located within the build tree) by external projects in order to use # the related DCMTK build. # In order to accomplish that, the files provide hints to the external project # which libraries and executables are available, and which build options have @@ -13,19 +13,19 @@ # DCMTKTargets.cmake will contain list of available DCMTK executables and libs # DCMTKConfigVersion.cmake provides checking of DCMTK version compatibility # DCMTKConfig.cmake will contain options used to build this DCMTK package -# -# + # Get and store all executable targets to DCMTKTargets.cmake within build's main dir GET_PROPERTY(DCMTK_EXECUTABLE_TARGETS GLOBAL PROPERTY DCMTK_EXECUTABLE_TARGETS) EXPORT(TARGETS ${DCMTK_EXECUTABLE_TARGETS} APPEND FILE ${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake) + # Get and store libraries to DCMTKTargets.cmake within the build's main dir GET_PROPERTY(DCMTK_LIBRARY_TARGETS GLOBAL PROPERTY DCMTK_LIBRARY_TARGETS) EXPORT(TARGETS ${DCMTK_LIBRARY_TARGETS} APPEND FILE ${DCMTK_BUILD_CMKDIR}/DCMTKTargets.cmake) # Create DCMTConfigVersion.cmake with basic DCMTK version information (build tree) -SET(DCMTK_CONFIG_VERSION ${DCMTK_BUILD_CMKDIR}/DCMTKConfigVersion.cmake) +SET(dcmtk_config_version ${DCMTK_BUILD_CMKDIR}/DCMTKConfigVersion.cmake) WRITE_BASIC_PACKAGE_VERSION_FILE( - ${DCMTK_CONFIG_VERSION} + ${dcmtk_config_version} VERSION ${DCMTK_MAJOR_VERSION}.${DCMTK_MINOR_VERSION}.${DCMTK_BUILD_VERSION} COMPATIBILITY SameMajorVersion) diff --git a/CMakeLists.txt b/CMakeLists.txt index dca0a3e34..71e725811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,7 @@ IF(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE) INSTALL(EXPORT DCMTKTargets FILE DCMTKTargets.cmake DESTINATION ${DCMTK_INSTALL_CMKDIR} COMPONENT cmake) - # Install DCMTKConfigVersion.cmake + # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake INSTALL(FILES ${dcmtk_install_config} ${dcmtk_config_version} DESTINATION ${DCMTK_INSTALL_CMKDIR} COMPONENT cmake) @@ -112,8 +112,8 @@ ELSE(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FIL CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/CMake/DCMTKConfig.cmake26.in ${DCMTK_BINARY_DIR}/DCMTKConfig.cmake @ONLY) - # Install DCMTK's CMake configuration file - INSTALL(FILES ${DCMTK_BINARY_DIR}/DCMTKConfig.cmake + # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake + INSTALL(FILES ${DCMTK_BINARY_DIR}/DCMTKConfig.cmake ${DCMTK_BINARY_DIR}/DCMTKConfigVersion.cmake DESTINATION ${DCMTK_INSTALL_CMKDIR} COMPONENT cmake) -- 2.11.0