]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Query whether trilinos requires CXX11 support
authorMatthias Maier <tamiko@43-1.org>
Mon, 28 Sep 2015 04:47:13 +0000 (23:47 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 28 Sep 2015 05:00:27 +0000 (00:00 -0500)
cmake/modules/FindTRILINOS.cmake

index a9a5918d183e01be3e01fd4c4d496369564ab83a..0e101120ce342981afcf59872e07bb9cd2ea0444 100644 (file)
@@ -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.

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.