]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Also respect DEAL_II_CXX_FLAGS
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 3 Dec 2013 13:24:34 +0000 (13:24 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 3 Dec 2013 13:24:34 +0000 (13:24 +0000)
Although this is an invalid naming (it just read CMAKE_CXX_FLAGS) it is
just way too easy to accidentally use it...

git-svn-id: https://svn.dealii.org/trunk@31850 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/setup_cached_variables.cmake
deal.II/cmake/setup_compiler_flags.cmake

index d69d0df166fb4fe7ce9b1cf6ba3434de4876107a..6302955d101a9fec4eb9ae939b56564dcb7ea537 100644 (file)
@@ -291,6 +291,19 @@ SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}")
 UNSET(ENV{CXXFLAGS})
 UNSET(ENV{LDFLAGS})
 
+#
+# Also respect DEAL_II_CXX_FLAGS - it just too easy to accientally write
+# DEAL_II_CXX_FLAGS instead of CMAKE_CXX_FLAGS... (this was a poor design
+# choice, I know...)
+#
+IF(NOT "${DEAL_II_CXX_FLAGS}" STREQUAL "")
+  MESSAGE(STATUS
+    "Appending \${DEAL_II_CXX_FLAGS} to saved \${CMAKE_CXX_FLAGS}"
+    )
+  SET(CMAKE_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS_SAVED} ${DEAL_II_CXX_FLAGS}")
+ENDIF()
+
+
 
 ########################################################################
 #                                                                      #
index f82147f9e816f215f3a142bb4d2d2531bb573606..879926d1b212288543e2a82866759a0b2eb36407 100644 (file)
 #
 
 MESSAGE(STATUS "")
-IF(NOT "${CMAKE_CXX_FLAGS_SAVED}" STREQUAL "${DEAL_II_CXX_FLAGS_SAVED}")
+IF(NOT "${CMAKE_CXX_FLAGS_SAVED}" STREQUAL "${CACHED_CMAKE_CXX_FLAGS_SAVED}")
   # Rerun this test if cxx flags changed:
   UNSET(DEAL_II_HAVE_USABLE_CXX_FLAGS CACHE)
 ENDIF()
-SET(DEAL_II_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
+SET(CACHED_CMAKE_CXX_FLAGS_SAVED "${CMAKE_CXX_FLAGS_SAVED}" CACHE INTERNAL "" FORCE)
 
 # Initialize all CMAKE_REQUIRED_* variables a this point:
 RESET_CMAKE_REQUIRED()
@@ -85,6 +85,8 @@ IF(NOT DEAL_II_HAVE_USABLE_CXX_FLAGS)
   MESSAGE(FATAL_ERROR "\n"
     "Configuration error: Cannot compile with the user supplied CXX flags:\n"
     "${CMAKE_CXX_FLAGS_SAVED}\n"
+    "Please check the CMake variable CMAKE_CXX_FLAGS and the\n"
+    "environment variable CXXFLAGS\n\n"
     )
 ENDIF()
 

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.