Added CMake_BUILD_DEVELOPER_REFERENCE option

By default is OFF and marked as advanced.

It's also add custom cmake-developer-reference (ALL) target

Generated output will be installed to ${CMAKE_DOC_DIR}/developer-reference.
This commit is contained in:
Konstantin Podsvirov 2016-08-04 13:01:42 +03:00
parent 6b07972fbd
commit c18dc6fbe5
10 changed files with 139 additions and 295 deletions

View File

@ -93,6 +93,11 @@ option(CMake_INSTALL_DEPENDENCIES
"Whether to install 3rd-party runtime dependencies" OFF)
mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
# option to build reference for CMake developers
option(CMake_BUILD_DEVELOPER_REFERENCE
"Build CMake Developer Reference" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script

View File

@ -50,6 +50,15 @@ if(WIN32)
add_definitions(-DUNICODE -D_UNICODE)
endif()
# configure the .dox.in file
if(CMake_BUILD_DEVELOPER_REFERENCE)
configure_file(
"${CMake_SOURCE_DIR}/Source/dir.dox.in"
"${CMake_BINARY_DIR}/Source/dir.dox"
@ONLY
)
endif()
# configure the .h file
configure_file(
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

7
Source/dir.dox Normal file
View File

@ -0,0 +1,7 @@
/*!
\dir
\brief Root \c ${CMake_SOURCE_DIR}/Source directory
*/

7
Source/dir.dox.in Normal file
View File

@ -0,0 +1,7 @@
/*!
\dir
\brief Generated \c ${CMake_BINARY_DIR}/Source directory
*/

View File

@ -10,30 +10,96 @@
# See the License for more information.
#=============================================================================
#
# Build the documentation
#
include (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake)
unset(CMAKE_DATA_DIR)
unset(CMAKE_DATA_DIR CACHE)
macro(CMake_OPTIONAL_COMPONENT)
set(COMPONENT "")
endmacro()
endif()
if (BUILD_DOCUMENTATION)
project(CMakeDeveloperReference NONE)
#
# Build the reference
#
if (CMake_BUILD_DEVELOPER_REFERENCE OR CMakeDeveloperReference_STANDALONE)
find_package(Doxygen REQUIRED)
#
## Output formats
#
option(CMake_BUILD_DEVELOPER_REFERENCE_HTML "Build CMake Developer Reference - HTML format" ON)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
set(GENERATE_HTML YES)
else()
set(GENERATE_HTML NO)
endif()
option(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP "Build CMake Developer Reference - QtHelp format" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
set(GENERATE_QHP YES)
find_program(QHELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator
DOC "qhelpgenerator tool"
)
if(NOT QHELPGENERATOR_EXECUTABLE)
message(FATAL_ERROR "QHELPGENERATOR_EXECUTABLE (qhelpgenerator) not found!")
endif()
else()
set(GENERATE_QHP NO)
endif()
#
# Configure the script and the doxyfile, then add target
#
if(DOXYGEN_DOT_FOUND)
set(HAVE_DOT YES)
else()
set(HAVE_DOT NO)
endif()
if(NOT DOT_PATH)
get_filename_component(DOT_PATH ${DOT} PATH)
get_filename_component(DOT_PATH ${DOXYGEN_DOT_EXECUTABLE} PATH)
endif()
configure_file(
${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in
${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile)
configure_file(doxyfile.in doxyfile @ONLY)
configure_file(
${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in
${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
add_custom_target(cmake-developer-reference-all
${DOXYGEN_EXECUTABLE} doxyfile
WORKING_DIRECTORY ${CMakeDeveloperReference_BINARY_DIR})
add_custom_target(DoxygenDoc
${BASH}
${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh)
add_custom_target(cmake-developer-reference ALL DEPENDS cmake-developer-reference-all)
#
# Installation
#
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
CMake_OPTIONAL_COMPONENT(cmake-developer-reference-html)
install(DIRECTORY "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/html"
DESTINATION ${CMAKE_DOC_DIR}/developer-reference
${COMPONENT})
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
CMake_OPTIONAL_COMPONENT(cmake-developer-reference-qthelp)
install(FILES "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/CMakeDeveloperReference-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch"
DESTINATION ${CMAKE_DOC_DIR}/developer-reference
${COMPONENT})
endif()
endif ()

View File

@ -0,0 +1,8 @@
/*!
\mainpage CMake Developer Reference
This manual is intended for reference by developers modifying the CMake
source tree itself.
*/

View File

@ -1,17 +0,0 @@
andy: Cedilnik, Andy (andy.cedilnik@kitware.com)
barre: Barre, Sebastien (sebastien.barre@kitware.com)
berk: Geveci, Berk (berk.geveci@kitware.com)
bettingf: Bettinger, Franck (bettingf@cs.man.ac.uk)
biddi: Biddiscombe, John (jbiddiscombe@skippingmouse.co.uk)
blezek: Blezek, Dan (blezek@crd.ge.com)
geoff: Cross, Geoffrey (geoff@robots.ox.ac.uk)
hoffman: Hoffman, Bill (bill.hoffman@kitware.com)
ibanez: Ibanez, Luis (luis.ibanez@kitware.com)
iscott: Scott, Ian (ian.m.scott@stud.man.ac.uk)
king: King, Brad (brad.king@kitware.com)
lorensen: Lorensen, Bill (lorensen@crd.ge.com)
martink, lymbdemo: Martin, Ken (ken.martin@kitware.com)
millerjv: Miller, Jim (millerjv@crd.ge.com)
perera: Perera, Amitha (perera@cs.rpi.edu)
starreveld: Starreveld, Yves (ystarrev@julian.uwo.ca)
will, schroede: Schroeder, Will (will.schroeder@kitware.com)

View File

@ -1,248 +0,0 @@
# -------------------------------------------------------------------------
# Doxygen documentation batch
# modified by S. Barre (Time-stamp: <2003-01-16 14:04:41 barre>
# -------------------------------------------------------------------------
# Path to several tools (_PROG to avoid the typical GZIP env var pb)
# Example:
# 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))
#
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)
# 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
# Doxygen's tag files. Mandatory for each documentation set.
# Note: might be the same as the doxyfile's PROJECT_NAME
# Example:
# PROJECT_NAME=VTK
#
export PROJECT_NAME=CMake
# 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
# these scripts.
# Example:
# PATH_TO_VTK_DOX_SCRIPTS=@VTK_SOURCE_DIR@/Utilities/Doxygen
#
export PATH_TO_VTK_DOX_SCRIPTS="@VTK_SOURCE_DIR@/Utilities/Doxygen"
# SOURCE_DIR:
# Source directory. The top directory of the source files.
# Example:
# SOURCE_DIR=@VTK_SOURCE_DIR@
#
export SOURCE_DIR="@CMake_SOURCE_DIR@"
# 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:
# REL_PATH_TO_TOP=.
# REL_PATH_TO_TOP=framework/src
#
# export REL_PATH_TO_TOP=Source
export REL_PATH_TO_TOP=.
# 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:
# DOXTEMP=DOXTEMP=@VTK_BINARY_DIR@/Utilities/Doxygen
# INTERMEDIATE_DOX_DIR=$DOXTEMP/dox
#
export DOXTEMP="@CMake_BINARY_DIR@/Utilities/Doxygen"
export INTERMEDIATE_DOX_DIR="$DOXTEMP/dox"
# DOXYFILE:
# Path to the Doxygen configuration file (i.e. doxyfile).
# Example:
# DOXYFILE=$DOXTEMP/doxyfile
#
export DOXYFILE="$DOXTEMP/doxyfile"
# 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
# file have been produced (HTML Help, or TAR archive for example).
# Example:
# OUTPUT_DIRECTORY=$DOXTEMP/doc
# ALLOW_ERASE_OUTPUT_DIRECTORY=ON
#
export OUTPUT_DIRECTORY="$DOXTEMP/doc"
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
# 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
# advanced final output, unless ALLOW_ERASE_OUTPUT_DIRECTORY is OFF
# Note: your doxyfile should be configured to enable HTML Help creation
# (using GENERATE_HTML = YES, GENERATE_HTMLHELP = YES)
# Example:
# COMPILE_HTML_HELP=ON
# COMPILE_HTML_HELP=@DOCUMENTATION_HTML_HELP@
# RESULTING_HTML_HELP_FILE=$DOXTEMP/vtk4.chm
#
export COMPILE_HTML_HELP=@DOCUMENTATION_HTML_HELP@
export RESULTING_HTML_HELP_FILE="$DOXTEMP/$PROJECT_NAME.chm"
# 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
# (using GENERATE_HTML = YES)
# Example:
# 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@
export RESULTING_HTML_TARZ_ARCHIVE_FILE="$DOXTEMP/$PROJECT_NAME-html.tar.gz"
# ----------------------------------------------------------------------------
# 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
"$GNUPLOT_PROG" "$DOXTEMP/contrib/history.plt"
fi
fi
# ----------------------------------------------------------------------------
# Create the Doxygen doc.
if test "x$DOXYGEN_PROG" != "xNOTFOUND" ; then
if test "x$RM_PROG" != "xNOTFOUND" ; then
"$RM_PROG" -fr "$OUTPUT_DIRECTORY"
fi
"$DOXYGEN_PROG" "$DOXYFILE"
# yes, a second time, to get the contrib, I don't know why
"$DOXYGEN_PROG" "$DOXYFILE"
fi
# ----------------------------------------------------------------------------
# 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
"$PERL_PROG" "$PATH_TO_VTK_DOX_SCRIPTS/doc_rmpath.pl" \
--verbose \
--to "$INTERMEDIATE_DOX_DIR" \
--html "$OUTPUT_DIRECTORY/html"
fi
fi
# ----------------------------------------------------------------------------
# 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
"$HHC_PROG" index.hhp
if test "x$MV_PROG" != "xNOTFOUND" ; then
"$MV_PROG" -f index.chm "$RESULTING_HTML_HELP_FILE"
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
cd "$OUTPUT_DIRECTORY"
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
"$MV_PROG" -f html.tar.gz "$RESULTING_HTML_TARZ_ARCHIVE_FILE"
fi
fi
fi
fi
# ----------------------------------------------------------------------------
# Clean-up.
if test "x$RM_PROG" != "xNOTFOUND" ; then
"$RM_PROG" -fr "$INTERMEDIATE_DOX_DIR"
if test "x$DOWNLOAD_VTK_TAGFILE" == "xON" ; then
if test "x$VTK_TAGFILE" != "x" ; then
"$RM_PROG" -f "$VTK_TAGFILE_DEST_DIR/$VTK_TAGFILE"
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
"$RM_PROG" -fr "$OUTPUT_DIRECTORY"
fi
fi
fi
fi

View File

@ -1,28 +1,30 @@
# -------------------------------------------------------------------------
# doxyfile for CMake
# modified by S. Barre (Time-stamp: <2002-02-13 18:24:35 barre>
# doxyfile for CMakeReference
# -------------------------------------------------------------------------
PROJECT_NAME = CMake
PROJECT_BRIEF = "Cross-platform Make"
PROJECT_NUMBER = "@CMake_VERSION@"
PROJECT_LOGO = "@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup64.png"
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = \
"@CMake_SOURCE_DIR@/Source/" \
"@CMake_BINARY_DIR@/Source/"
"@CMake_SOURCE_DIR@/" \
"@CMake_BINARY_DIR@/"
WARN_IF_UNDOCUMENTED = NO
GENERATE_TREEVIEW = NO
GENERATE_TODOLIST = YES
GENERATE_BUGLIST = YES
GENERATE_HTML = YES
GENERATE_HTML = @GENERATE_HTML@
GENERATE_HTMLHELP = YES
GENERATE_QHP = @GENERATE_QHP@
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
HAVE_DOT = YES
#HAVE_DOT = NO
HAVE_DOT = @HAVE_DOT@
DOT_PATH = "@DOT_PATH@"
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
@ -37,20 +39,21 @@ REFERENCES_RELATION = YES
ALLEXTERNALS = NO
IMAGE_PATH = "@CMake_BINARY_DIR@/Utilities/Doxygen/contrib"
OUTPUT_DIRECTORY = "@CMake_BINARY_DIR@/Utilities/Doxygen/doc"
OUTPUT_DIRECTORY = "@CMakeDeveloperReference_BINARY_DIR@/developer-reference"
INPUT = \
"@CMake_SOURCE_DIR@/Utilities/Doxygen/DeveloperReference" \
"@CMake_SOURCE_DIR@/Source" \
"@CMake_SOURCE_DIR@/Source/CPack" \
"@CMake_SOURCE_DIR@/Source/CPack/IFW" \
"@CMake_SOURCE_DIR@/Source/CPack/WiX" \
"@CMake_SOURCE_DIR@/Source/CTest" \
"@CMake_SOURCE_DIR@/Source/CursesDialog" \
"@CMake_SOURCE_DIR@/Source/MFCDialog" \
"@CMake_SOURCE_DIR@/Source/kwsys" \
"@CMake_SOURCE_DIR@/Source/QtDialog" \
"@CMake_BINARY_DIR@/Source" \
"@CMake_BINARY_DIR@/Source/kwsys" \
"@CMake_BINARY_DIR@/Source/cmsys" \
"@CMake_BINARY_DIR@/Utilities/Doxygen/dox/doc_CMake_contributors.dox" \
"@CMake_BINARY_DIR@/Source/cmsys"
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
@ -68,7 +71,7 @@ SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = YES
TAB_SIZE = 3
FILE_PATTERNS = *.h *.hxx *.cxx
FILE_PATTERNS = *.h *.hxx *.cxx *.dox
RECURSIVE = NO
EXCLUDE_PATTERNS =
@ -82,3 +85,7 @@ MACRO_EXPANSION = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
EXPAND_ONLY_PREDEF = YES
QHP_NAMESPACE = org.cmake.developer-reference.@CMake_VERSION_MAJOR@@CMake_VERSION_MINOR@@CMake_VERSION_PATCH@
QCH_FILE = ../CMakeDeveloperReference-@CMake_VERSION_MAJOR@@CMake_VERSION_MINOR@@CMake_VERSION_PATCH@.qch
QHG_LOCATION = "@QHELPGENERATOR_EXECUTABLE@"