From 20654aad4f99a1e9fb6acbb47352275e3b130c62 Mon Sep 17 00:00:00 2001
From: Rene Milk <rene.milk@uni-muenster.de>
Date: Fri, 17 Aug 2012 14:38:33 +0200
Subject: [PATCH] [tests] build tex output automatically

---
 dune/stuff/test/CMakeLists.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/dune/stuff/test/CMakeLists.txt b/dune/stuff/test/CMakeLists.txt
index a5c52c354..8a5b58863 100644
--- a/dune/stuff/test/CMakeLists.txt
+++ b/dune/stuff/test/CMakeLists.txt
@@ -5,9 +5,28 @@ add_subdirectory(gtest)
 include_sys_dir(${CMAKE_CURRENT_SOURCE_DIR}/gtest/include )
 
 file( GLOB test_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.cc" )
+
 foreach( source ${test_sources} )
 	get_filename_component(testname ${source} NAME_WE)
 	add_executable( ${testname} ${source} ${DUNE_HEADERS} )
 	add_test( ${testname} ${CMAKE_CURRENT_BINARY_DIR}/${testname} )
 	target_link_libraries( ${testname} boost_filesystem boost_system boost_timer boost_thread ${DUNE_LIBS} gtest )
+	LIST(APPEND testnames ${testname} )
 endforeach( source )
+
+#grid pgf output
+include(UseLATEX)
+set(texfiles pgfoutput_stacked.tex pgfoutput_leaf.tex pgfoutput_refineseries.tex )
+SET_SOURCE_FILES_PROPERTIES(${texfiles} GENERATED)
+add_custom_command(OUTPUT ${texfiles} COMMAND "./grid_output_pgf" DEPENDS grid_output_pgf)
+add_custom_target(tex_compile)
+foreach( tex ${texfiles} )
+    ADD_LATEX_DOCUMENT( ${tex} DEPENDS ${tex} DEFAULT_PDF MANGLE_TARGET_NAMES )
+    string(REPLACE ".tex" "_pdf" pdf ${tex})
+    add_dependencies(tex_compile ${pdf} )
+endforeach( tex )
+add_test(NAME test_tex_compile COMMAND ${CMAKE_MAKE_PROGRAM} tex_compile)
+LIST(APPEND testnames test_tex_compile )
+
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}
+                  DEPENDS ${testnames} ${texfiles})
-- 
GitLab