From ccbebc3ef175396984ad7fc01a94307de04a48a9 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 19 Jun 2015 15:12:34 +0200
Subject: [PATCH] CMake support for the unit tests

---
 CMakeLists.txt      |  1 +
 test/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 test/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index edb3f142..f1052e51 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,7 @@ add_subdirectory("m4")
 add_subdirectory("dune")
 add_subdirectory("doc")
 add_subdirectory("cmake/modules")
+add_subdirectory("test")
 
 # finalize the dune project, e.g. generating config.h etc.
 finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 00000000..4b0d35ff
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,32 @@
+set(TESTS
+  adolctest
+  averagedistanceassemblertest
+  cosseratenergytest
+  frameinvariancetest
+  globalgfetestfunctionbasistest
+  harmonicenergytest
+  interillustration
+  localgeodesicfefunctiontest
+  localgeodesicfestiffnesstest
+  localgfetestfunctiontest
+  nestednesstest
+  nonconvexitytest
+  nonconvexitytest_simple
+  orthogonalmatrixtest
+  rodassemblertest
+  rotationtest
+  svdtest
+  targetspacetest
+  true-adolctest
+  vtkreadertest
+)
+
+add_directory_test_target(_test_target)
+add_dependencies(${_test_target} ${TESTS})
+
+foreach(_test ${TESTS})
+  add_executable(${_test} ${_test}.cc)
+  target_link_libraries(${_test} ${DUNE_LIBS})
+  add_dune_ug_flags(${_test})
+  add_test(${_test} ${_test})
+endforeach()
-- 
GitLab