]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Support fine grained feature configuration constraints in tests
authorMatthias Maier <tamiko@43-1.org>
Mon, 11 Jul 2016 14:14:24 +0000 (09:14 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 12 Jul 2016 08:36:46 +0000 (03:36 -0500)
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.

cmake/macros/macro_deal_ii_pickup_tests.cmake

index 6b762860a13595fb3127fd5118094f60b922858a..6dab7db60502fe79051d96a7a76028792c24515b 100644 (file)
@@ -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_<FEATURE> and DEAL_II_<FEATURE>
+      #
+      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()

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.