Skip to content

Commit

Permalink
[cmake] Fix for system-installed boost.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Oct 1, 2024
1 parent 9812ed8 commit 1b35e53
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions scripts/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,35 @@ if(OGS_USE_MFRONT)
endif()
endif()

# Boost libraries used by ogs, can be linked with Boost::[lib_name]
set(BOOST_INCLUDE_LIBRARIES
math
property_tree
algorithm
smart_ptr
tokenizer
assign
dynamic_bitset
range
variant
)
if(GUIX_BUILD)
find_package(Boost REQUIRED)
else()
# Boost libraries used by ogs, can be linked with Boost::[lib_name]
set(BOOST_INCLUDE_LIBRARIES
math
property_tree
algorithm
smart_ptr
tokenizer
assign
dynamic_bitset
range
)
CPMFindPackage(
NAME Boost
VERSION ${ogs.minimum_version.boost}
URL https://github.com/boostorg/boost/releases/download/boost-${ogs.minimum_version.boost}/boost-${ogs.minimum_version.boost}.tar.xz
OPTIONS "BOOST_ENABLE_CMAKE ON"
)
endif()
if(NOT Boost_ADDED)
# Boost from system found. There are only Boost::headers and Boost::boost
# targets.
foreach(lib ${BOOST_INCLUDE_LIBRARIES})
add_library(Boost::${lib} ALIAS Boost::headers)
endforeach()
endif()

CPMFindPackage(
NAME LibXml2
Expand Down

0 comments on commit 1b35e53

Please sign in to comment.