Patch #708 » 0001-fix-CMake-definitions-to-properly-install-DCMTKConfi.patch
CMake/GenerateCMakeExports.cmake | ||
---|---|---|
# 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
|
||
... | ... | |
# 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)
|
||
CMakeLists.txt | ||
---|---|---|
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)
|
||
... | ... | |
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)
|
||