Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENH: Configure SlicerConfigVersion.cmake so that find_package(Slicer …

  • Loading branch information...
commit 91883cacea87b7b26f45ad602005e9436a5e7fea 1 parent 7996105
@jcfr jcfr authored
View
5 CMake/SlicerConfig.cmake.in
@@ -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@")
View
12 CMake/SlicerConfigVersion.cmake.in
@@ -0,0 +1,12 @@
+
+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()
View
5 CMake/SlicerInstallConfig.cmake.in
@@ -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@")
View
1  CMakeLists.txt
@@ -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
)
View
4 Utilities/LastConfigureStep/CMakeLists.txt
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.