From a7d1701b533c7b5847411758a63e15c53b6e249f Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 2 Apr 2013 22:41:47 +0000 Subject: [PATCH] CMake: Remove this embarrassment in the document generation git-svn-id: https://svn.dealii.org/trunk@29155 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/doxygen/scripts/make_step | 0 deal.II/doc/doxygen/scripts/make_step.pl | 66 +++++++++++++++++ deal.II/doc/doxygen/tutorial/CMakeLists.txt | 72 ++----------------- .../doc/doxygen/tutorial/_plain.snippet.in | 4 -- .../doc/doxygen/tutorial/_toc.final.snippet | 3 - .../doxygen/tutorial/_toc.intro.snippet.in | 8 --- .../doc/doxygen/tutorial/_toc.prog.snippet | 1 - .../doc/doxygen/tutorial/_toc.results.snippet | 2 - 8 files changed, 73 insertions(+), 83 deletions(-) create mode 100644 deal.II/doc/doxygen/scripts/make_step create mode 100644 deal.II/doc/doxygen/scripts/make_step.pl delete mode 100644 deal.II/doc/doxygen/tutorial/_plain.snippet.in delete mode 100644 deal.II/doc/doxygen/tutorial/_toc.final.snippet delete mode 100644 deal.II/doc/doxygen/tutorial/_toc.intro.snippet.in delete mode 100644 deal.II/doc/doxygen/tutorial/_toc.prog.snippet delete mode 100644 deal.II/doc/doxygen/tutorial/_toc.results.snippet diff --git a/deal.II/doc/doxygen/scripts/make_step b/deal.II/doc/doxygen/scripts/make_step new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deal.II/doc/doxygen/scripts/make_step.pl b/deal.II/doc/doxygen/scripts/make_step.pl new file mode 100644 index 0000000000..f4994e5a5d --- /dev/null +++ b/deal.II/doc/doxygen/scripts/make_step.pl @@ -0,0 +1,66 @@ +#--------------------------------------------------------------------------- +# $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 of contents
+
    +
  1. Introduction +"; + +system("perl $cmake_source_dir/doc/doxygen/scripts/intro2toc < $cmake_source_dir/examples/$step/doc/intro.dox"); + +print "
  2. The commented program\n"; + +system("perl $cmake_source_dir/doc/doxygen/scripts/program2toc < $cmake_source_dir/examples/$step/$step.cc"); + +print +"
    +
  1. Results +"; + +system("perl $cmake_source_dir/doc/doxygen/scripts/intro2toc < $cmake_source_dir/examples/$step/doc/results.dox"); + +print +"
  2. The plain program +
+\@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 +" +

The plain program

+\@include \"$step.cc\" + */ +"; diff --git a/deal.II/doc/doxygen/tutorial/CMakeLists.txt b/deal.II/doc/doxygen/tutorial/CMakeLists.txt index cde334966d..c4905141ca 100644 --- a/deal.II/doc/doxygen/tutorial/CMakeLists.txt +++ b/deal.II/doc/doxygen/tutorial/CMakeLists.txt @@ -89,17 +89,6 @@ ADD_CUSTOM_TARGET(tutorial 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 @@ -107,75 +96,29 @@ FOREACH(_step ${_steps}) 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 @@ -184,7 +127,6 @@ FOREACH(_step ${_steps}) ADD_DEPENDENCIES(tutorial tutorial_${_step}) ENDFOREACH() - # # Install all bits: # diff --git a/deal.II/doc/doxygen/tutorial/_plain.snippet.in b/deal.II/doc/doxygen/tutorial/_plain.snippet.in deleted file mode 100644 index f94ec1b6b5..0000000000 --- a/deal.II/doc/doxygen/tutorial/_plain.snippet.in +++ /dev/null @@ -1,4 +0,0 @@ - -

The plain program

-@include "${_step}.cc" - */ diff --git a/deal.II/doc/doxygen/tutorial/_toc.final.snippet b/deal.II/doc/doxygen/tutorial/_toc.final.snippet deleted file mode 100644 index ccfc93656c..0000000000 --- a/deal.II/doc/doxygen/tutorial/_toc.final.snippet +++ /dev/null @@ -1,3 +0,0 @@ -
  • The plain program - -@endhtmlonly diff --git a/deal.II/doc/doxygen/tutorial/_toc.intro.snippet.in b/deal.II/doc/doxygen/tutorial/_toc.intro.snippet.in deleted file mode 100644 index c476554063..0000000000 --- a/deal.II/doc/doxygen/tutorial/_toc.intro.snippet.in +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @page ${_step_underscore} The ${_step} tutorial program -@htmlonly - - -
    Table of contents
    -
      -
    1. Introduction diff --git a/deal.II/doc/doxygen/tutorial/_toc.prog.snippet b/deal.II/doc/doxygen/tutorial/_toc.prog.snippet deleted file mode 100644 index c582c111d0..0000000000 --- a/deal.II/doc/doxygen/tutorial/_toc.prog.snippet +++ /dev/null @@ -1 +0,0 @@ -
    2. The commented program diff --git a/deal.II/doc/doxygen/tutorial/_toc.results.snippet b/deal.II/doc/doxygen/tutorial/_toc.results.snippet deleted file mode 100644 index 3325e2adac..0000000000 --- a/deal.II/doc/doxygen/tutorial/_toc.results.snippet +++ /dev/null @@ -1,2 +0,0 @@ -
      -
    1. Results -- 2.39.5