diff --git a/CMakeLists.txt b/CMakeLists.txt index a4fd002e871..5487b731292 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,36 @@ include(ActsRetrieveVersion) project(Acts VERSION ${_acts_version} LANGUAGES CXX) +# policy settings + +# Steers how project() handles the VERSION option +cmake_policy(SET CMP0048 NEW) + +# the `_VERSION` variables set by `setup(... VERSION ...)` have +# only local scope, i.e. they are not accessible her for dependencies added +# via `add_subdirectory`. this overrides the `project(...)` function for +# sub-projects such that the resulting `_VERSION` has +# global scope and is accessible within the main project later on. +macro(project) + _project(${ARGN}) + set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "") +endmacro() + +# Controls the way python is located +if(POLICY CMP0094) + cmake_policy(SET CMP0094 NEW) +endif() + +# Controls behavior of DOWNLOAD_EXTRACT_TIMESTAMP +if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) +endif() + +# Use boost's cmake config files +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() + # build options # all options and compile-time parameters must be defined here for clear @@ -253,17 +283,8 @@ set(_acts_boost_recommended_version 1.78.0) # Include the sources for the external dependencies. include(ActsExternSources) -# Controls behavior of DOWNLOAD_EXTRACT_TIMESTAMP -if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) -endif() - # required packages if(ACTS_SETUP_BOOST) - if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) - endif() - # Enable both program_options and unit_test_framework to reduce complexity # Also Cuda tests seem to use program_options if( @@ -311,17 +332,6 @@ endif() find_package(Filesystem REQUIRED) -# the `_VERSION` variables set by `setup(... VERSION ...)` have -# only local scope, i.e. they are not accessible her for dependencies added -# via `add_subdirectory`. this overrides the `project(...)` function for -# sub-projects such that the resulting `_VERSION` has -# global scope and is accessible within the main project later on. -cmake_policy(SET CMP0048 NEW) -macro(project) - _project(${ARGN}) - set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION}" CACHE INTERNAL "") -endmacro() - # CUDA settings are collected here in a macro, so that they can be reused by different plugins macro(enable_cuda) enable_language(CUDA) diff --git a/CMakePresets.json b/CMakePresets.json index 2aef0f3fe94..fc7275cbd4e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -47,6 +47,7 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", + "CMAKE_FIND_FRAMEWORK": "LAST", "ACTS_FORCE_ASSERTIONS": "ON", "ACTS_ENABLE_LOG_FAILURE_THRESHOLD": "ON", "ACTS_BUILD_BENCHMARKS": "ON",