Skip to content

Commit

Permalink
build: Unconditionally load Boost in CMake config (#3779)
Browse files Browse the repository at this point in the history
Currently, as @krasznaa discovered, the finding of the Boost dependency in an installed version of Acts (i.e., through `ActsConfig.cmake` uses the `@ACTS_USE_SYSTEM_BOOST@` template, but this variable no longer exists.

CMake, in its infinite wisdom, silently ignores this, producing `if()`, which it _again_ silently accepts and which apparently evaluates to false, so Boost is never loaded.

This commit fixes the issue by ensuring that Boost is loaded unconditionally.
  • Loading branch information
stephenswat authored Oct 24, 2024
1 parent dd23506 commit 645a8d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 1 addition & 7 deletions cmake/ActsConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/Modules)
# `find_dependency` is a wrapper around `find_package` that automatically
# handles QUIET and REQUIRED parameters.
include(CMakeFindDependencyMacro)
if(@ACTS_USE_SYSTEM_BOOST@)
find_dependency(Boost @Boost_VERSION_STRING@ CONFIG EXACT)
endif()
find_dependency(Boost @Boost_VERSION_STRING@ CONFIG EXACT)
if(@ACTS_USE_SYSTEM_EIGEN3@)
find_dependency(Eigen3 @Eigen3_VERSION@ CONFIG EXACT)
endif()
Expand Down Expand Up @@ -86,10 +84,6 @@ endif()

# dependencies that we have built ourselves but cannot be
# straightforwardly handed to cmake
if(NOT @ACTS_USE_SYSTEM_BOOST@)
add_library(Boost::boost INTERFACE IMPORTED GLOBAL)
target_include_directories(Boost::boost INTERFACE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if(NOT @ACTS_USE_SYSTEM_EIGEN3@)
add_library(Eigen3::Eigen INTERFACE IMPORTED GLOBAL)
target_include_directories(Eigen3::Eigen INTERFACE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
Expand Down
4 changes: 1 addition & 3 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ CMake instructions to build [nlohmann::json](https://github.com/nlohmann/json).
## boost

For convenience, it's possible to use the ACTS build system to build the minimum
required version of [boost](https://www.boost.org/) (currently 1.71.0). No source is
bundled here, and if requested via "-DACTS_USE_SYSTEM_BOOST=OFF", only the filesystem,
program_options, and test libraries will be built.
required version of [boost](https://www.boost.org/) (currently 1.71.0).

Warning: during installation, the built boost libraries will be installed alongside the
ACTS libraries, with a version suffix. This location may be known to the system linker.
Expand Down

0 comments on commit 645a8d1

Please sign in to comment.