Commit 91883cac authored by jcfr's avatar jcfr

ENH: Configure SlicerConfigVersion.cmake so that find_package(Slicer X.Y.Z) works

See http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file

git-svn-id: http://svn.slicer.org/Slicer4/trunk@18963 3bd1e089-480b-0410-8dfb-8563597acbee
parent 7996105f
......@@ -89,11 +89,6 @@ include(SlicerBlockFindQtAndCheckVersion)
set(Slicer_LAUNCHER_EXECUTABLE "@Slicer_LAUNCHER_EXECUTABLE_CONFIG@")
set(Slicer_LAUNCH_COMMAND "@Slicer_LAUNCH_COMMAND_CONFIG@")
# Slicer version number
set(Slicer_VERSION_MAJOR "@Slicer_VERSION_MAJOR@")
set(Slicer_VERSION_MINOR_ "@SlicerVERSION_MINOR_@")
set(Slicer_VERSION_PATCH "@Slicer_VERSION_PATCH@")
# Slicer working copy Revision, URL and Root
set(Slicer_WC_REVISION "@Slicer_WC_REVISION@")
set(Slicer_WC_URL "@Slicer_WC_URL@")
......
set(PACKAGE_VERSION "@Slicer_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
......@@ -12,11 +12,6 @@ set(Slicer_REQUIRED_C_FLAGS "@Slicer_REQUIRED_C_FLAGS@")
set(Slicer_REQUIRED_CXX_FLAGS "@Slicer_REQUIRED_CXX_FLAGS@")
set(Slicer_REQUIRED_LINK_FLAGS "@Slicer_REQUIRED_LINK_FLAGS@")
# The Slicer version number
set(Slicer_VERSION_MAJOR "@Slicer_VERSION_MAJOR@")
set(Slicer_VERSION_MINOR "@Slicer_VERSION_MINOR@")
set(Slicer_VERSION_PATCH "@Slicer_VERSION_PATCH@")
# Whether Slicer was built with modules and CLI support.
set(Slicer_BUILD_CLI_SUPPORT "@Slicer_BUILD_CLI_SUPPORT@")
set(Slicer_BUILD_CLI "@Slicer_BUILD_CLI@")
......
......@@ -824,6 +824,7 @@ if(NOT Slicer_INSTALL_NO_DEVELOPMENT)
install(FILES
${Slicer_BINARY_DIR}/UseSlicer.cmake
${Slicer_BINARY_DIR}/SlicerConfig.cmake
${Slicer_BINARY_DIR}/SlicerConfigVersion.cmake
DESTINATION ${Slicer_INSTALL_LIB_DIR}
COMPONENT Development
)
......
......@@ -42,5 +42,9 @@ export(TARGETS ${Slicer_TARGETS} APPEND FILE ${Slicer_BINARY_DIR}/SlicerTargets.
# Since it might generate configuration file depending
include(${Slicer_SOURCE_DIR}/CMake/SlicerGenerateSlicerConfig.cmake)
configure_file(
${Slicer_SOURCE_DIR}/CMake/SlicerConfigVersion.cmake.in
${Slicer_BINARY_DIR}/SlicerConfigVersion.cmake @ONLY)
#-----------------------------------------------------------------------------
include(${Slicer_SOURCE_DIR}/CMake/SlicerCPack.cmake)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment