diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt index fc14b9dfd9f..1f4b9ebe84f 100644 --- a/Applications/FileIO/CMakeLists.txt +++ b/Applications/FileIO/CMakeLists.txt @@ -32,6 +32,7 @@ target_link_libraries( $<$:QtBase> $<$:shp> $<$:SwmmInterface> + Boost::dynamic_bitset PRIVATE MeshLib MeshToolsLib GitInfoLib ) diff --git a/BaseLib/CMakeLists.txt b/BaseLib/CMakeLists.txt index 71664c7801a..de9b42964c1 100644 --- a/BaseLib/CMakeLists.txt +++ b/BaseLib/CMakeLists.txt @@ -10,7 +10,8 @@ ogs_add_library(BaseLib GENERATE_EXPORT_HEADER ${SOURCES}) target_link_libraries( BaseLib - PUBLIC Boost::headers + PUBLIC Boost::algorithm + Boost::property_tree spdlog tclap $<$:WinMM> # needed for timeGetTime diff --git a/MaterialLib/CMakeLists.txt b/MaterialLib/CMakeLists.txt index 5f33d7bdf7e..c870201ece9 100644 --- a/MaterialLib/CMakeLists.txt +++ b/MaterialLib/CMakeLists.txt @@ -38,7 +38,7 @@ ogs_add_library(MaterialLib GENERATE_EXPORT_HEADER ${SOURCES}) target_link_libraries( MaterialLib PUBLIC BaseLib Eigen3::Eigen MaterialLib_SolidModels MaterialLib_FractureModels - PRIVATE MathLib MeshLib ParameterLib exprtk Boost::headers + PRIVATE MathLib MeshLib ParameterLib exprtk Boost::math ) target_precompile_headers( diff --git a/MaterialLib/FractureModels/CMakeLists.txt b/MaterialLib/FractureModels/CMakeLists.txt index ac8fecf84c1..31a6103f501 100644 --- a/MaterialLib/FractureModels/CMakeLists.txt +++ b/MaterialLib/FractureModels/CMakeLists.txt @@ -4,4 +4,5 @@ append_source_files(SOURCES Permeability) ogs_add_library(MaterialLib_FractureModels GENERATE_EXPORT_HEADER ${SOURCES}) target_link_libraries( MaterialLib_FractureModels PUBLIC MathLib PRIVATE ParameterLib NumLib + Boost::math ) diff --git a/MaterialLib/SolidModels/CMakeLists.txt b/MaterialLib/SolidModels/CMakeLists.txt index d4e155ccb3c..c68895b48a1 100644 --- a/MaterialLib/SolidModels/CMakeLists.txt +++ b/MaterialLib/SolidModels/CMakeLists.txt @@ -2,8 +2,8 @@ get_source_files(SOURCES) ogs_add_library(MaterialLib_SolidModels ${SOURCES}) target_link_libraries( - MaterialLib_SolidModels PUBLIC MathLib PRIVATE ParameterLib - NumLib + MaterialLib_SolidModels PUBLIC MathLib Boost::math PRIVATE ParameterLib + NumLib ) if(OGS_USE_MFRONT) @@ -14,5 +14,7 @@ if(OGS_USE_MFRONT) ) endif() -target_precompile_headers(MaterialLib_SolidModels PRIVATE [["BaseLib/Error.h"]] - [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] ) +target_precompile_headers( + MaterialLib_SolidModels PRIVATE [["BaseLib/Error.h"]] + [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] +) diff --git a/MaterialLib/SolidModels/MFront/CMakeLists.txt b/MaterialLib/SolidModels/MFront/CMakeLists.txt index 0c6ec6c4138..761a4536d23 100644 --- a/MaterialLib/SolidModels/MFront/CMakeLists.txt +++ b/MaterialLib/SolidModels/MFront/CMakeLists.txt @@ -13,8 +13,7 @@ ogs_add_library(MaterialLib_SolidModels_MFront ${SOURCES}) target_link_libraries( MaterialLib_SolidModels_MFront PUBLIC BaseLib NumLib MFrontGenericInterface - Boost::headers PRIVATE MathLib MeshLib - ParameterLib + PRIVATE MathLib MeshLib ParameterLib ) target_include_directories( MaterialLib_SolidModels_MFront PUBLIC ThirdParty/MGIS/include diff --git a/NumLib/CMakeLists.txt b/NumLib/CMakeLists.txt index d41f389d485..8adbf0c68b8 100644 --- a/NumLib/CMakeLists.txt +++ b/NumLib/CMakeLists.txt @@ -19,8 +19,8 @@ ogs_add_library(NumLib GENERATE_EXPORT_HEADER ${SOURCES}) set_target_properties(NumLib PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries( - NumLib PUBLIC BaseLib GeoLib MathLib MeshLib $<$:petsc> - Boost::headers + NumLib PUBLIC BaseLib GeoLib MathLib MeshLib + $<$:petsc> ) target_precompile_headers( diff --git a/ProcessLib/CMakeLists.txt b/ProcessLib/CMakeLists.txt index 44a70eb8b16..0ba3ad42c8a 100644 --- a/ProcessLib/CMakeLists.txt +++ b/ProcessLib/CMakeLists.txt @@ -18,18 +18,19 @@ append_source_files(SOURCES Output) append_source_files(SOURCES Utils) append_source_files(SOURCES Reflection) append_source_files(SOURCES Graph) -### For processes that contains both hydraulical process and mechanical process +# For processes that contains both hydraulical process and mechanical process # Define a function to check if enabled_processes contains LIE, HydroMechanics, # ThermoHydroMechanics, RichardsMechanics, or ThermoRichardsMechanics function(check_enabled_processes contains_hm_process) set(${contains_hm_process} FALSE PARENT_SCOPE) foreach(process ${_enabled_processes}) if(process STREQUAL "LIE" - OR process STREQUAL "HydroMechanics" - OR process STREQUAL "ThermoHydroMechanics" - OR process STREQUAL "RichardsMechanics" - OR process STREQUAL "TH2M" - OR process STREQUAL "ThermoRichardsMechanics") + OR process STREQUAL "HydroMechanics" + OR process STREQUAL "ThermoHydroMechanics" + OR process STREQUAL "RichardsMechanics" + OR process STREQUAL "TH2M" + OR process STREQUAL "ThermoRichardsMechanics" + ) set(${contains_hm_process} TRUE PARENT_SCOPE) return() endif() @@ -46,17 +47,15 @@ add_subdirectory(BoundaryConditionAndSourceTerm/Python) target_link_libraries( ProcessLib - PUBLIC - BaseLib - MaterialLib - MathLib - MeshGeoToolsLib - MeshLib - NumLib - Boost::headers - range-v3 - $<$:petsc> - ProcessLibBoundaryConditionAndSourceTermPython + PUBLIC BaseLib + MaterialLib + MathLib + MeshGeoToolsLib + MeshLib + NumLib + range-v3 + $<$:petsc> + ProcessLibBoundaryConditionAndSourceTermPython PRIVATE ParameterLib GitInfoLib $<$:InSituLib> ) diff --git a/ProcessLib/LIE/Common/CMakeLists.txt b/ProcessLib/LIE/Common/CMakeLists.txt index cd14160f8cf..ebad69a017a 100644 --- a/ProcessLib/LIE/Common/CMakeLists.txt +++ b/ProcessLib/LIE/Common/CMakeLists.txt @@ -1,4 +1,4 @@ get_source_files(SOURCES) ogs_add_library(LIECommon ${SOURCES}) -target_link_libraries(LIECommon PUBLIC MeshLib) +target_link_libraries(LIECommon PUBLIC MeshLib PRIVATE Boost::math) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 61d5503cddf..66b62c62662 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -112,7 +112,7 @@ target_link_libraries( TestInfoLib VTK::FiltersGeneral VTK::FiltersSources - Boost::headers # TODO move OGSMFrontThermodynamicForcesView to MathLib? + Boost::math # TODO move OGSMFrontThermodynamicForcesView to MathLib? $<$:LIE> $<$:TH2M> $<$,$>:MPI::MPI_CXX> diff --git a/Tests/xdmfdiff/CMakeLists.txt b/Tests/xdmfdiff/CMakeLists.txt index 761902f13f4..857cbfe155b 100644 --- a/Tests/xdmfdiff/CMakeLists.txt +++ b/Tests/xdmfdiff/CMakeLists.txt @@ -1,3 +1,3 @@ ogs_add_executable(xdmfdiff xdmfdiff.cpp) -target_link_libraries(xdmfdiff OgsXdmf GitInfoLib tclap) +target_link_libraries(xdmfdiff OgsXdmf GitInfoLib tclap Boost::range) install(PROGRAMS $ DESTINATION bin) diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index 20df3a23449..cc54682e716 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -193,13 +193,22 @@ endif() 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" - "BOOST_INCLUDE_LIBRARIES algorithm\\\;math\\\;multi_index\\\;property_tree\\\;smart_ptr" + OPTIONS "BOOST_ENABLE_CMAKE ON" ) endif() @@ -402,15 +411,16 @@ if((OGS_BUILD_TESTING OR OGS_BUILD_UTILS) AND NOT GUIX_BUILD) OgsXdmf SYSTEM PUBLIC ${xdmf_SOURCE_DIR} ${xdmf_BINARY_DIR} ) - target_link_libraries(OgsXdmf Boost::headers) + target_link_libraries(OgsXdmf Boost::tokenizer) target_include_directories( OgsXdmfCore SYSTEM PUBLIC ${xdmf_SOURCE_DIR}/core ${xdmf_BINARY_DIR}/core PRIVATE ${xdmf_SOURCE_DIR}/CMake/VersionSuite ) target_link_libraries( - OgsXdmfCore PUBLIC Boost::headers LibXml2::LibXml2 - ${HDF5_LIBRARIES} + OgsXdmfCore PUBLIC LibXml2::LibXml2 ${HDF5_LIBRARIES} Boost::variant + Boost::smart_ptr + PRIVATE Boost::tokenizer Boost::assign Boost::algorithm ) set_target_properties(