Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/cmake/ActsConfig.cmake.in is written in an unsupported language. File is not indexed.

0001 # CMake config for the Acts package
0002 #
0003 # Defines CMake targets for requested and available components.  All additional
0004 # information, e.g. include directories and dependencies, are defined as
0005 # target-specific properties and are automatically propagated when linking to
0006 # the target.
0007 #
0008 # Defines the following additional variables:
0009 #
0010 #   - Acts_COMPONENTS
0011 #   - Acts_COMMIT_HASH
0012 #   - Acts_COMMIT_HASH_SHORT
0013 
0014 # This file uses `if(... IN_LIST ...)`, which needs policy CMP0057 set to NEW.
0015 # find_package gives this file its own policy scope, inherited from the calling
0016 # project, so a client with an older cmake_minimum_required would otherwise fail
0017 # here. The upper bound keeps the policy version at the CMake that generated the
0018 # config, matching the Acts*Targets.cmake files included below.
0019 cmake_policy(VERSION 3.10...@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@)
0020 
0021 @PACKAGE_INIT@
0022 
0023 # Components can be installed separately from this file, e.g. when a package
0024 # manager ships plugins in their own packages. Advertise the known components
0025 # whose targets and dependency files are installed, in the order they were
0026 # registered.
0027 set(Acts_COMPONENTS)
0028 foreach(_component @_known_components@)
0029     if(
0030         EXISTS "${CMAKE_CURRENT_LIST_DIR}/Acts${_component}Targets.cmake"
0031         AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/Acts${_component}Dependencies.cmake"
0032     )
0033         list(APPEND Acts_COMPONENTS ${_component})
0034     endif()
0035 endforeach()
0036 set(Acts_COMMIT_HASH "@_acts_commit_hash@")
0037 set(Acts_COMMIT_HASH_SHORT "@_acts_commit_hash_short@")
0038 set(ACTS_GEOMETRY_MODULE_ABI_TAG "@ACTS_GEOMETRY_MODULE_ABI_TAG@")
0039 
0040 # print version and components information
0041 if(NOT Acts_FIND_QUIETLY)
0042     message(
0043         STATUS
0044         "Found ACTS version ${Acts_VERSION} commit ${Acts_COMMIT_HASH_SHORT}"
0045     )
0046 endif()
0047 
0048 # add this to the current CMAKE_MODULE_PATH to find third party modules
0049 # that not provide a XXXConfig.cmake or XXX-config.cmake file, and to allow
0050 # including Acts-provided cmake helpers (e.g. ActsDD4hepGeometryModuleHelpers)
0051 list(
0052     APPEND CMAKE_MODULE_PATH
0053     ${CMAKE_CURRENT_LIST_DIR}/Modules
0054     ${CMAKE_CURRENT_LIST_DIR}
0055 )
0056 
0057 # find external dependencies that are needed to link with Acts. since the
0058 # exported Acts targets only store the linked external target names they need
0059 # to be found again. this avoids hard-coded paths and makes the installed
0060 # config/library relocatable. use exact version match where possible to ensure
0061 # the same versions are found that were used at build time.
0062 # `find_dependency` is a wrapper around `find_package` that automatically
0063 # handles QUIET and REQUIRED parameters.
0064 include(CMakeFindDependencyMacro)
0065 find_dependency(Threads)
0066 find_dependency(Boost @Boost_VERSION_STRING@ CONFIG EXACT)
0067 if(@ACTS_USE_SYSTEM_EIGEN3@)
0068     find_dependency(Eigen3 @Eigen3_VERSION@ CONFIG EXACT)
0069 endif()
0070 
0071 # each component records the ACTS version it was built with and finds its own
0072 # external dependencies at the versions used for its build. components from a
0073 # different ACTS version are dropped.
0074 foreach(_component ${Acts_COMPONENTS})
0075     unset(_acts_component_version)
0076     include(${CMAKE_CURRENT_LIST_DIR}/Acts${_component}Dependencies.cmake)
0077     # find_dependency only returns from the included file on failure
0078     if(DEFINED Acts_FOUND AND NOT Acts_FOUND)
0079         return()
0080     endif()
0081     if(DEFINED _acts_component_version)
0082         list(REMOVE_ITEM Acts_COMPONENTS ${_component})
0083         if(NOT Acts_FIND_QUIETLY)
0084             message(
0085                 STATUS
0086                 "ignore component '${_component}' built for ACTS version ${_acts_component_version}"
0087             )
0088         endif()
0089     endif()
0090 endforeach()
0091 
0092 # check that requested components are available
0093 foreach(_component ${Acts_FIND_COMPONENTS})
0094     # check if this component is available
0095     if(NOT _component IN_LIST Acts_COMPONENTS)
0096         if(${Acts_FIND_REQUIRED_${_component}})
0097             # not supported, but required -> fail
0098             set(Acts_FOUND False)
0099             set(Acts_NOT_FOUND_MESSAGE
0100                 "required component '${_component}' not found"
0101             )
0102         else()
0103             # not supported and optional -> skip
0104             list(REMOVE_ITEM Acts_FIND_COMPONENTS ${_component})
0105             if(NOT Acts_FIND_QUIETLY)
0106                 message(STATUS "optional component '${_component}' not found")
0107             endif()
0108         endif()
0109     endif()
0110 endforeach()
0111 
0112 # dependencies that we have built ourselves but cannot be
0113 # straightforwardly handed to cmake
0114 if(NOT @ACTS_USE_SYSTEM_EIGEN3@)
0115     add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
0116     target_include_directories(
0117         Eigen3::Eigen
0118         INTERFACE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}"
0119     )
0120 endif()
0121 
0122 if(PluginEDM4hep IN_LIST Acts_COMPONENTS)
0123     include(${CMAKE_CURRENT_LIST_DIR}/ActsPodioEdmTargets.cmake)
0124 endif()
0125 
0126 # load **all** available components. we can not just include the requested
0127 # components since there can be interdependencies between them.
0128 if(NOT Acts_FIND_QUIETLY)
0129     message(STATUS "loading components:")
0130 endif()
0131 foreach(_component ${Acts_COMPONENTS})
0132     if(NOT Acts_FIND_QUIETLY)
0133         message(STATUS "  ${_component}")
0134     endif()
0135     # include the targets file to create the imported targets for the user
0136     include(${CMAKE_CURRENT_LIST_DIR}/Acts${_component}Targets.cmake)
0137 endforeach()