2014-02-10 18:56:40 +00:00
|
|
|
##============================================================================
|
|
|
|
## Copyright (c) Kitware, Inc.
|
|
|
|
## All rights reserved.
|
|
|
|
## See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
##
|
2014-02-10 18:56:40 +00:00
|
|
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
## PURPOSE. See the above copyright notice for more information.
|
|
|
|
##============================================================================
|
|
|
|
|
2016-06-29 19:19:42 +00:00
|
|
|
# When this file is run by CMake through the find_package command, the
|
2018-04-19 20:27:13 +00:00
|
|
|
# following targets will exist:
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::cont Target that contains most of VTK-m
|
2015-11-12 21:25:34 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::rendering Target that contains all the rendering code
|
2016-06-29 19:19:42 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::filter Target that contains all of VTK-m pre-built filters
|
2019-09-23 22:49:58 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::source Target that contains all of VTK-m pre-built sources
|
2019-03-05 20:46:05 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::tbb Target that contains tbb related link information
|
|
|
|
# implicitly linked to by `vtkm_cont` if tbb is enabled
|
2017-10-05 14:28:44 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::openmp Target that contains openmp related link information
|
|
|
|
# implicitly linked to by `vtkm_cont` if openmp is enabled
|
2018-03-01 21:20:31 +00:00
|
|
|
#
|
2022-12-09 23:46:56 +00:00
|
|
|
# vtkm::cuda Target that contains cuda related link information
|
|
|
|
# implicitly linked to by `vtkm_cont` if cuda is enabled
|
2018-04-19 20:27:13 +00:00
|
|
|
#
|
|
|
|
# The following local variables will also be defined:
|
|
|
|
#
|
|
|
|
# VTKm_VERSION Holds the version string of "Major.Minor"
|
|
|
|
# VTKm_VERSION_FULL Holds the version string of "Major.Minor.Patch.GitSha1"
|
|
|
|
# VTKm_VERSION_MAJOR Holds just the major version number
|
|
|
|
# VTKm_VERSION_MINOR Holds just the minor version number
|
|
|
|
# VTKm_VERSION_PATCH Holds just the patch version number
|
|
|
|
#
|
|
|
|
# VTKm_BUILD_SHARED_LIBS Will be enabled if VTK-m was built shared/dynamic
|
|
|
|
# VTKm_ENABLE_CUDA Will be enabled if VTK-m was built with CUDA support
|
|
|
|
# VTKm_ENABLE_TBB Will be enabled if VTK-m was built with TBB support
|
2018-03-01 21:20:31 +00:00
|
|
|
# VTKm_ENABLE_OPENMP Will be enabled if VTK-m was built with OpenMP support
|
2020-06-16 12:54:01 +00:00
|
|
|
# VTKm_ENABLE_KOKKOS Will be enabled if VTK-m was built with Kokkos support
|
2019-02-27 21:03:10 +00:00
|
|
|
# VTKm_ENABLE_LOGGING Will be enabled if VTK-m was built with logging support
|
2018-04-19 20:27:13 +00:00
|
|
|
# VTKm_ENABLE_MPI Will be enabled if VTK-m was built with MPI support
|
|
|
|
# VTKm_ENABLE_RENDERING Will be enabled if VTK-m was built with rendering support
|
|
|
|
# VTKm_ENABLE_GL_CONTEXT Will be enabled if VTK-m rendering was built with a GL context
|
|
|
|
# VTKm_ENABLE_OSMESA_CONTEXT Will be enabled if VTK-m rendering was built with a osmesa context
|
|
|
|
# VTKm_ENABLE_EGL_CONTEXT Will be enabled if VTK-m rendering was built with a EGL context
|
2016-06-29 19:19:42 +00:00
|
|
|
#
|
2015-11-12 21:25:34 +00:00
|
|
|
|
2020-05-29 20:39:55 +00:00
|
|
|
if (CMAKE_VERSION VERSION_LESS "3.12")
|
|
|
|
message(FATAL_ERROR "VTK-m requires CMake 3.12+")
|
2018-06-18 19:26:55 +00:00
|
|
|
endif()
|
|
|
|
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND
|
|
|
|
CMAKE_VERSION VERSION_LESS "3.11")
|
|
|
|
message(FATAL_ERROR "VTK-m requires CMake 3.11+ when using the Visual Studio Generators")
|
|
|
|
endif()
|
2016-11-30 19:10:30 +00:00
|
|
|
|
2016-06-16 22:25:41 +00:00
|
|
|
@PACKAGE_INIT@
|
2014-02-10 18:56:40 +00:00
|
|
|
|
|
|
|
# The VTKm version number
|
2017-01-26 17:02:04 +00:00
|
|
|
set(VTKm_VERSION_MAJOR "@VTKm_VERSION_MAJOR@")
|
|
|
|
set(VTKm_VERSION_MINOR "@VTKm_VERSION_MINOR@")
|
|
|
|
set(VTKm_VERSION_PATCH "@VTKm_VERSION_PATCH@")
|
|
|
|
set(VTKm_VERSION_FULL "@VTKm_VERSION_FULL@")
|
2016-06-16 21:38:23 +00:00
|
|
|
set(VTKm_VERSION "@VTKm_VERSION@")
|
2014-02-10 18:56:40 +00:00
|
|
|
|
2018-01-17 21:34:38 +00:00
|
|
|
set(VTKm_BUILD_SHARED_LIBS "@VTKm_BUILD_SHARED_LIBS@")
|
|
|
|
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")
|
2020-06-16 12:54:01 +00:00
|
|
|
set(VTKm_ENABLE_KOKKOS "@VTKm_ENABLE_KOKKOS@")
|
2020-09-16 13:36:28 +00:00
|
|
|
set(VTKm_ENABLE_OPENMP "@VTKm_ENABLE_OPENMP@")
|
|
|
|
set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
|
2019-02-27 21:03:10 +00:00
|
|
|
set(VTKm_ENABLE_LOGGING "@VTKm_ENABLE_LOGGING@")
|
2018-01-17 21:34:38 +00:00
|
|
|
set(VTKm_ENABLE_RENDERING "@VTKm_ENABLE_RENDERING@")
|
|
|
|
set(VTKm_ENABLE_GL_CONTEXT "@VTKm_ENABLE_GL_CONTEXT@")
|
|
|
|
set(VTKm_ENABLE_OSMESA_CONTEXT "@VTKm_ENABLE_OSMESA_CONTEXT@")
|
|
|
|
set(VTKm_ENABLE_EGL_CONTEXT "@VTKm_ENABLE_EGL_CONTEXT@")
|
|
|
|
set(VTKm_ENABLE_MPI "@VTKm_ENABLE_MPI@")
|
2021-09-30 20:13:51 +00:00
|
|
|
set(VTKm_ENABLE_TESTING_LIBRARY "@VTKm_ENABLE_TESTING_LIBRARY@")
|
2023-01-03 16:47:08 +00:00
|
|
|
set(VTKm_USE_DEFAULT_TYPES_FOR_ASCENT "@VTKm_USE_DEFAULT_TYPES_FOR_ASCENT@")
|
2018-01-17 21:34:38 +00:00
|
|
|
|
2016-06-16 22:25:41 +00:00
|
|
|
# This is true when the package is still in the build directory (not installed)
|
2018-01-17 18:07:04 +00:00
|
|
|
if(CMAKE_CURRENT_LIST_DIR STREQUAL "@VTKm_BUILD_CMAKE_BASE_DIR@/@VTKm_INSTALL_CONFIG_DIR@")
|
2016-06-23 18:28:50 +00:00
|
|
|
set(VTKm_PACKAGE_IN_BUILD TRUE)
|
2016-06-16 22:25:41 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VTKm_PACKAGE_IN_BUILD)
|
2016-06-23 17:34:23 +00:00
|
|
|
set_and_check(VTKm_CMAKE_MODULE_PATH "@VTKm_SOURCE_DIR@/CMake")
|
2017-10-03 15:28:15 +00:00
|
|
|
else()
|
|
|
|
set_and_check(VTKm_CMAKE_MODULE_PATH "@PACKAGE_VTKm_INSTALL_CMAKE_MODULE_DIR@")
|
2016-06-16 22:25:41 +00:00
|
|
|
endif()
|
2014-02-10 18:56:40 +00:00
|
|
|
|
2021-03-23 13:03:25 +00:00
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH_save_vtkm "${CMAKE_MODULE_PATH}")
|
|
|
|
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
|
|
|
|
if (VTKm_ENABLE_TBB)
|
|
|
|
find_dependency(TBB)
|
|
|
|
if (NOT TBB_FOUND)
|
|
|
|
set(VTKm_FOUND 0)
|
|
|
|
list(APPEND VTKm_NOT_FOUND_REASON "TBB not found: ${TBB_NOT_FOUND_MESSAGE}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-09-06 20:53:11 +00:00
|
|
|
# Load the library exports, but only if not compiling VTK-m itself
|
|
|
|
set_and_check(VTKm_CONFIG_DIR "@PACKAGE_VTKm_INSTALL_CONFIG_DIR@")
|
2019-08-27 17:31:45 +00:00
|
|
|
set(VTKM_FROM_INSTALL_DIR FALSE)
|
2017-09-25 12:47:47 +00:00
|
|
|
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "@VTKm_BINARY_DIR@")
|
2019-08-27 17:31:45 +00:00
|
|
|
set(VTKM_FROM_INSTALL_DIR TRUE)
|
2016-09-06 20:53:11 +00:00
|
|
|
include(${VTKm_CONFIG_DIR}/VTKmTargets.cmake)
|
2022-12-09 23:46:56 +00:00
|
|
|
|
|
|
|
if(DEFINED PACKAGE_FIND_VERSION AND PACKAGE_FIND_VERSION VERSION_LESS 2.0)
|
|
|
|
add_library(vtkm_cont ALIAS vtkm::cont)
|
|
|
|
add_library(vtkm_filter ALIAS vtkm::filter)
|
|
|
|
add_library(vtkm_io ALIAS vtkm::io)
|
|
|
|
add_library(vtkm_rendering ALIAS vtkm::rendering)
|
|
|
|
add_library(vtkm_source ALIAS vtkm::source)
|
|
|
|
add_library(vtkm_worklet ALIAS vtkm::worklet)
|
|
|
|
endif()
|
2016-07-28 14:46:59 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-26 20:54:43 +00:00
|
|
|
# Once we can require CMake 3.15 for all cuda builds we can
|
|
|
|
# replace this with setting `cuda_architecture_flags` as part of the
|
2022-12-09 23:46:56 +00:00
|
|
|
# EXPORT_PROPERTIES of the vtkm::cuda target
|
2019-08-27 17:31:45 +00:00
|
|
|
if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR)
|
2022-10-26 21:18:15 +00:00
|
|
|
# Canonical way of setting CUDA arch
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
|
|
|
|
set_target_properties(vtkm::cuda PROPERTIES CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@")
|
|
|
|
endif()
|
2022-03-29 23:56:43 +00:00
|
|
|
|
|
|
|
set_target_properties(vtkm::cuda PROPERTIES
|
|
|
|
# Legacy way of setting CUDA arch
|
|
|
|
cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@"
|
|
|
|
requires_static_builds TRUE)
|
2019-08-26 20:54:43 +00:00
|
|
|
|
2020-06-11 13:59:17 +00:00
|
|
|
# If VTK-m is built with 3.18+ and the consumer is < 3.18 we need to drop
|
|
|
|
# these properties as they break the VTK-m cuda flag logic
|
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.18)
|
|
|
|
set_target_properties(vtkm::cuda PROPERTIES INTERFACE_LINK_OPTIONS "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2014-02-10 18:56:40 +00:00
|
|
|
# VTKm requires some CMake Find modules not included with CMake, so
|
|
|
|
# include the CMake modules distributed with VTKm.
|
2021-03-23 13:03:25 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_save_vtkm} ${VTKm_CMAKE_MODULE_PATH})
|
|
|
|
unset(CMAKE_MODULE_PATH_save_vtkm)
|
2015-11-12 21:25:34 +00:00
|
|
|
|
2019-04-03 16:33:53 +00:00
|
|
|
if(VTKm_ENABLE_CUDA)
|
2019-07-16 20:35:02 +00:00
|
|
|
if (CMAKE_VERSION VERSION_LESS 3.13)
|
|
|
|
message(FATAL_ERROR "VTK-m with CUDA requires CMake 3.13+")
|
2019-04-03 16:33:53 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-09-25 12:47:47 +00:00
|
|
|
# This includes a host of functions used by VTK-m CMake.
|
|
|
|
include(VTKmWrappers)
|
2018-05-04 18:58:11 +00:00
|
|
|
include(VTKmRenderingContexts)
|
2020-06-08 20:57:51 +00:00
|
|
|
|
|
|
|
# Setup diy magic of chosing the appropriate mpi/no_mpi library to link against
|
|
|
|
include(VTKmDIYUtils)
|
|
|
|
vtkm_diy_init_target()
|