--- /dev/null
+#---------------------------------------------------------------------------
+# $Id$
+# Version: $Name$
+#
+# Copyright (C) 2013 by the deal.II authors
+#
+# This file is subject to QPL and may not be distributed
+# without copyright and license information. Please refer
+# to the file deal.II/doc/license.html for the text and
+# further information on this license.
+#
+#---------------------------------------------------------------------------
+
+if ($#ARGV != 1) {
+ print "\nUsage: make_step.pl step cmake_source_dir\n";
+ exit;
+}
+
+$step=$ARGV[0];
+$step_underscore=$step;
+$step_underscore=~ s/-/_/;
+
+$cmake_source_dir=$ARGV[1];
+
+print
+"/**
+ * \@page $step_underscore The $step tutorial program
+\@htmlonly
+<table class=\"tutorial\" width=\"50%\">
+<tr><th colspan=\"2\"><b><small>Table of contents</small></b></th></tr>
+<tr><td width=\"50%\" valign=\"top\">
+<ol>
+ <li> <a href=\"#Intro\" class=bold>Introduction</a>
+";
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/intro2toc < $cmake_source_dir/examples/$step/doc/intro.dox");
+
+print " <li> <a href=\"#CommProg\" class=bold>The commented program</a>\n";
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/program2toc < $cmake_source_dir/examples/$step/$step.cc");
+
+print
+"</ol></td><td width=\"50%\" valign=\"top\"><ol>
+ <li value=\"3\"> <a href=\"#Results\" class=bold>Results</a>
+";
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/intro2toc < $cmake_source_dir/examples/$step/doc/results.dox");
+
+print
+" <li> <a href=\"#PlainProg\" class=bold>The plain program</a>
+</ol> </td> </tr> </table>
+\@endhtmlonly
+";
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/create_anchors < $cmake_source_dir/examples/$step/doc/intro.dox");
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/program2doxygen < $cmake_source_dir/examples/$step/$step.cc");
+
+system("perl $cmake_source_dir/doc/doxygen/scripts/create_anchors < $cmake_source_dir/examples/$step/doc/results.dox");
+
+print
+"<a name=\"PlainProg\"></a>
+<h1> The plain program</h1>
+\@include \"$step.cc\"
+ */
+";
FOREACH(_step ${_steps})
GET_FILENAME_COMPONENT(_step "${_step}" NAME)
- STRING(REGEX REPLACE "-" "_" _step_underscore "${_step}")
-
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/_toc.intro.snippet.in
- ${CMAKE_CURRENT_BINARY_DIR}/${_step}_toc.intro.snippet
- )
-
- CONFIGURE_FILE(
- ${CMAKE_CURRENT_SOURCE_DIR}/_plain.snippet.in
- ${CMAKE_CURRENT_BINARY_DIR}/${_step}_plain.snippet
- )
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
ARGS
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2plain
< ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
+ > ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2plain
${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
VERBATIM
)
ADD_CUSTOM_COMMAND(
- #
- # This has to be refactored really, really badly...
- #
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND cat
- ARGS
- ${CMAKE_CURRENT_BINARY_DIR}/${_step}_toc.intro.snippet
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND ${PERL_EXECUTABLE}
- ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/intro2toc
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/doc/intro.dox
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND cat
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/_toc.prog.snippet
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND ${PERL_EXECUTABLE}
- ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2toc
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND cat
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/_toc.results.snippet
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
COMMAND ${PERL_EXECUTABLE}
ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/intro2toc
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/doc/results.dox
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND cat
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/_toc.final.snippet
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND ${PERL_EXECUTABLE}
- ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/create_anchors
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/doc/intro.dox
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND ${PERL_EXECUTABLE}
- ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2doxygen
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND ${PERL_EXECUTABLE}
- ARGS
- ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/create_anchors
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/doc/results.dox
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- COMMAND cat
- ARGS
- ${CMAKE_CURRENT_BINARY_DIR}/${_step}_plain.snippet
- >> ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
+ ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/make_step.pl
+ ${_step} ${CMAKE_SOURCE_DIR}
+ > ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/make_step.pl
${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
${CMAKE_SOURCE_DIR}/examples/${_step}/doc/intro.dox
${CMAKE_SOURCE_DIR}/examples/${_step}/doc/results.dox
- VERBATIM
)
+
ADD_CUSTOM_TARGET(tutorial_${_step}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
ADD_DEPENDENCIES(tutorial tutorial_${_step})
ENDFOREACH()
-
#
# Install all bits:
#