Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-05-24 15:17:42


Author: dgregor
Date: 2008-05-24 15:17:42 EDT (Sat, 24 May 2008)
New Revision: 45734
URL: http://svn.boost.org/trac/boost/changeset/45734

Log:
Build and install man pages for Function, cope with XSL stylesheet parameters, and install the necessary stylesheets and images
Added:
   branches/CMake/release/doc/CMakeLists.txt (contents, props changed)
   branches/CMake/release/doc/src/CMakeLists.txt (contents, props changed)
Text files modified:
   branches/CMake/release/CMakeLists.txt | 3 +
   branches/CMake/release/tools/build/CMake/BoostDocs.cmake | 77 +++++++++++++++++++++++++++++++++------
   2 files changed, 67 insertions(+), 13 deletions(-)

Modified: branches/CMake/release/CMakeLists.txt
==============================================================================
--- branches/CMake/release/CMakeLists.txt (original)
+++ branches/CMake/release/CMakeLists.txt 2008-05-24 15:17:42 EDT (Sat, 24 May 2008)
@@ -135,6 +135,9 @@
 # TODO: See if we can actually use auto-linking in our regression tests.
 add_definitions(-DBOOST_ALL_NO_LIB=1)
 
+# Add build rules for documentation
+add_subdirectory(doc)
+
 # Add build rules for all of the Boost libraries
 add_subdirectory(libs)
 

Added: branches/CMake/release/doc/CMakeLists.txt
==============================================================================
--- (empty file)
+++ branches/CMake/release/doc/CMakeLists.txt 2008-05-24 15:17:42 EDT (Sat, 24 May 2008)
@@ -0,0 +1,3 @@
+if (BUILD_DOCUMENTATION)
+ add_subdirectory(src)
+endif ()

Added: branches/CMake/release/doc/src/CMakeLists.txt
==============================================================================
--- (empty file)
+++ branches/CMake/release/doc/src/CMakeLists.txt 2008-05-24 15:17:42 EDT (Sat, 24 May 2008)
@@ -0,0 +1,13 @@
+if (BUILD_DOCUMENTATION_HTML)
+ # Install style sheets and the main Boost logo
+ install(FILES boostbook.css docutils.css reference.css ../../boost.png
+ DESTINATION share/boost-${BOOST_VERSION}/html)
+
+ # Install images
+ install(DIRECTORY images
+ DESTINATION share/boost-${BOOST_VERSION}/html
+ COMPONENT Core
+ PATTERN "CVS" EXCLUDE
+ REGEX ".svn" EXCLUDE)
+endif ()
+

Modified: branches/CMake/release/tools/build/CMake/BoostDocs.cmake
==============================================================================
--- branches/CMake/release/tools/build/CMake/BoostDocs.cmake (original)
+++ branches/CMake/release/tools/build/CMake/BoostDocs.cmake 2008-05-24 15:17:42 EDT (Sat, 24 May 2008)
@@ -17,6 +17,7 @@
 # [DEPENDS depend1 depend2 ...]
 # [CATALOG catalog]
 # [DIRECTORY]
+# [PARAMETERS param1=value1 param2=value2 ...]
 # [[MAKE_ALL_TARGET | MAKE_TARGET] target])
 #
 # This macro builds a custom command that transforms an XML file
@@ -31,6 +32,9 @@
 # catalog file, specify the name of the XML catalog file via the
 # CATALOG argument. It will be provided to the XSL transform.
 #
+# The PARAMETERS argument is followed by param=value pairs that set
+# additional parameters to the XSL stylesheet.
+#
 # To associate a target name with the result of the XSL
 # transformation, use the MAKE_TARGET or MAKE_ALL_TARGET option and
 # provide the name of the target. The MAKE_ALL_TARGET option only
@@ -39,7 +43,7 @@
 # name is required the DIRECTORY option is specified.
 macro(xsl_transform OUTPUT INPUT STYLESHEET)
   parse_arguments(THIS_XSL
- "DEPENDS;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET"
+ "DEPENDS;CATALOG;MAKE_ALL_TARGET;MAKE_TARGET;PARAMETERS"
     "DIRECTORY"
     ${ARGN}
     )
@@ -48,18 +52,28 @@
     set(THIS_XSL_CATALOG "XML_CATALOG_FILES=${THIS_XSL_CATALOG}")
   endif ()
 
