From: maier Date: Tue, 3 Dec 2013 13:24:34 +0000 (+0000) Subject: CMake: Also respect DEAL_II_CXX_FLAGS X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=187d3af84bae919c07ca94a30c2531b7fef03f71;p=dealii-svn.git CMake: Also respect DEAL_II_CXX_FLAGS 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 --- diff --git a/deal.II/cmake/setup_cached_variables.cmake b/deal.II/cmake/setup_cached_variables.cmake index d69d0df166..6302955d10 100644 --- a/deal.II/cmake/setup_cached_variables.cmake +++ b/deal.II/cmake/setup_cached_variables.cmake @@ -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() + + ######################################################################## # # diff --git a/deal.II/cmake/setup_compiler_flags.cmake b/deal.II/cmake/setup_compiler_flags.cmake index f82147f9e8..879926d1b2 100644 --- a/deal.II/cmake/setup_compiler_flags.cmake +++ b/deal.II/cmake/setup_compiler_flags.cmake @@ -67,11 +67,11 @@ # 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()