From 7c0f6b71d608ddde558856167f15f35d06f2fa85 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 5 Nov 2013 21:46:03 +0000 Subject: [PATCH] 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 --- deal.II/cmake/macros/macro_pickup_tests.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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() -- 2.39.5