diff --git a/CMakeLists.txt b/CMakeLists.txt index 87cf5eb6f66..c9db6f44bc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,9 @@ option(ACTS_BUILD_INTEGRATIONTESTS "Build integration tests" OFF) option(ACTS_BUILD_UNITTESTS "Build unit tests" OFF) # other options option(ACTS_BUILD_DOCS "Build documentation" OFF) +option(ACTS_SETUP_BOOST "Explicitly set up Boost for the project" ON) option(ACTS_USE_SYSTEM_BOOST "Use a system-provided boost" ON) +option(ACTS_SETUP_EIGEN3 "Explicitly set up Eigen3 for the project" ON) option(ACTS_USE_SYSTEM_EIGEN3 "Use a system-provided eigen3" ON) # handle option inter-dependencies and the everything flag @@ -137,18 +139,22 @@ set(_acts_tbb_version 2020.1) # required packages -if (ACTS_USE_SYSTEM_BOOST) - # NOTE we use boost::filesystem instead of std::filesystem since the later - # is not uniformly supported even on compilers that nominally support C++17 - find_package(Boost ${_acts_boost_version} REQUIRED CONFIG COMPONENTS filesystem program_options unit_test_framework) -else() - add_subdirectory(thirdparty/boost) +if (ACTS_SETUP_BOOST) + if (ACTS_USE_SYSTEM_BOOST) + # NOTE we use boost::filesystem instead of std::filesystem since the later + # is not uniformly supported even on compilers that nominally support C++17 + find_package(Boost ${_acts_boost_version} REQUIRED CONFIG COMPONENTS filesystem program_options unit_test_framework) + else() + add_subdirectory(thirdparty/boost) + endif() endif() -if (ACTS_USE_SYSTEM_EIGEN3) - find_package(Eigen3 ${_acts_eigen3_version} REQUIRED CONFIG) -else() - add_subdirectory(thirdparty/eigen3) +if (ACTS_SETUP_EIGEN3) + if (ACTS_USE_SYSTEM_EIGEN3) + find_package(Eigen3 ${_acts_eigen3_version} REQUIRED CONFIG) + else() + add_subdirectory(thirdparty/eigen3) + endif() endif() # the `_VERSION` variables set by `setup(... VERSION ...)` have