SET(${_flag} "" CACHE INTERNAL "" FORCE)
ENDFOREACH()
-#
-# Read in CFLAGS, CXXFLAGS and LDFLAGS from environment
-#
-SET_IF_EMPTY(CMAKE_C_FLAGS "$ENV{CFLAGS}")
-SET_IF_EMPTY(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS}")
-SET_IF_EMPTY(CMAKE_SHARED_LINKER_FLAGS "$ENV{LDFLAGS}")
-UNSET(ENV{CFLAGS})
-UNSET(ENV{CXXFLAGS})
-UNSET(ENV{LDFLAGS})
-
#
# Set cached compiler flags to an empty string:
#
ENDFOREACH()
+#
+# Finally, read in CFLAGS, CXXFLAGS and LDFLAGS from environment and
+# prepend them to the saved variables:
+#
+SET(CMAKE_C_FLAGS_SAVED "$ENV{CFLAGS} ${CMAKE_C_FLAGS_SAVED}")
+SET(CMAKE_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_SAVED}")
+SET(CMAKE_SHARED_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
+UNSET(ENV{CFLAGS})
+UNSET(ENV{CXXFLAGS})
+UNSET(ENV{LDFLAGS})
+
+
###########################################################################
# #
# Miscellanious setup: #
target. There are two options to override this behaviour:
<ol>
- <li>
- Disable the configuration completely by setting
- <code>DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS</code> to
- <code>OFF</code>. Beware of the fact that certain features
- may still pull in necessary compiler flags.
-
<li>
Override the default configuration by setting the following
cached variables:
cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...>
</pre>
+
+ <li>
+ Set the corresponding environment variables: <code>CFLAGS</code>,
+ <code>CXXFLAGS</code>, or <code>LDFLAGS</code> environment. These
+ variables will also be appended after the default compiler flags
+ (but before the corresponding cached variables).
+
+ <li>
+ Disable the configuration completely by setting
+ <code>DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS</code> to
+ <code>OFF</code>. Beware of the fact that certain features
+ may still pull in necessary compiler flags.
</ol>
</p>