print " <li> <a href=\"#CommProg\" class=bold>The commented program</a>\n";
-system $^X, "$cmake_source_dir/doc/doxygen/scripts/program2toc", "$cmake_source_dir/examples/$step/$step.cc";
+my $file_extension;
+
+if (-f "$cmake_source_dir/examples/$step/$step.cc")
+{
+ $file_extension = cc;
+}
+
+if (-f "$cmake_source_dir/examples/$step/$step.cu")
+{
+ $file_extension = cu;
+}
+
+system $^X, "$cmake_source_dir/doc/doxygen/scripts/program2toc", "$cmake_source_dir/examples/$step/$step.$file_extension";
print
"</ol></td><td width=\"50%\" valign=\"top\"><ol>
print " * <a name=\"CommProg\"></a>\n";
print " * <h1> The commented program</h1>\n";
-system $^X, "$cmake_source_dir/doc/doxygen/scripts/program2doxygen", "$cmake_source_dir/examples/$step/$step.cc";
+
+system $^X, "$cmake_source_dir/doc/doxygen/scripts/program2doxygen", "$cmake_source_dir/examples/$step/$step.$file_extension";
system $^X, "$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\"
+\@include \"$step.$file_extension\"
*/
";
# skip header lines at the top of the file, such as copyright notices
# and license information, if the file is a step-xx.cc tutorial. don't
# skip for other files such as code-gallery files
-if ($ARGV[0] =~ /step-\d+.cc/)
+if ($ARGV[0] =~ /step-\d+.[cc|cu]/)
{
$_ = <>;
while ( m!^/\*! || m!\s*\*! || m/^$/ ) {
FOREACH(_step ${_deal_ii_steps})
GET_FILENAME_COMPONENT(_step "${_step}" NAME)
+ IF(EXISTS "${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cu")
+ SET(_FILE_EXTENSION "cu")
+ ELSE()
+ SET(_FILE_EXTENSION "cc")
+ ENDIF()
+
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.${_FILE_EXTENSION}
COMMAND ${PERL_EXECUTABLE}
ARGS
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2plain
- < ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
- > ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
+ < ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.${_FILE_EXTENSION}
+ > ${CMAKE_CURRENT_BINARY_DIR}/${_step}.${_FILE_EXTENSION}
DEPENDS
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2plain
- ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
+ ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.${_FILE_EXTENSION}
VERBATIM
)
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/intro2toc
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/create_anchors
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/program2doxygen
- ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.cc
+ ${CMAKE_SOURCE_DIR}/examples/${_step}/${_step}.${_FILE_EXTENSION}
${CMAKE_SOURCE_DIR}/examples/${_step}/doc/intro.dox
${CMAKE_SOURCE_DIR}/examples/${_step}/doc/results.dox
)
ADD_CUSTOM_TARGET(tutorial_${_step}
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${_step}.h
- ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/${_step}.${_FILE_EXTENSION}
COMMENT
"Building doxygen input file for tutorial program <${_step}>"
)