]> https://gitweb.dealii.org/ - dealii.git/commit
CMake: Bugfix: Force cache update for DEAL_II_(C|CXX)_FLAGS 2793/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 9 Jul 2016 09:26:25 +0000 (04:26 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 9 Jul 2016 09:45:33 +0000 (04:45 -0500)
commit1430f498f91fd5f6b5f6aaf8774e79e6d8d82d89
treea6903031e50c7715bae99958a0564cd9264c7ae9
parent19a0eb4bc7d6c51361c82461710e8d6745b08879
CMake: Bugfix: Force cache update for DEAL_II_(C|CXX)_FLAGS

This fixes a subtle bug:

 - We use DEAL_II_(C|CXX)_FLAGS, DEAL_II_LINKER_FLAGS internally and we
   allow users to set additional compiler/linker flags via cached variants
   of these variables (because users tend to assume every variable starts
   with DEAL_II_*).

 - But, we also allow to set CMAKE_(C|CXX)_FLAGS, etc. (not supporting this
   would be crazy).

 - Last, but not least, the environment variables CFLAGS, CXXFLAGS, LDFLAGS
   are also supported.

We support this by prepending all DEAL_II_* variables with their CMAKE_*
and environment counterparts. But for this to work we also have to force
update the cache. With this change

  CXXFLAGS="-foo" cmake -DCMAKE_CXX_FLAGS="-bar" -DDEAL_II_CXX_FLAGS="-baz" .

results in

  DEAL_II_FLAGS="[.. internal flag setup ..] -foo -bar -baz"

as intended. Reconfiguring with

  CXXFLAGS="-foo" cmake .

retains DEAL_II_FLAGS.
cmake/setup_cached_variables.cmake

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.