Skip to content

Commit

Permalink
Merge pull request #6614 from STEllAR-GROUP/fix-find-boost-with-cmake…
Browse files Browse the repository at this point in the history
…-module

Fix fallback to module mode for CMake finding Boost
  • Loading branch information
hkaiser authored Feb 24, 2025
2 parents 62d92ad + 9c11915 commit 095711b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmake/HPX_SetupBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,20 @@ if(NOT TARGET hpx_dependencies_boost)
CACHE INTERNAL "1.71" FORCE
)

# Search using CONFIG mode first
find_package(
Boost ${Boost_MINIMUM_VERSION} NO_POLICY_SCOPE REQUIRED
Boost ${Boost_MINIMUM_VERSION} CONFIG QUIET NO_POLICY_SCOPE
COMPONENTS ${__boost_libraries} HINTS ${HPX_BOOST_ROOT} $ENV{BOOST_ROOT}
)

if(NOT Boost_FOUND)
# Search using MODULE mode
find_package(
Boost ${Boost_MINIMUM_VERSION} MODULE REQUIRED NO_POLICY_SCOPE
COMPONENTS ${__boost_libraries}
)
endif()

add_library(hpx_dependencies_boost INTERFACE IMPORTED)

target_link_libraries(hpx_dependencies_boost INTERFACE Boost::boost)
Expand Down

0 comments on commit 095711b

Please sign in to comment.