Use CMakePackageConfigHelpers to create VTKmConfigVersion.cmake
This should help us be forward compatible with CMake.
This commit is contained in:
parent
dc542ba7e7
commit
c3ac545d91
1
CMake/VTKmConfig.cmake.in
Normal file → Executable file
1
CMake/VTKmConfig.cmake.in
Normal file → Executable file
@ -36,6 +36,7 @@ set(VTKm_INCLUDE_DIRS "@VTKm_INCLUDE_DIRS_CONFIG@")
|
||||
set(VTKm_MAJOR_VERSION "@VTKm_MAJOR_VERSION@")
|
||||
set(VTKm_MINOR_VERSION "@VTKm_MINOR_VERSION@")
|
||||
set(VTKm_PATCH_VERSION "@VTKm_PATCH_VERSION@")
|
||||
set(VTKm_VERSION "@VTKm_VERSION@")
|
||||
|
||||
set(VTKm_REQUIRED_BOOST_VERSION "@VTKm_REQUIRED_BOOST_VERSION@")
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
set(PACKAGE_VERSION "@VTKm_VERSION@")
|
||||
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if ("${PACKAGE_VERSION}" STREQUAL "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
@ -39,7 +39,7 @@ endif()
|
||||
|
||||
project (VTKm)
|
||||
|
||||
set(VTKm_MAJOR_VERSION 0)
|
||||
set(VTKm_MAJOR_VERSION 1)
|
||||
set(VTKm_MINOR_VERSION 1)
|
||||
set(VTKm_PATCH_VERSION 0)
|
||||
set(VTKm_VERSION "${VTKm_MAJOR_VERSION}.${VTKm_MINOR_VERSION}.${VTKm_PATCH_VERSION}")
|
||||
@ -235,6 +235,9 @@ if(VTKm_BUILD_EXAMPLES)
|
||||
endif(VTKm_BUILD_EXAMPLES)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Ready files for find_package
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Configuration for build directory.
|
||||
set(VTKm_INCLUDE_DIRS_CONFIG "${VTKm_SOURCE_DIR};${VTKm_BINARY_DIR}")
|
||||
set(VTKm_CMAKE_MODULE_PATH_CONFIG "${VTKm_SOURCE_DIR}/CMake")
|
||||
@ -258,11 +261,10 @@ install(FILES ${VTKm_BINARY_DIR}/VTKmConfig.cmake.install
|
||||
)
|
||||
|
||||
# Create supplemental version configuration file.
|
||||
configure_file(
|
||||
${VTKm_SOURCE_DIR}/CMake/VTKmConfigVersion.cmake.in
|
||||
write_basic_package_version_file(
|
||||
${VTKm_BINARY_DIR}/VTKmConfigVersion.cmake
|
||||
@ONLY
|
||||
)
|
||||
VERSION ${VTKm_VERSION}
|
||||
COMPATIBILITY ExactVersion )
|
||||
install(FILES ${VTKm_BINARY_DIR}/VTKmConfigVersion.cmake
|
||||
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user