+ set(THIS_XSL_EXTRA_FLAGS)
+ foreach(PARAM ${THIS_XSL_PARAMETERS})
+ string(REGEX REPLACE "([^=]*)=([^;]*)" "\\1;\\2"
+ XSL_PARAM_LIST ${PARAM})
+ list(GET XSL_PARAM_LIST 0 XSL_PARAM_NAME)
+ list(GET XSL_PARAM_LIST 1 XSL_PARAM_VALUE)
+ list(APPEND THIS_XSL_EXTRA_FLAGS
+ --stringparam ${XSL_PARAM_NAME} ${XSL_PARAM_VALUE})
+ endforeach(PARAM)
+
   if (THIS_XSL_DIRECTORY)
     # Run the XSLT processor to do an XML transformation with a
     # directory as output.
     if (THIS_XSL_MAKE_ALL_TARGET)
       add_custom_target(${THIS_XSL_MAKE_ALL_TARGET} ALL
- COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} -o ${OUTPUT}/
- ${STYLESHEET} ${INPUT}
+ COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS}
+ ${THIS_XSL_EXTRA_FLAGS} -o ${OUTPUT}/ ${STYLESHEET} ${INPUT}
         DEPENDS ${INPUT})
     elseif (THIS_XSL_MAKE_TARGET)
       add_custom_target(${THIS_XSL_MAKE_TARGET}
- COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} -o ${OUTPUT}/
- ${STYLESHEET} ${INPUT}
+ COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS}
+ ${THIS_XSL_EXTRA_FLAGS} -o ${OUTPUT}/ ${STYLESHEET} ${INPUT}
         DEPENDS ${INPUT})
     else()
       message(SEND_ERROR
@@ -69,8 +83,8 @@
     # Run the XSLT processor to do an XML transformation with a single
     # file as output.
     add_custom_command(OUTPUT ${OUTPUT}
- COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS} -o ${OUTPUT}
- ${STYLESHEET} ${INPUT}
+ COMMAND ${THIS_XSL_CATALOG} ${XSLTPROC} ${XSLTPROC_FLAGS}
+ ${THIS_XSL_EXTRA_FLAGS} -o ${OUTPUT} ${STYLESHEET} ${INPUT}
       DEPENDS ${INPUT})
 
     # Create a custom target to refer to the result of this
@@ -117,10 +131,42 @@
     # Transform DocBook into other formats
     boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_FILE})
   elseif(THIS_DOC_EXT STREQUAL ".DOCBOOK")
- xsl_transform(html ${THIS_DOC_SOURCE_PATH} ${BOOSTBOOK_XSL_DIR}/html.xsl
- CATALOG ${CMAKE_BINARY_DIR}/catalog.xml
- DIRECTORY
- MAKE_ALL_TARGET html)
+ # If requested, build HTML documentation
+ if (BUILD_DOCUMENTATION_HTML)
+ xsl_transform(
+ ${CMAKE_CURRENT_BINARY_DIR}/html
+ ${THIS_DOC_SOURCE_PATH}
+ ${BOOSTBOOK_XSL_DIR}/html.xsl
+ CATALOG ${CMAKE_BINARY_DIR}/catalog.xml
+ DIRECTORY
+ PARAMETERS admon.graphics.path=images
+ navig.graphics.path=images
+ boost.image.src=boost.png
+ MAKE_ALL_TARGET html)
+
+ # Install generated documentation
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
+ DESTINATION share/boost-${BOOST_VERSION}
+ COMPONENT ${ULIBNAME}_DOCS
+ PATTERN "*.manifest" EXCLUDE)
+ endif ()
+
+ # If requested, build Unix man pages
+ if (BUILD_DOCUMENTATION_MAN_PAGES)
+ xsl_transform(
+ ${CMAKE_CURRENT_BINARY_DIR}/man
+ ${THIS_DOC_SOURCE_PATH}
+ ${BOOSTBOOK_XSL_DIR}/manpages.xsl
+ CATALOG ${CMAKE_BINARY_DIR}/catalog.xml
+ DIRECTORY
+ MAKE_ALL_TARGET man)
+
+ # Install man pages
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man
+ DESTINATION .
+ COMPONENT ${ULIBNAME}_DOCS
+ PATTERN "*.manifest" EXCLUDE)
+ endif ()
   else()
     message(SEND_ERROR "Unknown documentation source kind ${SOURCE}.")
   endif()
@@ -237,10 +283,15 @@
   DOC "Path to the BoostBook XSL stylesheets")
 mark_as_advanced(BOOSTBOOK_XSL_DIR)
 
+# Try to find Doxygen
+find_package(Doxygen)
+
 if (XSLTPROC)
   if (DOCBOOK_DTD_DIR AND DOCBOOK_XSL_DIR)
- # We have all we need for documentation generation.
+ # Documentation build options
     option(BUILD_DOCUMENTATION "Whether to build library documentation" ON)
+ option(BUILD_DOCUMENTATION_HTML "Whether to build HTML documentation" ON)
+ option(BUILD_DOCUMENTATION_MAN_PAGES "Whether to build Unix man pages" ON)
 
     # Generate an XML catalog file.
     configure_file(${CMAKE_SOURCE_DIR}/tools/build/CMake/catalog.xml.in
@@ -266,7 +317,7 @@
   endif()
 endif()
 
-
+# Turn off BUILD_DOCUMENTATION if it isn't going to succeed.
 if (BUILD_DOCUMENTATION)
   set(BUILD_DOCUMENTATION_OKAY TRUE)
   if (NOT XSLTPROC)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk