]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also treat CUDA tutorial steps correctly
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 10 May 2019 21:11:31 +0000 (17:11 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 10 May 2019 21:11:31 +0000 (17:11 -0400)
doc/doxygen/scripts/make_step.pl
doc/doxygen/scripts/program2doxygen
doc/doxygen/tutorial/CMakeLists.txt

index d00ca715c817f227dcb7c67aa3950976ce48f30e..fcad14aeb05205c39db6d99718c922eac2257681 100644 (file)
@@ -58,7 +58,19 @@ system $^X, "$cmake_source_dir/doc/doxygen/scripts/intro2toc", "$cmake_source_di
 
 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>
@@ -77,13 +89,14 @@ system $^X, "$cmake_source_dir/doc/doxygen/scripts/create_anchors", "$cmake_sour
 
 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\"
  */
 ";
index ffb36df9b8b5fd59695c90cd4314d29df9adac79..97deaaa04f62e52e59d35e1c508614becbdc2ee3 100644 (file)
@@ -17,7 +17,7 @@
 # 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/^$/ ) {
index 5ac000e9f34c53bbc282be7bd0b68842cbe56095..af7d0409012d53b6d1869dd37f867b0c62e807a5 100644 (file)
@@ -113,16 +113,22 @@ ADD_DEPENDENCIES(tutorial build_tutorial_h)
 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
     )
 
@@ -140,7 +146,7 @@ FOREACH(_step ${_deal_ii_steps})
       ${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
     )
@@ -148,7 +154,7 @@ FOREACH(_step ${_deal_ii_steps})
   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}>"
     )

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.