]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: FindDEAL_II_BOOST: use modern project config and import targets
authorMatthias Maier <tamiko@43-1.org>
Tue, 23 Jul 2024 16:47:18 +0000 (11:47 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 31 Jan 2025 15:58:02 +0000 (09:58 -0600)
cmake/configure/configure_20_boost.cmake
cmake/modules/FindDEAL_II_BOOST.cmake

index ee57c43d6df47a961a043c598edaa3ee41cbd7db..fa612d4975201646cee52628379a6fc72d42f4d3 100644 (file)
@@ -42,7 +42,7 @@ macro(feature_boost_find_external var)
       # Test that Boost.Iostreams is usable.
       #
       reset_cmake_required()
-      list(APPEND CMAKE_REQUIRED_LIBRARIES ${BOOST_LIBRARIES})
+      list(APPEND CMAKE_REQUIRED_LIBRARIES ${BOOST_TARGETS})
       list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS})
 
       CHECK_CXX_SOURCE_COMPILES(
index 9b75230d709abf8d9a2d8ab02a21d885b872a942..e2c2cfa087fef1d73f5cc63604f008955d880dee 100644 (file)
@@ -47,11 +47,6 @@ if(NOT BUILD_SHARED_LIBS)
   set(Boost_USE_STATIC_LIBS TRUE)
 endif()
 
-# Work around a CMake compatibility issue with boost-1.70.0
-# compare https://gitlab.kitware.com/cmake/cmake/issues/18865
-# and https://lists.boost.org/Archives/boost/2019/02/245016.php
-set(Boost_NO_BOOST_CMAKE ON)
-
 set(Boost_NO_WARN_NEW_VERSIONS TRUE)
 if(DEAL_II_WITH_ZLIB)
   find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS
@@ -63,24 +58,6 @@ else()
     )
 endif()
 
-#
-# Fall back to dynamic libraries if no static libraries could be found:
-#
-if(NOT Boost_FOUND AND Boost_USE_STATIC_LIBS)
-  set(Boost_USE_STATIC_LIBS FALSE)
-
-  # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
-  list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-  if(DEAL_II_WITH_ZLIB)
-    find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS iostreams serialization system thread)
-  else()
-    find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS serialization system thread)
-  endif()
-  list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-endif()
-
-unset(Boost_NO_BOOST_CMAKE)
-
 if(Boost_FOUND)
   set(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}")
   set(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}")
@@ -91,8 +68,7 @@ if(Boost_FOUND)
 endif()
 
 process_feature(BOOST
-  LIBRARIES REQUIRED Boost_LIBRARIES
-  INCLUDE_DIRS REQUIRED Boost_INCLUDE_DIRS
+  TARGETS REQUIRED Boost_LIBRARIES
   CLEAR
     Boost_DIR Boost_INCLUDE_DIRS Boost_IOSTREAMS_LIBRARY_DEBUG
     Boost_IOSTREAMS_LIBRARY_RELEASE Boost_LIBRARY_DIR

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.