From: Matthias Maier Date: Wed, 8 Jun 2022 03:14:51 +0000 (-0500) Subject: CMake: add DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES check X-Git-Tag: v9.4.0-rc1~53^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13927%2Fhead;p=dealii.git CMake: add DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES check --- diff --git a/cmake/configure/configure_50_cgal.cmake b/cmake/configure/configure_50_cgal.cmake index 882170ed04..0b2331d7de 100644 --- a/cmake/configure/configure_50_cgal.cmake +++ b/cmake/configure/configure_50_cgal.cmake @@ -54,4 +54,27 @@ MACRO(FEATURE_CGAL_FIND_EXTERNAL var) ENDIF() ENDMACRO() + +MACRO(FEATURE_CGAL_CONFIGURE_EXTERNAL) + # Similarly to the DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS check run + # in configure_20_boost.cmake we have to check whether cgal includes + # a deprecated boost header. If yes, disable the boost deprecated header + # warning as well. + + LIST(APPEND CMAKE_REQUIRED_INCLUDES + ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS} + ) + + CHECK_CXX_COMPILER_BUG( + " + #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED + #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\"); + #include + int main() { return 0; } + " + DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES) + + RESET_CMAKE_REQUIRED() +ENDMACRO() + CONFIGURE_FEATURE(CGAL) diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 07b3da84af..30d2e672ff 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -231,12 +231,11 @@ /* cmake/modules/FindSYMENGINE.cmake */ #cmakedefine DEAL_II_SYMENGINE_WITH_LLVM -/* cmake/configure/configure_2_boost.cmake */ +/* cmake/configure/configure_20_boost.cmake */ #cmakedefine DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS -#ifdef defined(DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS) && \ - !defined(BOOST_ALLOW_DEPRECATED_HEADERS) -# define BOOST_ALLOW_DEPRECATED_HEADERS -#endif + +/* cmake/configure/configure_50_cgal.cmake */ +#cmakedefine DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES /* cmake/configure/configure_2_trilinos.cmake */ #cmakedefine DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD @@ -248,6 +247,12 @@ #cmakedefine DEAL_II_TRILINOS_WITH_TPETRA #cmakedefine DEAL_II_TRILINOS_WITH_ZOLTAN +#if defined(DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS) || \ + defined(DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES) +# ifndef BOOST_ALLOW_DEPRECATED_HEADERS +# define BOOST_ALLOW_DEPRECATED_HEADERS +# endif +#endif /*********************************************************************** * Various macros for version number query and comparison: