CMake/Utilities/Doxygen/doc_makeall.sh.in

249 lines
9.4 KiB
Bash
Raw Normal View History

2001-11-03 00:05:37 +03:00
# -------------------------------------------------------------------------
# Doxygen documentation batch
2003-01-16 22:05:56 +03:00
# modified by S. Barre (Time-stamp: <2003-01-16 14:04:41 barre>
2001-11-03 00:05:37 +03:00
# -------------------------------------------------------------------------
# Path to several tools (_PROG to avoid the typical GZIP env var pb)
# Example:
2001-11-03 00:05:37 +03:00
# DOXYGEN_PROG=@DOXYGEN@ (INCLUDE(${CMAKE_ROOT}/Modules/FindDoxygen.cmake))
# GZIP_PROG=@GZIP@ (INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake))
# HHC_PROG=@HHC@ (INCLUDE(${CMAKE_ROOT}/Modules/FindHhc.cmake))
# MV_PROG=@MV@ (INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake))
# PERL_PROG=@PERL@ (INCLUDE(${CMAKE_ROOT}/Modules/FindPerl.cmake))
# RM_PROG=@RM@ (INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake))
# TAR_PROG=@TAR@ (INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake))
# WGET_PROG=@WGET@ (INCLUDE(${CMAKE_ROOT}/Modules/FindWget.cmake))
#
2003-01-16 22:05:56 +03:00
export DOXYGEN_PROG="@DOXYGEN@" # Doxygen
export GZIP_PROG="@GZIP@" # gzip (Unix-like 'gzip compressor')
export GNUPLOT_PROG="@GNUPLOT@" # gnuplot (data plotting program)
export HHC_PROG="@HTML_HELP_COMPILER@" # HTML Help Compiler
export MV_PROG="@MV@" # mv (Unix-like 'move/rename files')
export PERL_PROG="@PERL@" # Perl
export RM_PROG="@RM@" # rm (Unix-like 'remove files')
export TAR_PROG="@TAR@" # tar (Unix-like 'archiver')
export WGET_PROG="@WGET@" # wget (remote file retrieval)
2001-11-03 00:05:37 +03:00
# PROJECT_NAME:
# Documentation/project name. Used in some of the resulting file names and
# xrefs to uniquify two or more projects linked together through their
2001-11-03 00:05:37 +03:00
# Doxygen's tag files. Mandatory for each documentation set.
# Note: might be the same as the doxyfile's PROJECT_NAME
# Example:
2001-11-03 00:05:37 +03:00
# PROJECT_NAME=VTK
#
export PROJECT_NAME=CMake
2002-02-14 02:28:16 +03:00
# PATH_TO_VTK_DOX_SCRIPTS:
# Path to the directory holding the Perl scripts used to produce the VTK doc
# in Doxygen format. You need the VTK source files or a local copy of
2002-02-14 02:28:16 +03:00
# these scripts.
# Example:
2002-02-14 02:28:16 +03:00
# PATH_TO_VTK_DOX_SCRIPTS=@VTK_SOURCE_DIR@/Utilities/Doxygen
#
export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen"
2001-11-03 00:05:37 +03:00
# SOURCE_DIR:
# Source directory. The top directory of the source files.
# Example:
2001-11-03 00:05:37 +03:00
# SOURCE_DIR=@VTK_SOURCE_DIR@
#
export SOURCE_DIR="@CMake_SOURCE_DIR@"
2001-11-03 00:05:37 +03:00
# REL_PATH_TO_TOP:
# Relative path from the top directory of the source files to the directory
# (or top directory) holding the files to document. Useful if several parts
# of the same source directory should be documented separately.
# Example:
2001-11-03 00:05:37 +03:00
# REL_PATH_TO_TOP=.
# REL_PATH_TO_TOP=framework/src
#
2002-02-14 02:28:16 +03:00
# export REL_PATH_TO_TOP=Source
export REL_PATH_TO_TOP=.
2001-11-03 00:05:37 +03:00
# INTERMEDIATE_DOX_DIR:
# Directory where the intermediate Doxygen files should be stored (mainly
# these headers files converted from the VTK format to the Doxygen format).
# This directory is erased at the end of this script, unless you comment
# the corresponding line.
# DOXTEMP might be used to simplify the syntax.
# Example:
2001-11-03 00:05:37 +03:00
# DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen
# INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
#
export DOXTEMP="@CMake_BINARY_DIR@/Utilities/Doxygen"
2002-02-14 02:28:16 +03:00
export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox"
2001-11-03 00:05:37 +03:00
# DOXYFILE:
# Path to the Doxygen configuration file (i.e. doxyfile).
# Example:
2001-11-03 00:05:37 +03:00
# DOXYFILE=$DOXTEMP/doxyfile
#
2002-02-14 02:28:16 +03:00
export DOXYFILE="$DOXTEMP/doxyfile"
2001-11-03 00:05:37 +03:00
# OUTPUT_DIRECTORY ALLOW_ERASE_OUTPUT_DIRECTORY:
# Path to the Doxygen output directory (where the resulting doc is stored).
# Note: should be the same as your doxyfile's OUTPUT_DIRECTORY
# If ON, allows the output directory to be erased when some advanced output
2002-02-14 02:28:16 +03:00
# file have been produced (HTML Help, or TAR archive for example).
# Example:
2001-11-03 00:05:37 +03:00
# OUTPUT_DIRECTORY=$DOXTEMP/doc
# ALLOW_ERASE_OUTPUT_DIRECTORY=ON
#
2002-02-14 02:28:16 +03:00
export OUTPUT_DIRECTORY="$DOXTEMP/doc"
2001-11-03 00:05:37 +03:00
export ALLOW_ERASE_OUTPUT_DIRECTORY=ON
# COMPILE_HTML_HELP RESULTING_HTML_HELP_FILE:
# Compile the CHM (Compressed HTML) HTML Help file, name of the resulting
# file. If set to ON and name is non-empty these options will actually
2001-11-03 00:05:37 +03:00
# trigger the HTML-Help compiler to create the CHM. The resulting
# file (usually index.chm) will be renamed to this name.
# Note: if ON, the whole $OUTPUT_DIRECTORY will be erased at the end of
# this script, since this file is considered to be one of the
2001-11-03 00:05:37 +03:00
# advanced final output, unless ALLOW_ERASE_OUTPUT_DIRECTORY is OFF
# Note: your doxyfile should be configured to enable HTML Help creation
2001-11-03 00:05:37 +03:00
# (using GENERATE_HTML = YES, GENERATE_HTMLHELP = YES)
# Example:
2001-11-03 00:05:37 +03:00
# COMPILE_HTML_HELP=ON
# COMPILE_HTML_HELP=@DOCUMENTATION_HTML_HELP@
# RESULTING_HTML_HELP_FILE=$DOXTEMP/vtk4.chm
#
export COMPILE_HTML_HELP=@DOCUMENTATION_HTML_HELP@
2005-01-18 17:06:53 +03:00
export RESULTING_HTML_HELP_FILE="$DOXTEMP/$PROJECT_NAME.chm"
2001-11-03 00:05:37 +03:00
# CREATE_HTML_TARZ_ARCHIVE RESULTING_HTML_TARZ_ARCHIVE_FILE:
# Create a compressed (gzip) tar archive of the html directory (located
# under the OUTPUT_DIRECTORY), and name of the resulting archive file.
# Note: your doxyfile should be configured to enable HTML creation
2001-11-03 00:05:37 +03:00
# (using GENERATE_HTML = YES)
# Example:
2001-11-03 00:05:37 +03:00
# CREATE_HTML_TARZ_ARCHIVE=ON
# CREATE_HTML_TARZ_ARCHIVE=@DOCUMENTATION_HTML_TARZ@
# RESULTING_HTML_TARZ_ARCHIVE_FILE=$DOXTEMP/vtk4-html.tar.gz
# RESULTING_HTML_TARZ_ARCHIVE_FILE=$DOXTEMP/$PROJECT_NAME-html.tar.gz
#
export CREATE_HTML_TARZ_ARCHIVE=@DOCUMENTATION_HTML_TARZ@
2005-01-18 17:06:53 +03:00
export RESULTING_HTML_TARZ_ARCHIVE_FILE="$DOXTEMP/$PROJECT_NAME-html.tar.gz"
2002-02-14 02:28:16 +03:00
# ----------------------------------------------------------------------------
# Build the contributors list.
if test "x@VTK_SOURCE_DIR@" != "x" ; then
if test "x$PERL_PROG" != "xNOTFOUND" ; then
$PERL_PROG "$PATH_TO_VTK_DOX_SCRIPTS/doc_contributors.pl" \
--authors "$SOURCE_DIR/Utilities/Doxygen/authors.txt" \
--cachedir "$DOXTEMP/cache" \
--class_group '^(cm[A-Z0-9][A-Za-z0-9]+)\.(?:c|cpp|cxx|h|fl)$' \
--files_in '(?:^hints|dummy|README|^Makefile\.borland|\.(?:c|cmake|cpp|cxx|h|html|in|java|fl|pl|py|tcl|txt))$' \
--files_out '(?:^ChangeLog\.txt)$' \
--gnuplot_file "$DOXTEMP/contrib/history.plt" \
--history_img "|lines|$DOXTEMP/contrib/history.png" \
--history_img "365|lines|$DOXTEMP/contrib/history2y.png" \
--history_img "180|linespoints|$DOXTEMP/contrib/history6m.png" \
--history_dir "$DOXTEMP/contrib" \
--history_max_nb 10 \
--lines_add 1.0 \
--lines_rem 0.5 \
--massive 50 \
--max_class_nb 10 \
--max_file_nb 5 \
--min_class 0.02 \
--min_file 0.01 \
--min_contrib 0.05 \
--min_gcontrib 0.0001 \
--store "doc_""$PROJECT_NAME""_contributors.dox" \
--relativeto "$SOURCE_DIR/$REL_PATH_TO_TOP" \
--to "$INTERMEDIATE_DOX_DIR" \
"$SOURCE_DIR/$REL_PATH_TO_TOP"
fi
if test "x$GNUPLOT_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
$GNUPLOT_PROG "$DOXTEMP/contrib/history.plt"
2002-02-14 02:28:16 +03:00
fi
fi
2001-11-03 00:05:37 +03:00
# ----------------------------------------------------------------------------
# Create the Doxygen doc.
if test "x$DOXYGEN_PROG" != "xNOTFOUND" ; then
2001-11-03 00:44:25 +03:00
if test "x$RM_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
$RM_PROG -fr "$OUTPUT_DIRECTORY"
2001-11-03 00:44:25 +03:00
fi
2005-01-18 17:06:53 +03:00
"$DOXYGEN_PROG" "$DOXYFILE"
# yes, a second time, to get the contrib, I don't know why
"$DOXYGEN_PROG" "$DOXYFILE"
2001-11-03 00:05:37 +03:00
fi
2002-02-14 02:28:16 +03:00
# ----------------------------------------------------------------------------
# Clean the HTML pages to remove the path to the intermediate Doxygen dir.
if test "x@VTK_SOURCE_DIR@" != "x" ; then
if test "x$PERL_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
$PERL_PROG "$PATH_TO_VTK_DOX_SCRIPTS/doc_rmpath.pl" \
2002-02-14 02:28:16 +03:00
--verbose \
--to "$INTERMEDIATE_DOX_DIR" \
--html "$OUTPUT_DIRECTORY/html"
fi
2005-01-18 17:06:53 +03:00
fi
2002-02-14 02:28:16 +03:00
2001-11-03 00:05:37 +03:00
# ----------------------------------------------------------------------------
# Create the CHM HTML HELP doc.
if test "x$COMPILE_HTML_HELP" == "xON" ; then
if test "x$RESULTING_HTML_HELP_FILE" != "x" ; then
cd $OUTPUT_DIRECTORY/html
if test "x$HHC_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
"$HHC_PROG" index.hhp
2001-11-03 00:05:37 +03:00
if test "x$MV_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
$MV_PROG -f index.chm "$RESULTING_HTML_HELP_FILE"
2001-11-03 00:05:37 +03:00
fi
fi
fi
fi
# ----------------------------------------------------------------------------
# Create the compressed tar archive.
if test "x$CREATE_HTML_TARZ_ARCHIVE" == "xON" ; then
if test "x$RESULTING_HTML_TARZ_ARCHIVE_FILE" != "x" ; then
2005-01-18 17:06:53 +03:00
cd "$OUTPUT_DIRECTORY"
2001-11-03 00:05:37 +03:00
if test "x$TAR_PROG" != "xNOTFOUND" ; then
if test "x$RM_PROG" != "xNOTFOUND" ; then
$RM_PROG -f html.tar
fi
$TAR_PROG -cf html.tar html
if test "x$GZIP_PROG" != "xNOTFOUND" ; then
if test "x$RM_PROG" != "xNOTFOUND" ; then
$RM_PROG -f html.tar.gz
fi
$GZIP_PROG html.tar
2005-01-18 17:06:53 +03:00
$MV_PROG -f html.tar.gz "$RESULTING_HTML_TARZ_ARCHIVE_FILE"
2001-11-03 00:05:37 +03:00
fi
fi
fi
fi
# ----------------------------------------------------------------------------
# Clean-up.
if test "x$RM_PROG" != "xNOTFOUND" ; then
2005-01-18 17:06:53 +03:00
$RM_PROG -fr "$INTERMEDIATE_DOX_DIR"
2001-11-03 00:05:37 +03:00
if test "x$DOWNLOAD_VTK_TAGFILE" == "xON" ; then
if test "x$VTK_TAGFILE" != "x" ; then
2005-01-18 17:06:53 +03:00
$RM_PROG -f "$VTK_TAGFILE_DEST_DIR/$VTK_TAGFILE"
2001-11-03 00:05:37 +03:00
fi
fi
if test "x$COMPILE_HTML_HELP" == "xON" ; then
if test "x$RESULTING_HTML_HELP_FILE" != "x" ; then
if test "x$ALLOW_ERASE_OUTPUT_DIRECTORY" == "xON" ; then
2005-01-18 17:06:53 +03:00
$RM_PROG -fr "$OUTPUT_DIRECTORY"
2001-11-03 00:05:37 +03:00
fi
fi
fi
fi