From: Matthias Maier Date: Mon, 11 Jul 2016 14:14:24 +0000 (-0500) Subject: CMake: Support fine grained feature configuration constraints in tests X-Git-Tag: v8.5.0-rc1~883^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7900dd36c22cea50256134befffdad2716874135;p=dealii.git CMake: Support fine grained feature configuration constraints in tests With this change it is now possible to restrict tests to fine grained feature configurations (if we happen to export them to deal.IIConfig.cmake). Example: test.with_arpack=true.with_arpack_with_parpack=true.output Will only be configured if arpack is detected with (working) parpack support. --- diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index 6b762860a1..6dab7db605 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2013 - 2015 by the deal.II authors +## Copyright (C) 2013 - 2016 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -180,12 +180,18 @@ MACRO(DEAL_II_PICKUP_TESTS) # # Valid feature? # - IF(NOT DEFINED DEAL_II_WITH_${_feature}) - MESSAGE(FATAL_ERROR " + # We support two variables: DEAL_II_WITH_ and DEAL_II_ + # + SET(_variable "DEAL_II_WITH_${_feature}") + IF(NOT DEFINED ${_variable}) + SET(_variable "DEAL_II_${_feature}") + IF(NOT DEFINED ${_variable}) + MESSAGE(FATAL_ERROR " Invalid feature constraint \"${_match}\" in file \"${_comparison}\": -The feature \"DEAL_II_${_feature}\" does not exist.\n" - ) +The feature \"DEAL_II_WITH_${_feature}\" (or \"DEAL_II_${_feature}\") does not exist.\n" + ) + ENDIF() ENDIF() # @@ -201,8 +207,8 @@ Comparison operator \"=\" expected for boolean match.\n" ENDIF() # This is why I hate CMake :-/ - IF( (DEAL_II_WITH_${_feature} AND NOT ${_boolean}) OR - (NOT DEAL_II_WITH_${_feature} AND ${_boolean}) ) + IF( (${_variable} AND NOT ${_boolean}) OR + (NOT ${_variable} AND ${_boolean}) ) SET(_define_test FALSE) ENDIF() ENDIF()