vtk-m/CMake/VTKmConfig.cmake.in
Kenneth Moreland 5d67b918dc Use CMakePackageConfigHelpers to make config files
This is a little tricky since they don't seem to have considered that
you will have files in both the source and build directory or that the
file locations will not match exactly with the install locations.
2016-06-21 18:03:21 -06:00

85 lines
2.9 KiB
CMake
Executable File

##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
## 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.
##
## Copyright 2014 Sandia Corporation.
## Copyright 2014 UT-Battelle, LLC.
## Copyright 2014 Los Alamos National Security.
##
## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
## the U.S. Government retains certain rights in this software.
##
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
## Laboratory (LANL), the U.S. Government retains certain rights in
## this software.
##============================================================================
# When this file is run by CMake (usually through the find_package command),
# The following variables will be defined:
#
# VTKm_INCLUDE_DIRS - Directories containing VTK-m and dependent headers
# VTKm_LIBRARIES - The libraries required when using VTK-m
@PACKAGE_INIT@
# The VTKm version number
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@")
# This is true when the package is still in the build directory (not installed)
if(CMAKE_CURRENT_LIST_DIR STREQUAL "@VTKm_BINARY_DIR@/@VTKm_INSTALL_CONFIG_DIR@")
set(VTKm_PACKAGE_IN_BUILD)
endif()
# The VTKm include file directories.
set_and_check(VTKm_INCLUDE_DIRS "@PACKAGE_VTKm_INSTALL_INCLUDE_DIR@")
if(VTKm_PACKAGE_IN_BUILD)
set(VTKm_INCLUDE_DIRS ${VTKm_INCLUDE_DIRS} "@VTKm_SOURCE_DIR@")
endif()
set(VTKm_REQUIRED_BOOST_VERSION "@VTKm_REQUIRED_BOOST_VERSION@")
if(NOT VTKm_PACKAGE_IN_BUILD)
set_and_check(VTKm_CMAKE_MODULE_PATH "@PACKAGE_VTKm_INSTALL_CMAKE_MODULE_DIR@")
else()
set(VTKm_CMAKE_MODULE_PATH "@VTKm_SOURCE_DIR@/CMake")
endif()
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")
set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
# VTKm requires some CMake Find modules not included with CMake, so
# include the CMake modules distributed with VTKm.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_CMAKE_MODULE_PATH})
include(VTKmMacros)
if(VTKm_FIND_REQUIRED)
set(vtkm_is_required REQUIRED)
else()
set(vtkm_is_required)
endif()
vtkm_configure_device(Serial ${vtkm_is_required})
if(VTKm_ENABLE_CUDA)
vtkm_configure_device(CUDA)
endif()
if(VTKm_ENABLE_TBB)
# If configured with TBB, the VTK-m header files might choose TBB as the
# default device. In that case, the TBB device is required.
vtkm_configure_device(TBB ${vtkm_is_required})
endif()
# Extra compile options that VTKm has generated, such as vectorization settings.
# This should be specified to any target with the CMake command target_compile_options
# that uses VTK-m.
set(VTKm_COMPILE_OPTIONS "@VTKm_COMPILE_OPTIONS@")
check_required_components(VTKm)