From 0550f2307e6b5c933f1cce69c9917e8f0a8e0ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Thu, 8 Aug 2024 10:18:08 +0200 Subject: [PATCH 1/5] Enable Boost policy --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b42529d..b7e6aa03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ set (CMAKE_CXX_STANDARD_REQUIRED YES) set (CMAKE_CXX_EXTENSIONS NO) set (CMAKE_EXPORT_COMPILE_COMMANDS ON) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() + if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui From 7eddc3e243b5ffebcc7c2558654abd6e579a1f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Thu, 8 Aug 2024 10:20:21 +0200 Subject: [PATCH 2/5] Fix linker errors when using boost from config --- CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7e6aa03..ff3df18c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,14 @@ target_include_directories(precice-aste-run PRIVATE src thirdparty) target_link_libraries(precice-aste-run precice::precice Threads::Threads + Boost::boost + Boost::log + Boost::log_setup + Boost::program_options + Boost::system + Boost::thread + Boost::unit_test_framework MPI::MPI_CXX - ${Boost_LIBRARIES} ${VTK_LIBRARIES} ) @@ -75,7 +81,13 @@ endif() add_executable(test-precice-aste tests/testing.cpp tests/read_test.cpp tests/write_test.cpp src/mesh.cpp src/logger.cpp) target_include_directories(test-precice-aste PRIVATE src thirdparty) target_link_libraries(test-precice-aste - ${Boost_LIBRARIES} + Boost::boost + Boost::log + Boost::log_setup + Boost::program_options + Boost::system + Boost::thread + Boost::unit_test_framework MPI::MPI_CXX ${VTK_LIBRARIES} ) From dd233d95b37b2e50fb92e4ce851082e8737b2fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Thu, 8 Aug 2024 12:54:34 +0200 Subject: [PATCH 3/5] Add changelog --- changelog-entries/194.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog-entries/194.md diff --git a/changelog-entries/194.md b/changelog-entries/194.md new file mode 100644 index 00000000..e952ef1b --- /dev/null +++ b/changelog-entries/194.md @@ -0,0 +1 @@ +- Fixed linker errors when FindBoost uses the config. From 8538988c8ade1e7b02f4149010b34e42d77e7cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Thu, 8 Aug 2024 12:56:15 +0200 Subject: [PATCH 4/5] Request config --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff3df18c..8a881184 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ find_package (Threads REQUIRED) find_package(precice 3.0 REQUIRED) -find_package(Boost 1.71.0 REQUIRED COMPONENTS log log_setup system program_options unit_test_framework) +find_package(Boost 1.71.0 CONFIG REQUIRED COMPONENTS log log_setup system program_options unit_test_framework) # Initial attempt to find VTK without specifying components (only supported for VTK9) find_package(VTK QUIET) From 4e9d55524d2d787940766fb428d214a8b25cfa31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Thu, 8 Aug 2024 12:57:31 +0200 Subject: [PATCH 5/5] Update 194.md --- changelog-entries/194.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog-entries/194.md b/changelog-entries/194.md index e952ef1b..55b678ad 100644 --- a/changelog-entries/194.md +++ b/changelog-entries/194.md @@ -1 +1,2 @@ -- Fixed linker errors when FindBoost uses the config. +- Fixed linker errors when FindBoost uses the CMake Config. +- Changed CMake to always find boost using its CMake Config.