From 7828b80b3f4436dd350dcc747580a35f3642d543 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 | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMake/GenerateCMakeExports.cmake b/CMake/GenerateCMakeExports.cmake index 2cc3de4c2..453ecc022 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,11 +13,11 @@ # 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) @@ -71,11 +71,11 @@ ENDFOREACH(module) SET(DCMTK_CONFIG_CODE "####### Expanded from \@DCMTK_CONFIG_CODE\@ #######\n") SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}list(APPEND DCMTK_INCLUDE_DIRS \"\${PACKAGE_PREFIX_DIR}/include\")\n") SET(DCMTK_CONFIG_CODE "${DCMTK_CONFIG_CODE}##################################################") -SET(dcmtk_install_config ${CMAKE_BINARY_DIR}/CMakeFiles/DCMTKConfig.cmake) +SET(DCMTK_INSTALL_CONFIG ${CMAKE_BINARY_DIR}/CMakeFiles/DCMTKConfig.cmake) # Actually configure file and set rule to install it to installation subdir CONFIGURE_PACKAGE_CONFIG_FILE( CMake/DCMTKConfig.cmake.in - ${dcmtk_install_config} + ${DCMTK_INSTALL_CONFIG} INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/${DCMTK_INSTALL_CMKDIR} PATH_VARS DCMTK_CMKDIR_CONFIG DCMTK_INCLUDE_DIR_CONFIGS NO_CHECK_REQUIRED_COMPONENTS_MACRO) diff --git a/CMakeLists.txt b/CMakeLists.txt index dca0a3e34..b54f69a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,14 +93,14 @@ IF(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE) # Create and configure CMake export files INCLUDE(CMake/GenerateCMakeExports.cmake) - # ${dcmtk_install_config} and ${dcmtk_config_version} are + # ${DCMTK_INSTALL_CONFIG} and ${DCMTK_CONFIG_VERSION} are # defined within CMake/GenerateCMakeExports.cmake. # Install DCMTKTargets.cmake to install tree INSTALL(EXPORT DCMTKTargets FILE DCMTKTargets.cmake DESTINATION ${DCMTK_INSTALL_CMKDIR} COMPONENT cmake) - # Install DCMTKConfigVersion.cmake - INSTALL(FILES ${dcmtk_install_config} ${dcmtk_config_version} + # Install DCMTKConfig.cmake and DCMTKConfigVersion.cmake + INSTALL(FILES ${DCMTK_INSTALL_CONFIG} ${DCMTK_CONFIG_VERSION} DESTINATION ${DCMTK_INSTALL_CMKDIR} COMPONENT cmake) ELSE(HAVE_CONFIGURE_PACKAGE_CONFIG_FILE AND HAVE_WRITE_BASIC_PACKAGE_VERSION_FILE) @@ -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