]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfix: Do not silently ignore invalid feature constraints, but drop the test and...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Nov 2013 21:46:03 +0000 (21:46 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Nov 2013 21:46:03 +0000 (21:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@31554 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_pickup_tests.cmake

index 954c615d17689afe5793e6ada330cd86f7c4dfbb..e4519c1242ec0d013077a07e0dd231cb590d4ffa 100644 (file)
@@ -65,10 +65,20 @@ MACRO(DEAL_II_PICKUP_TESTS)
         _feature ${_match}
         )
       STRING(TOUPPER ${_feature} _feature)
-      STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
 
-      IF( (DEAL_II_${_feature} AND NOT ${_boolean}) OR
-          (NOT DEAL_II_${_feature} AND ${_boolean}) )
+      # Make sure that _match is a valid feature constraint:
+      IF(DEFINED DEAL_II_${_feature})
+        STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
+        IF( (DEAL_II_${_feature} AND NOT ${_boolean}) OR
+            (NOT DEAL_II_${_feature} AND ${_boolean}) )
+          SET(_define_test FALSE)
+        ENDIF()
+      ELSE()
+        MESSAGE(WARNING "
+Invalid feature constraint \"${_match}\" in file
+\"${_comparison}\":
+The feature \"DEAL_II_${_feature}\" does not exist.\n"
+          )
         SET(_define_test FALSE)
       ENDIF()
     ENDFOREACH()

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.