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