From: Matthias Maier Date: Thu, 4 Oct 2018 16:01:58 +0000 (-0500) Subject: Cleanup and bugfixes: Uniformly append CMAKE_REQUIRED* and properly clear after use X-Git-Tag: v9.1.0-rc1~663^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c31ac5c08cda89df81cb84cce2a631ec393e359d;p=dealii.git Cleanup and bugfixes: Uniformly append CMAKE_REQUIRED* and properly clear after use --- diff --git a/cmake/configure/configure_2_boost.cmake b/cmake/configure/configure_2_boost.cmake index 799a8287bd..5c6f9c35a8 100644 --- a/cmake/configure/configure_2_boost.cmake +++ b/cmake/configure/configure_2_boost.cmake @@ -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( diff --git a/cmake/configure/configure_2_trilinos.cmake b/cmake/configure/configure_2_trilinos.cmake index 062c421ef4..c53f105c09 100644 --- a/cmake/configure/configure_2_trilinos.cmake +++ b/cmake/configure/configure_2_trilinos.cmake @@ -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 >’: # 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]’ 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 diff --git a/cmake/configure/configure_adolc.cmake b/cmake/configure/configure_adolc.cmake index 6c2671e1be..a78ed447a6 100644 --- a/cmake/configure/configure_adolc.cmake +++ b/cmake/configure/configure_adolc.cmake @@ -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 #include @@ -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: "