]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Cleanup and bugfixes: Uniformly append CMAKE_REQUIRED* and properly clear after use
authorMatthias Maier <tamiko@43-1.org>
Thu, 4 Oct 2018 16:01:58 +0000 (11:01 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 4 Oct 2018 16:11:23 +0000 (11:11 -0500)
cmake/configure/configure_2_boost.cmake
cmake/configure/configure_2_trilinos.cmake
cmake/configure/configure_adolc.cmake

index 799a8287bd8cb13e0bb95a40dbf63faed5f689a8..5c6f9c35a8065c7945cdff6d745aa1236e5e3f3e 100644 (file)
@@ -57,8 +57,8 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON)
   # (anymore) which was deprecated for C++11 and removed in the C++17 standard.
   # Older boost versions can't know about this but provide a possibility to
   # circumvent the issue. Hence, we just check ourselves.
-  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-  PUSH_CMAKE_REQUIRED("-Werror")
+  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
+  ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror")
 
   CHECK_CXX_SOURCE_COMPILES(
     "
@@ -122,8 +122,8 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
       # Test that Boost.Iostreams is usable.
       #
       RESET_CMAKE_REQUIRED()
-      PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-      SET(CMAKE_REQUIRED_LIBRARIES "${BOOST_LIBRARIES}")
+      ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
+      LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${BOOST_LIBRARIES})
       LIST(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS})
 
       CHECK_CXX_SOURCE_COMPILES(
index 062c421ef4472f480de7d703e9591b37a309bcb4..c53f105c0995ba699b105cc9b56bee39fa71d037 100644 (file)
@@ -176,12 +176,12 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
         FILE(STRINGS "${SACADO_CONFIG_H}" SACADO_CXX11_STRING
           REGEX "#define HAVE_SACADO_CXX11")
       ENDIF()
-      
+
       #
       # GCC 6.3.0 has a bug that prevents the creation of complex
       # numbers templated on Sacado::Rad::ADvar types:
       #
-      # include/c++/6.3.0/complex: In instantiation of 
+      # include/c++/6.3.0/complex: In instantiation of
       # ‘struct std::complex<Sacado::Rad::ADvar<double> >’:
       # include/c++/6.3.0/complex:206:16: error: ‘std::complex<_Tp>& std::complex<_Tp>::operator=(const std::complex<_Tp>&) [with _Tp = Sacado::Rad::ADvar<double>]’ declared to take const reference, but implicit declaration would take non-const
       #
@@ -192,11 +192,11 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
         NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH
         NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
         )
-      
+
       IF(EXISTS ${SACADO_TRAD_HPP})
         LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS})
-        PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
-      
+        ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_VERSION_FLAG}")
+
         CHECK_CXX_SOURCE_COMPILES(
           "
           #include <Sacado_trad.hpp>
index 6c2671e1be4c43c14e3442a101f7ea2336c31978..a78ed447a61039eb131e1185f57753397d925330 100644 (file)
@@ -52,9 +52,9 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
     # values from constant objects.
     #
 
-    SET(CMAKE_REQUIRED_LIBRARIES ${ADOLC_LIBRARIES})
-    SET(CMAKE_REQUIRED_INCLUDES ${ADOLC_INCLUDE_DIRS})
-    SET(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS}")
+    LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${ADOLC_LIBRARIES})
+    LIST(APPEND CMAKE_REQUIRED_INCLUDES ${ADOLC_INCLUDE_DIRS})
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS}")
     CHECK_CXX_SOURCE_COMPILES("
       #include <adolc/adouble.h>
       #include <iostream>
@@ -84,6 +84,8 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
       }"
       ADOLC_ADOUBLE_OSTREAM_CHECK)
 
+    RESET_CMAKE_REQUIRED()
+
     IF(NOT ADOLC_DOUBLE_CAST_CHECK)
       MESSAGE(STATUS
         "Could not find a sufficient ADOL-C installation: "

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.