From 3950a6ed1f6ec1a980a34552d5ebe05c03d0a108 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 27 Sep 2015 23:47:13 -0500 Subject: [PATCH] CMake: Query whether trilinos requires CXX11 support --- cmake/modules/FindTRILINOS.cmake | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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. -- 2.39.5