Commit 50f3b519 authored by Sebastien Barre's avatar Sebastien Barre

Update so that scripts can be used more easily for other VTK-like projects

parent f5bdea1b
.git* export-ignore
*.bat -crlf
*.dsp -crlf
*.dsw -crlf
#!/usr/bin/env perl
# Time-stamp: <2001-10-17 10:20:57 barre>
# Time-stamp: <2001-10-17 16:41:20 barre>
#
# Build cross-references between classes and examples
#
# barre : Sebastien Barre <sebastien@barre.nom.fr>
#
# 0.72 (barre) :
# - add --project name : project name, used to uniquify
# - add slightly changed the way --link are created
#
# 0.71 (barre) :
# - add .cpp extension to the C++ parser regexp
# - add .cpp and .cc extension to the C++ parser regexp
#
# 0.7 (barre) :
# - update to match the new VTK 4.0 tree
......@@ -71,7 +75,7 @@ use File::Basename;
use File::Find;
use strict;
my ($VERSION, $PROGNAME, $AUTHOR) = (0.71, $0, "Sebastien Barre");
my ($VERSION, $PROGNAME, $AUTHOR) = (0.72, $0, "Sebastien Barre");
$PROGNAME =~ s/^.*[\\\/]//;
print "$PROGNAME $VERSION, by $AUTHOR\n";
......@@ -84,10 +88,11 @@ my %default =
dirs => ["../.."],
label => "Examples",
limit => 20,
store => "doc_class2examples.dox",
project => "VTK",
store => "doc_VTK_class2examples.dox",
title => "Class To Examples",
unique => "e",
to => "../../../VTK-doxygen",
unique => "e",
weight => 90000
);
......@@ -110,7 +115,7 @@ my $eliminate_matcher = '^vtkCommand$';
my %parsers = (
"Tcl" => ['\.tcl$', \&parse],
"C++" => ['\.c(xx|pp)$', \&parse],
"C++" => ['\.c(xx|pp|c)$', \&parse],
"Java" => ['\.java$', \&parse],
"Python" => ['\.py$', \&parse]
);
......@@ -132,7 +137,7 @@ sub parse {
my %args;
Getopt::Long::Configure("bundling");
GetOptions (\%args, "help", "verbose|v", "dirmatch=s", "label=s", "limit=i", "link=s", "parser=s@", "store=s", "title=s", "to=s", "unique=s", "weight=i");
GetOptions (\%args, "help", "verbose|v", "dirmatch=s", "label=s", "limit=i", "link=s", "parser=s@", "project=s", "store=s", "title=s", "to=s", "unique=s", "weight=i");
my $available_parser = join(", ", keys %parsers);
......@@ -148,9 +153,10 @@ Usage : $PROGNAME [--help] [--verbose|-v] [--dirmatch string] [--label string] [
--link path : link to example files (and prepend path)
--title str : use string as title in "Related Pages" (default: $default{title})
--parser name : use specific parser only (available : $available_parser)
--project name : project name, used to uniquify (default: $default{project})
--store file : use 'file' to store xrefs (default: $default{store})
--to path : use 'path' as destination directory (default : $default{to})
--unique str : use string as a unique page identifier (otherwise MD5) (default : $default{unique})
--unique str : use string as a unique page identifier among "Class To..." pages (otherwise MD5) (default : $default{unique})
--weight n : use 'n' as an approximation of the maximum page weight (default : $default{weight})
Example:
......@@ -166,6 +172,7 @@ $args{"label"} = $default{"label"} if ! exists $args{"label"};
$args{"limit"} = $default{"limit"} if ! exists $args{"limit"};
$args{"link"} = $default{"link"} if ! exists $args{"link"} && exists $default{"link"};
$args{"link"} =~ s/[\\\/]*$// if exists $args{"link"};
$args{"project"} = $default{"project"} if ! exists $args{"project"};
$args{"store"} = $default{"store"} if ! exists $args{"store"};
$args{"title"} = $default{"title"} if ! exists $args{"title"};
$args{"to"} = $default{"to"} if ! exists $args{"to"};
......@@ -409,14 +416,15 @@ my (%sections_classes, %sections_weight, @sections);
my $navbar;
# $prefix is a unique prefix that should be append to each link
# $prefix is a unique prefix that should be appended to each link
my $prefix = "c2_";
my $prefix = "c2_" . $args{"project"} . "_";
if (exists $args{"unique"}) {
$prefix .= $args{"unique"};
} else {
$prefix .= md5_hex($args{"label"} . $args{"title"});
}
$prefix = lc($prefix);
# Browse each class
......@@ -439,8 +447,8 @@ foreach my $class (@classes) {
last if ++$count > $args{"limit"};
if (exists $args{"link"}) {
push @temp,
' - @htmlonly <TT><A href="' . $args{"link"} . '/' .
$file . '">@endhtmlonly ' . $shorter_filename{$file} .
' - @htmlonly <TT><A href="' . $args{"link"} .
$shorter_filename{$file} . '">@endhtmlonly ' . $shorter_filename{$file} .
'@htmlonly</A></TT> @endhtmlonly';
} else {
push @temp, " - \@c $shorter_filename{$file}";
......@@ -583,7 +591,7 @@ foreach my $groupid (sort {$a <=> $b} keys %groups) {
if scalar @{$groups{$groupid}} > 1;
print DEST_FILE
"/*! \@page page_${prefix}_$groupid " . $args{"title"} . " ($fromto)\n\n$header";
"/*! \@page ${prefix}_$groupid " . $args{"title"} . " ($fromto)\n\n$header";
foreach my $section (@{$groups{$groupid}}) {
print DEST_FILE
......
#!/usr/bin/env perl
# Time-stamp: <2001-10-17 09:50:47 barre>
# Time-stamp: <2001-10-17 16:29:58 barre>
#
# Convert VTK headers to doxygen format
#
......@@ -497,7 +497,6 @@ foreach my $source (@files) {
$dest,
O_WRONLY|O_TRUNC|O_CREAT|$open_file_as_text)) {
my $dir = dirname($dest);
print $dest, " : ", $dir, "\n";
mkpath($dir);
sysopen(DEST_FILE,
$dest,
......
#!/usr/bin/env perl
# Time-stamp: <2001-09-26 14:31:32 barre>
# Time-stamp: <2001-10-17 16:42:49 barre>
#
# Build full-text index
#
# barre : Sebastien Barre <sebastien@barre.nom.fr>
#
# 0.21 (barre) :
# - add --project name : project name, used to uniquify
#
# 0.2 (barre) :
# - update to match the new VTK 4.0 tree
# - change default --dirs so that it can be launched from Utilities/Doxygen
......@@ -45,7 +48,7 @@ use Fcntl;
use File::Find;
use strict;
my ($VERSION, $PROGNAME, $AUTHOR) = (0.2, $0, "Sebastien Barre");
my ($VERSION, $PROGNAME, $AUTHOR) = (0.21, $0, "Sebastien Barre");
$PROGNAME =~ s/^.*[\\\/]//;
print "$PROGNAME $VERSION, by $AUTHOR\n";
......@@ -64,8 +67,9 @@ my %default =
"../../Parallel",
"../../Patented",
"../../Rendering"],
project => "VTK",
stop => "doc_index.stop",
store => "doc_index.dox",
store => "doc_VTK_index.dox",
to => "../../../VTK-doxygen",
weight => 90000
);
......@@ -75,18 +79,19 @@ my %default =
my %args;
Getopt::Long::Configure("bundling");
GetOptions (\%args, "help", "verbose|v", "debug", "limit=i", "stop=s", "store=s", "to=s", "weight=i");
GetOptions (\%args, "help", "verbose|v", "debug", "limit=i", "project=s", "stop=s", "store=s", "to=s", "weight=i");
if (exists $args{"help"}) {
print <<"EOT";
Usage : $PROGNAME [--help] [--verbose|-v] [--limit n] [--stop file] [--store file] [--to path] [--weight n] [files|directories...]
--help : this message
--verbose|-v : verbose (display filenames while processing)
--limit n : limit the number of xrefs per word (default: $default{limit})
--stop file : use 'file' to read stop-words (default: $default{stop})
--store file : use 'file' to store index (default: $default{store})
--to path : use 'path' as destination directory (default : $default{to})
--weight n : use 'n' as an approximation of the maximum page weight (default : $default{weight})
--help : this message
--verbose|-v : verbose (display filenames while processing)
--limit n : limit the number of xrefs per word (default: $default{limit})
--project name : project name, used to uniquify (default: $default{project})
--stop file : use 'file' to read stop-words (default: $default{stop})
--store file : use 'file' to store index (default: $default{store})
--to path : use 'path' as destination directory (default : $default{to})
--weight n : use 'n' as an approximation of the maximum page weight (default : $default{weight})
Example:
$PROGNAME
......@@ -97,6 +102,7 @@ EOT
$args{"debug"} = $default{"debug"} if exists $default{"debug"};
$args{"verbose"} = 1 if exists $default{"verbose"};
$args{"limit"} = $default{"limit"} if ! exists $args{"limit"};
$args{"project"} = $default{"project"} if ! exists $args{"project"};
$args{"stop"} = $default{"stop"} if ! exists $args{"stop"};
$args{"store"} = $default{"store"} if ! exists $args{"store"};
$args{"to"} = $default{"to"} if ! exists $args{"to"};
......@@ -434,6 +440,11 @@ my (%sections_words, %sections_weight, @sections);
my $navbar;
# $prefix is a unique prefix that should be appended to each link
my $prefix = "idx_" . $args{"project"};
$prefix = lc($prefix);
# Browse each word
foreach my $word (@words) {
......@@ -483,7 +494,7 @@ print " => ", scalar @words, " words(s) documented in ", time() - $intermediate_
my @temp;
foreach my $section (@sections) {
push @temp, "\@ref idx_section_$section \"$section\"";
push @temp, "\@ref ${prefix}_section_$section \"$section\"";
}
$navbar = "$indent\@par Navigation: \n$indent\[" . join(" | ", @temp) . "]\n";
......@@ -590,11 +601,11 @@ foreach my $groupid (sort {$a <=> $b} keys %groups) {
if scalar @{$groups{$groupid}} > 1;
print DEST_FILE
"/*! \@page page_idx_$groupid Full-text Index ($fromto)\n\n$header";
"/*! \@page ${prefix}_$groupid Full-text Index ($fromto)\n\n$header";
foreach my $section (@{$groups{$groupid}}) {
print DEST_FILE
"\n$indent\@section idx_section_$section $section\n\n$navbar\n";
"\n$indent\@section ${prefix}_section_$section $section\n\n$navbar\n";
foreach my $word (@{$sections_words{$section}}) {
print DEST_FILE $words_doc{$word}, "\n";
......
perl doc_header2doxygen.pl --to ../../../VTK-doxygen
perl doc_version.pl --logo "vtk-logo.gif" --to ../../../VTK-doxygen
perl doc_class2example.pl --link http://public.kitware.com/cgi-bin/cvsweb.cgi/~checkout~/VTK/Utilities/Doxygen --to ../../../VTK-doxygen
perl doc_class2example.pl --dirmatch "^Testing$" --label "Tests" --title "Class To Tests" --store "doc_class2tests.dox" --unique "t" --link http://public.kitware.com/cgi-bin/cvsweb.cgi/~checkout~/VTK/Utilities/Doxygen --to ../../../VTK-doxygen
perl doc_index.pl --to ../../../VTK-doxygen
doxygen
perl doc_rmpath.pl --to ../../../VTK-doxygen --html ../../../doc/html
# Project name. Used in some of the resulting file names and xrefs to
# uniquify two or more projects linked together through their Doxygen tag files.
# Example: PROJECT_NAME=@PROJECT_NAME@
#
export PROJECT_NAME=VTK
# Path to the directory holding the Perl scripts used to produce the VTK doc
# in Doxygen format.
# Example: PATH_TO_VTK_DOX_SCRIPTS=@VTK_SOURCE_DIR@/Utilities/Doxygen
#
export PATH_TO_VTK_DOX_SCRIPTS=.
# Source directory.
# Example: SOURCE_DIR=@SBVTK_SOURCE_DIR@
#
export SOURCE_DIR=../..
# Relative path from the source directory to the top most directory holding
# the files to document.
# Example: REL_PATH_TO_TOP=framework/src
# or REL_PATH_TO_TOP=.
#
export REL_PATH_TO_TOP=.
# Directory where the intermediate Doxygen files should be stored (mainly
# the headers files converted from the VTK format to the Doxygen format).
# DOXTEMP might be used to simplify syntax.
# Example: DOXTEMP=DOXTEMP=@SBVTK_BINARY_DIR@/Utilities/Doxygen
# INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
#
export INTERMEDIATE_DOX_DIR=../../../$PROJECT_NAME-doxygen
# URL to the CVSWeb of the project, in checkout mode (i.e. appending a file
# name to this URL will retrieve the contents of the file).
# Example: CVSWEB_CHECKOUT=http://public.kitware.com/cgi-bin/cvsweb.cgi/~checkout~/VTK
#
export CVSWEB_CHECKOUT=http://public.kitware.com/cgi-bin/cvsweb.cgi/~checkout~/VTK
# Path to the Doxygen configuration file (i.e. doxyfile).
# Example: DOXYFILE=$DOXTEMP/doxyfile
#
export DOXYFILE=$PATH_TO_VTK_DOX_SCRIPTS/doxyfile
# Path to the Doxygen output directory (where the resulting doc is stored).
# Example: RESULTING_DOC_DIR=$DOXTEMP/doc
#
export RESULTING_DOC_DIR=../../../doc
# Name of the resulting CHM (Compressed HTML) file. If set and non-empty this
# will actually trigger the HTML-Help compiler to create the CHM. The resulting
# file will be renamed to this name.
# Example: RESULTING_CHM_FILE=$DOXTEMP/SBVTKFramework.chm
#
# export RESULTING_CHM_FILE=vtk4nightly.chm
# Name, remote location and destination dir of the VTK 4.0 tag file. If set, the
# tag file is retrieved from its remote location using wget and stored in the
# destination dir. It will be automatically deleted at the end of this script.
# Example: VTK_TAGFILE=vtk4.tag
# VTK_TAGFILE_REMOTE_DIR=http://public.kitware.com/VTK/doc/nightly/html
# VTK_TAGFILE_DEST_DIR=$DOXTEMP
# The Doxygen configuration file must be tailored to make use of this tag file.
# Example: TAGFILES = vtk4.tag=http://public.kitware.com/VTK/doc/nightly/html
#
# export VTK_TAGFILE=vtk4.tag
# export VTK_TAGFILE_REMOTE_DIR=http://public.kitware.com/VTK/doc/nightly/html
# export VTK_TAGFILE_DEST_DIR=../../../$PROJECT_NAME-doxygen
# ----------------------------------------------------------------------------
# Convert the VTK headers to the Doxygen format.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_header2doxygen.pl \
--to $INTERMEDIATE_DOX_DIR \
$SOURCE_DIR/$REL_PATH_TO_TOP/Common \
$SOURCE_DIR/$REL_PATH_TO_TOP/Filtering \
$SOURCE_DIR/$REL_PATH_TO_TOP/Graphics \
$SOURCE_DIR/$REL_PATH_TO_TOP/Hybrid \
$SOURCE_DIR/$REL_PATH_TO_TOP/Imaging \
$SOURCE_DIR/$REL_PATH_TO_TOP/IO \
$SOURCE_DIR/$REL_PATH_TO_TOP/Parallel \
$SOURCE_DIR/$REL_PATH_TO_TOP/Patented \
$SOURCE_DIR/$REL_PATH_TO_TOP/Rendering
# ----------------------------------------------------------------------------
# Extract the VTK version and create the main page.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_version.pl \
--header $SOURCE_DIR/$REL_PATH_TO_TOP/Common/vtkVersion.h \
--logo "vtk-logo.gif" \
--store "doc_""$PROJECT_NAME""_version.dox" \
--to $INTERMEDIATE_DOX_DIR
# ----------------------------------------------------------------------------
# Generate the 'Class to Examples' page cross-linking each class to these
# examples that use that class.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_class2example.pl \
--dirmatch "^Examples\$" \
--label "Examples" \
--link $CVSWEB_CHECKOUT \
--project $PROJECT_NAME \
--store "doc_""$PROJECT_NAME""_class2examples.dox" \
--title "Class To Examples" \
--to $INTERMEDIATE_DOX_DIR \
--unique "e" \
$SOURCE_DIR/$REL_PATH_TO_TOP
# ----------------------------------------------------------------------------
# Generate the 'Class to Tests' page cross-linking each class to these
# tests that use that class.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_class2example.pl \
--dirmatch "^Testing$" \
--label "Tests" \
--link $CVSWEB_CHECKOUT \
--project $PROJECT_NAME \
--store "doc_""$PROJECT_NAME""_class2tests.dox" \
--title "Class To Tests" \
--to $INTERMEDIATE_DOX_DIR \
--unique "t"
$SOURCE_DIR/$REL_PATH_TO_TOP
# ----------------------------------------------------------------------------
# Build the full-text index.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_index.pl \
--stop $PATH_TO_VTK_DOX_SCRIPTS/doc_index.stop \
--store "doc_""$PROJECT_NAME""_index.dox" \
--to $INTERMEDIATE_DOX_DIR \
$SOURCE_DIR/$REL_PATH_TO_TOP/Common \
$SOURCE_DIR/$REL_PATH_TO_TOP/Filtering \
$SOURCE_DIR/$REL_PATH_TO_TOP/Graphics \
$SOURCE_DIR/$REL_PATH_TO_TOP/Hybrid \
$SOURCE_DIR/$REL_PATH_TO_TOP/Imaging \
$SOURCE_DIR/$REL_PATH_TO_TOP/IO \
$SOURCE_DIR/$REL_PATH_TO_TOP/Parallel \
$SOURCE_DIR/$REL_PATH_TO_TOP/Patented \
$SOURCE_DIR/$REL_PATH_TO_TOP/Rendering
# ----------------------------------------------------------------------------
# Retrieve the VTK 4 tag file.
if test "x$VTK_TAGFILE" != "x" ; then
wget -nd -nH \
$VTK_TAGFILE_REMOTE_DIR/$VTK_TAGFILE \
-O $VTK_TAGFILE_DEST_DIR/$VTK_TAGFILE
fi
# ----------------------------------------------------------------------------
# Create the Doxygen doc.
doxygen $DOXYFILE
# ----------------------------------------------------------------------------
# Clean the HTML pages to remove the path to the intermediate Doxygen dir.
perl $PATH_TO_VTK_DOX_SCRIPTS/doc_rmpath.pl \
--to $INTERMEDIATE_DOX_DIR \
--html $RESULTING_DOC_DIR/html
# ----------------------------------------------------------------------------
# Create the CHM doc.
if test "x$RESULTING_CHM_FILE" != "x" ; then
cd $RESULTING_DOC_DIR/html
hhc index.hhp
mv index.chm $RESULTING_CHM_FILE
fi
# ----------------------------------------------------------------------------
# Clean-up.
# rm -fr $INTERMEDIATE_DOX_DIR
if test "x$VTK_TAGFILE" != "x" ; then
rm -fr $VTK_TAGFILE_DEST_DIR/$VTK_TAGFILE
fi
if test "x$RESULTING_CHM_FILE" != "x" ; then
# rm -fr $RESULTING_DOC_DIR
fi
#!/usr/bin/env perl
# Time-stamp: <2001-10-17 12:21:09 barre>
# Time-stamp: <2001-10-17 16:30:58 barre>
#
# Extract VTK version and add it to documentation
#
......@@ -58,7 +58,7 @@ print "$PROGNAME $VERSION, by $AUTHOR\n";
my %default =
(
header => "../../Common/vtkVersion.h",
store => "doc_version.dox",
store => "doc_VTK_version.dox",
to => "../../../VTK-doxygen"
);
......
#####################################
# doxyfile for vtk (w) by jan stifter
# modified by S. Barre (Time-stamp: <2001-10-17 13:28:49 barre>
# modified by S. Barre (Time-stamp: <2001-10-17 17:33:30 barre>
#####################################
PROJECT_NAME = VTK
......@@ -22,7 +22,7 @@ GENERATE_TAGFILE = ../../../doc/html/vtk4.tag
# would be 2000 x 8000 pixels wide, crashing the HTML navigator
HAVE_DOT = YES
# HAVE_DOT = NO
#HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
......@@ -39,6 +39,13 @@ GRAPHICAL_HIERARCHY = NO
OUTPUT_DIRECTORY = ../../../doc
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../../../VTK-doxygen/Common ../../../VTK-doxygen/Filtering ../../../VTK-doxygen/Graphics ../../../VTK-doxygen/Hybrid ../../../VTK-doxygen/Imaging ../../../VTK-doxygen/IO ../../../VTK-doxygen/Parallel ../../../VTK-doxygen/Patented ../../../VTK-doxygen/Rendering ../../../VTK-doxygen/doc_VTK_version.dox ../../../VTK-doxygen/doc_VTK_class2examples.dox ../../../VTK-doxygen/doc_VTK_class2tests.dox ../../../VTK-doxygen/doc_VTK_index.dox
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
......@@ -184,17 +191,6 @@ TAB_SIZE = 3
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
# ../VTK-doxygen/doc_version.dox ../VTK-doxygen/doc_class2example.dox ../VTK-doxygen/doc_index.dox
INPUT = ../../../VTK-doxygen/Common ../../../VTK-doxygen/Filtering ../../../VTK-doxygen/Graphics ../../../VTK-doxygen/Hybrid ../../../VTK-doxygen/Imaging ../../../VTK-doxygen/IO ../../../VTK-doxygen/Parallel ../../../VTK-doxygen/Patented ../../../VTK-doxygen/Rendering ../../../VTK-doxygen/doc_version.dox ../../../VTK-doxygen/doc_class2examples.dox ../../../VTK-doxygen/doc_class2tests.dox ../../../VTK-doxygen/doc_index.dox
# INPUT = ../../../VTK-doxygen/doc_class2examples.dox
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment