From: maier Date: Tue, 5 Nov 2013 21:46:03 +0000 (+0000) Subject: Bugfix: Do not silently ignore invalid feature constraints, but drop the test and... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c0f6b71d608ddde558856167f15f35d06f2fa85;p=dealii-svn.git Bugfix: Do not silently ignore invalid feature constraints, but drop the test and print a warning git-svn-id: https://svn.dealii.org/trunk@31554 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/macros/macro_pickup_tests.cmake b/deal.II/cmake/macros/macro_pickup_tests.cmake index 954c615d17..e4519c1242 100644 --- a/deal.II/cmake/macros/macro_pickup_tests.cmake +++ b/deal.II/cmake/macros/macro_pickup_tests.cmake @@ -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()