In particular, track dependencies and set up a stub for generating doxygen input.
${CMAKE_CURRENT_BINARY_DIR}/tutorial/tutorial.h
)
+# find all tutorial programs so we can add dependencies as appropriate
FILE(GLOB _deal_ii_steps
${CMAKE_SOURCE_DIR}/examples/step-*
)
)
ENDFOREACH()
+# Also find all code gallery programs (if available) for the same reason.
+# The logic here follows the same as in code-gallery/CMakeLists.txt
+SET_IF_EMPTY(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery)
+IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md)
+ FILE(GLOB _code_gallery_names
+ "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/author")
+ STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}")
+
+ FOREACH(_step ${_code_gallery_names})
+ GET_FILENAME_COMPONENT(_step "${_step}" NAME)
+
+ LIST(APPEND _doxygen_depend
+ ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/${_step}.h
+ )
+ LIST(APPEND _doxygen_input
+ ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/${_step}.h
+ )
+ ENDFOREACH()
+ENDIF()
+
TO_STRING(_doxygen_image_path_string ${_doxygen_image_path})
TO_STRING(_doxygen_input_string ${_doxygen_input})
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
tutorial
+ code-gallery
${CMAKE_CURRENT_BINARY_DIR}/options.dox
${CMAKE_CURRENT_BINARY_DIR}/header.html
${CMAKE_CURRENT_BINARY_DIR}/footer.html
# Now set up targets for each of the code gallery programs
- # ...TODO...
+ FOREACH(_step ${_code_gallery_names})
+ GET_FILENAME_COMPONENT(_step "${_step}" NAME)
+ MESSAGE(STATUS " Setting up ${_step}")
+
+ # get all source files so we can properly describe the dependencies
+ FILE(GLOB_RECURSE _src_files *)
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
+ COMMAND ${PERL_EXECUTABLE}
+ ARGS
+ ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/make_gallery.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_gallery.pl
+ ${_src_files}
+ )
+
+ ADD_CUSTOM_TARGET(code-gallery_${_step}
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
+ )
+ ADD_DEPENDENCIES(code-gallery code-gallery_${_step})
+
+
+ ENDFOREACH()
ELSE()
MESSAGE(STATUS "Generating the code-gallery documentation is only possible if the code gallery exists in ${DEAL_II_CODE_GALLERY_DIRECTORY}.")
--- /dev/null
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2013, 2015 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+if ($#ARGV != 1) {
+ print "\nUsage: make_gallery.pl gallery cmake_source_dir\n";
+ exit;
+}
+
+$gallery=$ARGV[0];
+$gallery_underscore=$gallery;
+$gallery_underscore=~ s/-/_/;
+
+$cmake_source_dir=$ARGV[1];
+
+print
+"/**
+ * \@page code_gallery_$gallery_underscore The $gallery code gallery 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\">
+\@endhtmlonly
+";
+
+print
+"*/
+";