]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: bugfix: make sure that cached feature variables do not interfere 14482/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 26 Nov 2022 23:23:56 +0000 (17:23 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 26 Nov 2022 23:48:07 +0000 (17:48 -0600)
cmake/macros/macro_clear_feature.cmake

index 7e8b4b3757df880ae9d1ae52b85e615d5c18faba..898a1d1a73a9207861618d5b494dd38ed9e53458 100644 (file)
 macro(clear_feature _feature)
   foreach(_var ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES})
     unset(${_feature}_${_var})
+    #
+    # If an unset variable is still defined then it is a cached variable.
+    # We want to retain this cached variable because it has been set by the
+    # user (and might have been used for the feature configuration). But it
+    # is important that we clear the variable so that the process_feature()
+    # macro can function as intended. As a workaround let's simply set it
+    # to the empty string.
+    #
+    if(DEFINED ${_feature}_${_var})
+      set(${_feature}_${_var} "")
+    endif()
   endforeach()
   unset(${_FEATURE}_FOUND)
   unset(${_FEATURE}_SPLIT_CONFIGURATION)

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.