"fluids" => ',height=.25,width=.25,fillcolor="yellow"',
"solids" => ',height=.25,width=.25,fillcolor="lightblue"',
"time dependent" => ',height=.25,width=.25,fillcolor="blue"',
- "unfinished" => ',height=.25,width=.25,style="dashed"'
+ "unfinished" => ',height=.25,width=.25,style="dashed"',
+ "code-gallery" => ',height=.08,width=.125,shape="circle"',
);
# Print a preamble setting common attributes
my $step;
foreach $step (@ARGV)
{
- my $number = $step;
- $number =~ s/^.*-//;
-
# read first line of tooltip file
open TF, "$step/doc/tooltip"
or die "Can't open tooltip file $step/doc/tooltip";
close TF;
chop $tooltip;
- printf "Step$number [label=\"$number\", URL=\"\\ref step_$number\", tooltip=\"$tooltip\"";
-
-
- # read first line of 'kind' file
- open KF, "$step/doc/kind"
- or die "Can't open kind file $step/doc/kind";
- my $kind = <KF>;
- close KF;
- chop $kind;
-
- die "Unknown kind '$kind' in file $step/doc/kind" if (! defined $style{$kind});
- print "$style{$kind}";
+ # read first line of 'kind' file if it is a step;
+ # otherwise assume it is a code gallery program. for
+ # each of them, output something for 'dot' to generate
+ # the dependencies graph from
+ if ($step =~ /step-/
+ &&
+ !($step =~ /code-gallery/))
+ {
+ open KF, "$step/doc/kind"
+ or die "Can't open kind file $step/doc/kind";
+ my $kind = <KF>;
+ chop $kind;
+ close KF;
+
+ die "Unknown kind '$kind' in file $step/doc/kind" if (! defined $style{$kind});
+
+ my $number = $step;
+ $number =~ s/^.*-//;
+
+ printf "Step$number [label=\"$number\", URL=\"\\ref step_$number\", tooltip=\"$tooltip\"";
+ print "$style{$kind}";
+ }
+ else
+ {
+ # get at the name of the program; also create something
+ # that can serve as a tag without using special characters
+ my $name = $step;
+ $name =~ s/^.*code-gallery\///;
+ my $tag = $name;
+ $tag =~ s/[^a-zA-Z]/_/g;
+
+ printf "code_gallery_$tag [label=\"\", URL=\"\\ref code_gallery_$tag\", tooltip=\"$tooltip\"";
+ my $kind = "code-gallery";
+ print "$style{$kind}";
+ }
print "];\n";
}
my $step;
foreach $step (@ARGV)
{
- my $number = $step;
- $number =~ s/^.*-//;
-
# read first line of dependency file
open BF, "$step/doc/builds-on"
or die "Can't open builds-on file $step/doc/builds-on";
close BF;
chop $buildson;
+ my $destination;
+ if ($step =~ /step-/
+ &&
+ !($step =~ /code-gallery/))
+ {
+ my $number = $step;
+ $number =~ s/^.*-//;
+ $destination = "Step$number";
+ }
+ else
+ {
+ my $name = $step;
+ $name =~ s/^.*code-gallery\///;
+ my $tag = $name;
+ $tag =~ s/[^a-zA-Z]/_/g;
+ $destination = "code_gallery_$tag";
+ }
+
my $source;
foreach $source (split ' ', $buildson) {
$source =~ s/step-/Step/g;
- print "$source -> Step$number\n";
+ print "$source -> $destination\n";
}
}
+# Collect all of the directory names for the tutorial programs
FILE(GLOB _deal_ii_steps
${CMAKE_SOURCE_DIR}/examples/step-*
)
+# Also collect the names of all code gallery projects. To
+# do so, find all 'author' files, then strip the last two
+# levels of these paths.
+#
+# For unclear reasons, the glob returns these files as
+# "/a/b/c/name//doc//author", so make sure we eat the
+# double slashes in the second step
+FILE(GLOB _code_gallery_names
+ "${CMAKE_BINARY_DIR}/doc/doxygen/code-gallery/code-gallery/*/doc/author")
+STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}")
+
#
# Define target for the tutorial. It depends on the
# file tutorial.h built via the next target below, as well
${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/steps.pl
${CMAKE_CURRENT_SOURCE_DIR}/tutorial.h.in
${_deal_ii_steps}
+ ${_code_gallery_names}
> ${CMAKE_CURRENT_BINARY_DIR}/tutorial.h
DEPENDS
+ ${CMAKE_SOURCE_DIR}/doc/doxygen/scripts/steps.pl
+ ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.h.in
${_deal_ii_steps}
${_deal_ii_steps_kind}
${_deal_ii_steps_tooltip}
${_deal_ii_steps_buildson}
- ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.h.in
+ ${_code_gallery_names}
)
ADD_CUSTOM_TARGET(build_tutorial_h
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tutorial.h)