]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: Only set test dependencies if tests are actually defined...
authorMatthias Maier <tamiko@43-1.org>
Fri, 4 May 2018 20:10:32 +0000 (15:10 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 4 May 2018 20:32:52 +0000 (15:32 -0500)
Otherwise "big bada boom".

tests/a-framework/CMakeLists.txt

index daefbd43508bfc53f533736cb3159e28c81da6ac..8579920d4b0ec8ebfa56704261fa9b8643f8e3ac 100644 (file)
@@ -10,14 +10,25 @@ SET(TEST_TARGET_DEBUG dummy.debug)
 DEAL_II_PICKUP_TESTS()
 
 #
-# Limit concurrency between the two parameter file tests:
+# Limit concurrency between the two parameter file tests.
 #
-FOREACH(_build ${DEAL_II_BUILD_TYPES})
-  STRING(TOLOWER ${_build} _build)
-  SET_TESTS_PROPERTIES(a-framework/parameter_file_2.${_build} PROPERTIES
-    DEPENDS a-framework/parameter_file_1.${_build}
-    )
-ENDFOREACH()
+# We only do this for CMake-3.4 or newer that has policy CMP0064 and
+# supports the IF(TEST ...) operator. For older CMake versions that do not
+# support the IF(TEST ...) operator we cannot much do (and people have to
+# live with spurious test failures.)
+#
+IF(POLICY CMP0064)
+  CMAKE_POLICY(SET CMP0064 NEW)
+  FOREACH(_build ${DEAL_II_BUILD_TYPES})
+    STRING(TOLOWER ${_build} _build)
+    IF( TEST a-framework/parameter_file_2.${_build} AND
+        TEST a-framework/parameter_file_1.${_build} )
+      SET_TESTS_PROPERTIES(a-framework/parameter_file_2.${_build} PROPERTIES
+        DEPENDS a-framework/parameter_file_1.${_build}
+        )
+    ENDIF()
+  ENDFOREACH()
+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.