From: Matthias Maier Date: Mon, 28 Sep 2015 04:47:13 +0000 (-0500) Subject: CMake: Query whether trilinos requires CXX11 support X-Git-Tag: v8.4.0-rc2~364^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3950a6ed1f6ec1a980a34552d5ebe05c03d0a108;p=dealii.git CMake: Query whether trilinos requires CXX11 support --- diff --git a/cmake/modules/FindTRILINOS.cmake b/cmake/modules/FindTRILINOS.cmake index a9a5918d18..0e101120ce 100644 --- a/cmake/modules/FindTRILINOS.cmake +++ b/cmake/modules/FindTRILINOS.cmake @@ -25,6 +25,7 @@ # TRILINOS_VERSION_MAJOR # TRILINOS_VERSION_MINOR # TRILINOS_VERSION_SUBMINOR +# TRILINOS_WITH_MANDATORY_CXX11 # TRILINOS_WITH_MPI # TRILINOS_SUPPORTS_CPP11 # TRILINOS_HAS_C99_TR1_WORKAROUND @@ -76,7 +77,8 @@ IF(DEFINED Trilinos_VERSION) ENDIF() # -# Look for the one include file that we'll query for further information: +# Look for Epetra_config.h - we'll query it to determine MPI and 64bit +# indices support: # DEAL_II_FIND_FILE(EPETRA_CONFIG_H Epetra_config.h HINTS ${Trilinos_INCLUDE_DIRS} @@ -111,6 +113,28 @@ IF(EXISTS ${EPETRA_CONFIG_H}) ENDIF() ENDIF() +# +# Look for Sacado_config.h - we'll query it to determine C++11 support: +# +DEAL_II_FIND_FILE(SACADO_CONFIG_H Sacado_config.h + HINTS ${Trilinos_INCLUDE_DIRS} + NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH + NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH + ) + +SET(TRILINOS_WITH_MANDATORY_CXX11 FALSE) +IF(EXISTS ${SACADO_CONFIG_H}) + # + # Determine whether Trilinos was configured with C++11 support and + # enabling C++11 in deal.II is mandatory (Trilinos 12.0.1 and later). + # + FILE(STRINGS "${SACADO_CONFIG_H}" SACADO_CXX11_STRING + REGEX "#define HAVE_SACADO_CXX11") + IF(NOT "${SACADO_CXX11_STRING}" STREQUAL "") + SET(TRILINOS_WITH_MANDATORY_CXX11 TRUE) + ENDIF() +ENDIF() + # # Some versions of Sacado_cmath.hpp do things that aren't compatible # with the -std=c++0x flag of GCC, see deal.II FAQ.