1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
# VecGeomConfig.cmake
# -------------------
#
# Config mode file for the VecGeom includes and libraries
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following `IMPORTED` targets:
#
# - VecGeom::vecgeom - VecGeom library
# - VecGeom::vgdml - Present if the GDML parser component was built
# - VecGeom::vecgeomcuda_static - Present if the CUDA backend was built.
# Static library containing all cuda-related parts of VecGeom with
# device code that can be linked/device-linked against if client code
# uses VecGeom device functions/kernels. It automatically provides the
# dependency to the vecgeom library.
# - VecGeom::vecgeomcuda - Present if the CUDA backend was built
# Shared library with same objects as VecGeom::vecgeomcuda_static and
# including a device link object. Non-CUDA using clients can link against
# this directly. CUDA using clients should prefer the static version.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables either directly, or automatically
# though CMake's find_package command.
#
# - VecGeom_FOUND - True if VecGeom was found.
# - VecGeom_INCLUDE_DIRS - Location of the VecGeom header files.
# - VecGeom_LIBRARIES - The VecGeom libraries
# Use of the ``IMPORTED`` targets described above should be preferred.
# - VecGeom_shared_FOUND - True if the VecGeom C++ library is shared.
# - VecGeom_static_FOUND - True if the VecGeom C++ library is static.
# - VecGeom_GDML_FOUND - True if the VecGeom GDML parser library is available.
# - VecGeom_CUDA_FOUND - True if VecGeom was built with CUDA support.
# - VecGeom_scalar_backend_FOUND - True if the VecGeom backend is scalar.
# - VecGeom_vector_backend_FOUND - True if the VecGeom backend is vector.
# - VecGeom_vc_backend_FOUND - True if the VecGeom vector backend is Vc.
#
# - VecGeom_BUILTIN_VECCORE - True if VecGeom was built with an internal version on VecCore.
# - VecGeom_CXX_STANDARD - ISO C++ Standard used to compile VecGeom (e.g. "17").
# - VecGeom_VECTOR_ISA - String holding the Instruction Set Architecture VecGeom
# was compiled against (e.g. "sse4.2"). The empty string
# if no explicit flag was used.
# - VecGeom_CUDA_STANDARD - CUDA/C++ Standard used to compile VecGeom's CUDA library (e.g. "17")
# Unset unless ``VecGeom_CUDA_FOUND`` is ``TRUE``.
# - VecGeom_CUDA_ARCHITECTURES - Value of ``CMAKE_CUDA_ARCHITECTURES`` used to compile/link
# VecGeom's CUDA library. Unset unless ``VecGeom_CUDA_FOUND`` is ``TRUE``.
#
# The ``VecGeom_<component>_FOUND`` variables provide support for component arguments
# to ``find_package``, allowing consumers to require that the found VecGeom supports the component
# i.e.
#
# .. code-block:: cmake
#
# find_package(VecGeom REQUIRED <component1> ... <componentN>)
#
@PACKAGE_INIT@
# Basic variables
set_and_check(VECGEOM_INCLUDE_DIR "@PACKAGE_CONF_INCLUDE_DIR@")
set(VECGEOM_INCLUDE_DIRS ${VECGEOM_INCLUDE_DIR})
# C++ Standard used in build
set(VecGeom_CXX_STANDARD "@CMAKE_CXX_STANDARD@")
# Scalar/Vector Backend, Backend Implementation, and ISA
set(VecGeom_scalar_backend_FOUND @VECGEOM_SCALAR@)
set(VecGeom_vc_backend_FOUND @VECGEOM_VC@)
if(VecGeom_vc_FOUND)
set(VecGeom_vector_backend_FOUND ON)
endif()
# Take default, but clear if it's "empty" as this is an internal "no flag supplied" case
set(VecGeom_VECTOR_ISA "@VECGEOM_VECTOR@")
if(VecGeom_VECTOR_ISA STREQUAL "empty")
unset(VecGeom_VECTOR_ISA)
endif()
# For refinding required dependencies
include(CMakeFindDependencyMacro)
# Always VecCore
set(VecGeom_BUILTIN_VECCORE @VECGEOM_BUILTIN_VECCORE@)
if(VecGeom_BUILTIN_VECCORE)
# Must find our builtin where we expect
find_dependency(VecCore @VecCore_VERSION@ NO_DEFAULT_PATH PATHS "@PACKAGE_VECCORE_PREFIX@" COMPONENTS @VecCore_COMPONENTS@ )
else()
find_dependency(VecCore @VecCore_VERSION@ COMPONENTS @VecCore_COMPONENTS@)
endif()
# CUDA, if built
set(VecGeom_CUDA_FOUND @VECGEOM_ENABLE_CUDA@)
if(VecGeom_CUDA_FOUND)
set(VecGeom_CUDA_STANDARD "@CMAKE_CUDA_STANDARD@")
set(VecGeom_CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@")
find_dependency(CUDAToolkit REQUIRED)
endif()
# GDML (Xerces-C), if built
set(VecGeom_GDML_FOUND @VECGEOM_GDML@)
if(VecGeom_GDML_FOUND)
find_dependency(XercesC)
endif()
# DEPRECATED - ROOT only used for testing/benchmarking
set(VecGeom_ROOT_FOUND @VECGEOM_ROOT@)
if(VecGeom_ROOT_FOUND)
find_dependency(ROOT)
endif()
# DEPRECATED - Geant4 only used for testing/benchmarking
set(VecGeom_Geant4_FOUND @VECGEOM_GEANT4@)
if(VecGeom_Geant4_FOUND)
find_dependency(Geant4 @Geant4_VERSION@)
endif()
# Include our target definitions
include("${CMAKE_CURRENT_LIST_DIR}/VecGeomTargets.cmake")
# Static or Shared CPU found
set(VecGeom_static_FOUND FALSE)
set(VecGeom_shared_FOUND FALSE)
get_target_property(__libvecgeom_type VecGeom::vecgeom TYPE)
if(__libvecgeom_type STREQUAL "SHARED_LIBRARY")
set(VecGeom_shared_FOUND TRUE)
endif()
if(__libvecgeom_type STREQUAL "STATIC_LIBRARY")
set(VecGeom_static_FOUND TRUE)
endif()
# Setup VECGEOM_LIBRARIES so that it should "work" for consumers
# _not_ implementing their own kernels/device code.
set(VECGEOM_LIBRARIES VecGeom::vecgeom)
if(TARGET VecGeom::vecgeomcuda)
list(APPEND VECGEOM_LIBRARIES VecGeom::vecgeomcuda)
set(VECGEOM_CUDA_STATIC_LIBRARY VecGeom::vecgeomcuda_static)
endif()
check_required_components(VecGeom)
|