Skip to content

Commit

Permalink
Introduced the ACTS_SETUP_BOOST and ACTS_SETUP_EIGEN3 flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
krasznaa committed Nov 5, 2021
1 parent 9bfe0b8 commit 8d71b21
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 `<project_name>_VERSION` variables set by `setup(... VERSION ...)` have
Expand Down

0 comments on commit 8d71b21

Please sign in to comment.