Warning, /acts/Core/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 configure_file(
0002 ActsVersion.hpp.in
0003 ${CMAKE_CURRENT_BINARY_DIR}/include/Acts/ActsVersion.hpp
0004 )
0005
0006 # source files will be added later
0007 acts_add_library(Core "")
0008
0009 target_sources(ActsCore PRIVATE src/ActsVersion.cpp)
0010
0011 target_compile_features(ActsCore PUBLIC ${ACTS_CXX_STANDARD_FEATURE})
0012
0013 set(ACTS_GEOMETRY_MODULE_CAPI 1)
0014 set(_acts_geometry_module_abi_tag
0015 "acts-${Acts_VERSION}|sys-${CMAKE_SYSTEM_NAME}|arch-${CMAKE_SYSTEM_PROCESSOR}|cxx-${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}|capi-${ACTS_GEOMETRY_MODULE_CAPI}"
0016 )
0017 set(ACTS_GEOMETRY_MODULE_ABI_TAG
0018 "${_acts_geometry_module_abi_tag}"
0019 CACHE INTERNAL
0020 "ACTS geometry module ABI tag"
0021 )
0022
0023 target_include_directories(
0024 ActsCore
0025 PUBLIC
0026 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0027 # for the generated version header
0028 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
0029 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0030 )
0031 target_link_libraries(ActsCore PUBLIC Boost::boost Eigen3::Eigen)
0032 if(CMAKE_DL_LIBS)
0033 target_link_libraries(ActsCore PRIVATE ${CMAKE_DL_LIBS})
0034 endif()
0035
0036 target_compile_definitions(
0037 ActsCore
0038 PRIVATE ACTS_GEOMETRY_MODULE_ABI_TAG="${_acts_geometry_module_abi_tag}"
0039 )
0040
0041 if(ACTS_PARAMETER_DEFINITIONS_HEADER)
0042 target_compile_definitions(
0043 ActsCore
0044 PUBLIC
0045 -DACTS_PARAMETER_DEFINITIONS_HEADER="${ACTS_PARAMETER_DEFINITIONS_HEADER}"
0046 )
0047 endif()
0048
0049 if(ACTS_SOURCELINK_SBO_SIZE)
0050 target_compile_definitions(
0051 ActsCore
0052 PUBLIC -DACTS_SOURCELINK_SBO_SIZE=${ACTS_SOURCELINK_SBO_SIZE}
0053 )
0054 endif()
0055
0056 if(ACTS_ENABLE_LOG_FAILURE_THRESHOLD)
0057 message(STATUS "Enable log failure threshold")
0058 target_compile_definitions(
0059 ActsCore
0060 PUBLIC -DACTS_ENABLE_LOG_FAILURE_THRESHOLD
0061 )
0062 endif()
0063
0064 if(ACTS_ENABLE_CPU_PROFILING)
0065 message(STATUS "added lprofiler")
0066
0067 if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "")
0068 find_library(PROFILER_LIBRARY profiler HINTS ${ACTS_GPERF_INSTALL_DIR})
0069
0070 target_link_libraries(ActsCore PUBLIC ${PROFILER_LIBRARY})
0071 else()
0072 target_link_libraries(ActsCore PUBLIC -lprofiler)
0073 endif()
0074
0075 target_link_options(ActsCore PUBLIC "LINKER:-no-as-needed")
0076 endif()
0077
0078 if(ACTS_ENABLE_MEMORY_PROFILING)
0079 message(STATUS "added ltcmalloc")
0080
0081 if(NOT ACTS_GPERF_INSTALL_DIR STREQUAL "")
0082 find_library(TCMALLOC_LIBRARY tcmalloc HINTS ${ACTS_GPERF_INSTALL_DIR})
0083
0084 target_link_libraries(ActsCore PUBLIC ${TCMALLOC_LIBRARY})
0085 else()
0086 target_link_libraries(ActsCore PUBLIC -ltcmalloc)
0087 endif()
0088 endif()
0089
0090 install(DIRECTORY include/Acts DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
0091
0092 # Install version header based on git repository status
0093 if(_acts_is_git_repo)
0094 # For git repositories, generate header with hash at install time
0095 install(
0096 CODE
0097 "
0098 # Get git hash at install time
0099 execute_process(
0100 COMMAND git rev-parse HEAD
0101 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
0102 OUTPUT_VARIABLE _install_git_hash
0103 OUTPUT_STRIP_TRAILING_WHITESPACE
0104 ERROR_QUIET
0105 )
0106 execute_process(
0107 COMMAND git rev-parse --short HEAD
0108 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
0109 OUTPUT_VARIABLE _install_git_hash_short
0110 OUTPUT_STRIP_TRAILING_WHITESPACE
0111 ERROR_QUIET
0112 )
0113 execute_process(
0114 COMMAND git diff-index --quiet HEAD --
0115 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
0116 RESULT_VARIABLE _git_is_dirty
0117 ERROR_QUIET
0118 )
0119
0120 if(NOT _git_is_dirty EQUAL 0)
0121 set(_install_git_hash \"\${_install_git_hash}-dirty\")
0122 set(_install_git_hash_short \"\${_install_git_hash_short}-dirty\")
0123 endif()
0124
0125 # Configure the version file with hash and version numbers
0126 set(_acts_commit_hash \"\\\"\${_install_git_hash}\\\"\")
0127 set(_acts_commit_hash_short \"\\\"\${_install_git_hash_short}\\\"\")
0128 set(PROJECT_VERSION_MAJOR \"${PROJECT_VERSION_MAJOR}\")
0129 set(PROJECT_VERSION_MINOR \"${PROJECT_VERSION_MINOR}\")
0130 set(PROJECT_VERSION_PATCH \"${PROJECT_VERSION_PATCH}\")
0131 configure_file(
0132 ${CMAKE_CURRENT_SOURCE_DIR}/ActsVersion.hpp.in
0133 ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/Acts/ActsVersion.hpp
0134 @ONLY
0135 )
0136 "
0137 )
0138 else()
0139 # For non-git sources (e.g., tarball), just copy the build-time header
0140 install(
0141 FILES ${CMAKE_CURRENT_BINARY_DIR}/include/Acts/ActsVersion.hpp
0142 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Acts
0143 )
0144 endif()
0145
0146 # target source files are added separately
0147 add_subdirectory(src/EventData)
0148 add_subdirectory(src/Definitions)
0149 add_subdirectory(src/Geometry)
0150 add_subdirectory(src/MagneticField)
0151 add_subdirectory(src/Material)
0152 add_subdirectory(src/Navigation)
0153 add_subdirectory(src/Propagator)
0154 add_subdirectory(src/Seeding)
0155 add_subdirectory(src/SpacePointFormation)
0156 add_subdirectory(src/Surfaces)
0157 add_subdirectory(src/TrackFinding)
0158 add_subdirectory(src/TrackFitting)
0159 add_subdirectory(src/Utilities)
0160 add_subdirectory(src/Vertexing)
0161 add_subdirectory(src/Visualization)
0162 add_subdirectory(src/AmbiguityResolution)
0163
0164 acts_compile_headers(Core GLOB include/Acts/**/*.hpp)