Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-05-26 15:30:27


Author: dgregor
Date: 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
New Revision: 45784
URL: http://svn.boost.org/trac/boost/changeset/45784

Log:
libs/quickbook:
  - Copy quickbook over here and build it like a library until we figure out
    how best to handle tools.

libs/quickbook/module.cmake,
libs/quickbook/CMakeLists.txt:
  - Build Quickbook

libs/range/doc/CMakeLists.txt,
libs/range/CMakeLists.txt:
  - Build Boost.Range documentation

libs/filesystem/src/CMakeLists.txt:
  - Minor tweak

tools/build/CMake/BoostCore.cmake:
  - Add early draft of boost_tool_project, to be used for the various Boost
    tools

tools/build/CMake/BoostDocs.cmake:
  - Support documentation in Quickbook format

Added:
   branches/CMake/release/libs/quickbook/
      - copied from r45732, /branches/CMake/release/tools/quickbook/
   branches/CMake/release/libs/quickbook/CMakeLists.txt
      - copied, changed from r45783, /branches/CMake/release/tools/quickbook/CMakeLists.txt
   branches/CMake/release/libs/quickbook/Jamfile.v2
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/Jamfile.v2
   branches/CMake/release/libs/quickbook/block.hpp
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/block.hpp
   branches/CMake/release/libs/quickbook/code_snippet.hpp
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/code_snippet.hpp
   branches/CMake/release/libs/quickbook/detail/
      - copied from r45783, /branches/CMake/release/tools/quickbook/detail/
   branches/CMake/release/libs/quickbook/doc/
      - copied from r45783, /branches/CMake/release/tools/quickbook/doc/
   branches/CMake/release/libs/quickbook/doc_info.hpp
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/doc_info.hpp
   branches/CMake/release/libs/quickbook/extra/
      - copied from r45783, /branches/CMake/release/tools/quickbook/extra/
   branches/CMake/release/libs/quickbook/index.html
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/index.html
   branches/CMake/release/libs/quickbook/module.cmake (contents, props changed)
   branches/CMake/release/libs/quickbook/phrase.hpp
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/phrase.hpp
   branches/CMake/release/libs/quickbook/syntax_highlight.hpp
      - copied unchanged from r45783, /branches/CMake/release/tools/quickbook/syntax_highlight.hpp
   branches/CMake/release/libs/quickbook/test/
      - copied from r45783, /branches/CMake/release/tools/quickbook/test/
   branches/CMake/release/libs/range/doc/CMakeLists.txt (contents, props changed)
Text files modified:
   branches/CMake/release/libs/filesystem/src/CMakeLists.txt | 1
   branches/CMake/release/libs/quickbook/CMakeLists.txt | 33 +++++---
   branches/CMake/release/libs/range/CMakeLists.txt | 1
   branches/CMake/release/tools/build/CMake/BoostCore.cmake | 156 ++++++++++++++++++++++++++++++++++-----
   branches/CMake/release/tools/build/CMake/BoostDocs.cmake | 21 ++++-
   5 files changed, 174 insertions(+), 38 deletions(-)

Modified: branches/CMake/release/libs/filesystem/src/CMakeLists.txt
==============================================================================
--- branches/CMake/release/libs/filesystem/src/CMakeLists.txt (original)
+++ branches/CMake/release/libs/filesystem/src/CMakeLists.txt 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -2,6 +2,7 @@
   boost_filesystem
   operations.cpp path.cpp portability.cpp utf8_codecvt_facet.cpp
   SHARED_COMPILE_FLAGS "-DBOOST_FILESYSTEM_DYN_LINK=1"
+ STATIC_COMPILE_FLAGS "-DBOOST_FILESYSTEM_STATIC_LINK=1"
   DEPENDS boost_system
   )
 

Copied: branches/CMake/release/libs/quickbook/CMakeLists.txt (from r45783, /branches/CMake/release/tools/quickbook/CMakeLists.txt)
==============================================================================
--- /branches/CMake/release/tools/quickbook/CMakeLists.txt (original)
+++ branches/CMake/release/libs/quickbook/CMakeLists.txt 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -1,14 +1,21 @@
-if (MSVC)
- add_definitions(/wd4511 /wd4512 /wd4701 /wd4702 /wd4244 /wd4267 /wd4800)
-endif (MSVC)
+boost_tool_project(Quickbook
+ DESCRIPTION "A WikiWiki style documentation tool geared towards C++ documentation"
+ AUTHORS "Joel de Guzman <joel -at- boost-consulting.com>"
+ "Eric Niebler <eric -at- boost-consulting.com>")
 
-boost_add_executable(quickbook
- detail/quickbook.cpp
- detail/actions.cpp
- detail/actions_class.cpp
- detail/utils.cpp
- detail/post_process.cpp
- detail/collector.cpp
- detail/template_stack.cpp
- DEPENDS boost_program_options boost_filesystem
- )
+if (BUILD_QUICKBOOK)
+ if (MSVC)
+ add_definitions(/wd4511 /wd4512 /wd4701 /wd4702 /wd4244 /wd4267 /wd4800)
+ endif (MSVC)
+
+ boost_add_executable(quickbook
+ detail/quickbook.cpp
+ detail/actions.cpp
+ detail/actions_class.cpp
+ detail/utils.cpp
+ detail/post_process.cpp
+ detail/collector.cpp
+ detail/template_stack.cpp
+ DEPENDS boost_program_options boost_filesystem
+ )
+endif (BUILD_QUICKBOOK)
\ No newline at end of file

Added: branches/CMake/release/libs/quickbook/module.cmake
==============================================================================
--- (empty file)
+++ branches/CMake/release/libs/quickbook/module.cmake 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -0,0 +1 @@
+boost_module(Quickbook DEPENDS program_options filesystem system)
\ No newline at end of file

Modified: branches/CMake/release/libs/range/CMakeLists.txt
==============================================================================
--- branches/CMake/release/libs/range/CMakeLists.txt (original)
+++ branches/CMake/release/libs/range/CMakeLists.txt 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -1,4 +1,5 @@
 boost_library_project(
   Range
   TESTDIRS test
+ DOCDIRS doc
   )

Added: branches/CMake/release/libs/range/doc/CMakeLists.txt
==============================================================================
--- (empty file)
+++ branches/CMake/release/libs/range/doc/CMakeLists.txt 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -0,0 +1 @@
+boost_add_documentation(boost_range.qbk)
\ No newline at end of file

Modified: branches/CMake/release/tools/build/CMake/BoostCore.cmake
==============================================================================
--- branches/CMake/release/tools/build/CMake/BoostCore.cmake (original)
+++ branches/CMake/release/tools/build/CMake/BoostCore.cmake 2008-05-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -205,26 +205,26 @@
         ${ULIBNAME})
     endif (THIS_PROJECT_MODULAR)
 
- if(THIS_PROJECT_SRCDIRS)
- # Add an installation target for the sources of this library.
- set_property(GLOBAL APPEND
- PROPERTY CPACK_COMPONENTS_ALL
- ${ULIBNAME}_SOURCES)
- boost_set_cpack_variable(
- CPACK_COMPONENT_${ULIBNAME}_SOURCES_DISPLAY_NAME
- "Source files")
- boost_set_cpack_variable(
- CPACK_COMPONENT_${ULIBNAME}_SOURCES_GROUP
- ${ULIBNAME})
-
+ if(THIS_PROJECT_SRCDIRS)
+ # Add an installation target for the sources of this library.
+ set_property(GLOBAL APPEND
+ PROPERTY CPACK_COMPONENTS_ALL
+ ${ULIBNAME}_SOURCES)
+ boost_set_cpack_variable(
+ CPACK_COMPONENT_${ULIBNAME}_SOURCES_DISPLAY_NAME
+ "Source files")
+ boost_set_cpack_variable(
+ CPACK_COMPONENT_${ULIBNAME}_SOURCES_GROUP
+ ${ULIBNAME})
+
       # If this is a modular library, the sources depend on the headers
       if (THIS_PROJECT_MODULAR)
         boost_set_cpack_variable(
- CPACK_COMPONENT_${ULIBNAME}_SOURCES_DEPENDS
- ${ULIBNAME}_HEADERS)
+ CPACK_COMPONENT_${ULIBNAME}_SOURCES_DEPENDS
+ ${ULIBNAME}_HEADERS)
       endif ()
-
- # Add all of the source files as an installation target
+
+ # Add all of the source files as an installation target
       foreach(SUBDIR ${THIS_PROJECT_SRCDIRS})
         install(DIRECTORY ${SUBDIR}
           DESTINATION src/${LIBNAME}
@@ -232,7 +232,7 @@
           PATTERN "CVS" EXCLUDE
           REGEX ".svn" EXCLUDE)
       endforeach()
- endif()
+ endif()
         
     # For each of the modular libraries on which this project depends,
     # add the include path for that library.
@@ -294,6 +294,111 @@
   endif(${BOOST_BUILD_LIB_OPTION} AND THIS_PROJECT_OKAY)
 endmacro(boost_library_project)
 
+macro(boost_tool_project TOOLNAME)
+ parse_arguments(THIS_PROJECT
+ "DESCRIPTION;AUTHORS;MAINTAINERS"
+ ""
+ ${ARGN}
+ )
+
+ set(THIS_PROJECT_IS_TOOL TRUE)
+
+ string(TOUPPER ${TOOLNAME} UTOOLNAME)
+ set(THIS_PROJECT_OKAY ON)
+ set(THIS_PROJECT_FAILED_DEPS "")
+ foreach(DEP ${BOOST_${UTOOLNAME}_DEPENDS})
+ string(TOUPPER "BUILD_BOOST_${DEP}" BOOST_LIB_DEP)
+ if (NOT ${BOOST_LIB_DEP})
+ set(THIS_PROJECT_OKAY OFF)
+ set(THIS_PROJECT_FAILED_DEPS "${THIS_PROJECT_FAILED_DEPS} ${DEP}\n")
+ endif (NOT ${BOOST_LIB_DEP})
+ endforeach(DEP)
+
+ option(BUILD_${UTOOLNAME} "Build ${TOOLNAME}" ON)
+
+ if (NOT THIS_PROJECT_OKAY)
+ if (BUILD_${UTOOLNAME})
+ # The user explicitly turned on this tool in a prior
+ # iteration, but it can no longer be built because one of the
+ # dependencies was turned off. Force this option off and
+ # complain about it.
+ set(BUILD_${UTOOLNAME} OFF CACHE BOOL "Build ${TOOLNAME}" FORCE)
+ message(SEND_ERROR "Cannot build ${TOOLNAME} due to missing library dependencies:\n${THIS_PROJECT_FAILED_DEPS}")
+ endif ()
+ endif (NOT THIS_PROJECT_OKAY)
+
+ if(BUILD_${UTOOLNAME} AND THIS_PROJECT_OKAY)
+ string(TOLOWER "${TOOLNAME}" toolname)
+ project(${TOOLNAME})
+
+ # Add this tool to the list of library components to install
+ set_property(GLOBAL APPEND PROPERTY CPACK_COMPONENT_GROUPS_ALL
+ ${UTOOLNAME})
+ boost_set_cpack_variable(CPACK_COMPONENT_GROUP_${UTOOLNAME}_DISPLAY_NAME
+ ${TOOLNAME})
+
+ if (THIS_PROJECT_DESCRIPTION)
+ set(THIS_PROJECT_DESCRIPTION "${TOOLNAME}\n\n${THIS_PROJECT_DESCRIPTION}")
+
+ if (THIS_PROJECT_AUTHORS)
+ list(LENGTH THIS_PROJECT_AUTHORS THIS_PROJECT_NUM_AUTHORS)
+ if (THIS_PROJECT_NUM_AUTHORS EQUAL 1)
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n\nAuthor: ")
+ else()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n\nAuthors: ")
+ endif()
+ set(THIS_PROJECT_FIRST_AUTHOR TRUE)
+ foreach(AUTHOR ${THIS_PROJECT_AUTHORS})
+ string(REGEX REPLACE " *-at- *" "@" AUTHOR ${AUTHOR})
+ if (THIS_PROJECT_FIRST_AUTHOR)
+ set(THIS_PROJECT_FIRST_AUTHOR FALSE)
+ else()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n ")
+ endif()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}${AUTHOR}")
+ endforeach(AUTHOR)
+ endif (THIS_PROJECT_AUTHORS)
+
+ if (THIS_PROJECT_MAINTAINERS)
+ list(LENGTH THIS_PROJECT_MAINTAINERS THIS_PROJECT_NUM_MAINTAINERS)
+ if (THIS_PROJECT_NUM_MAINTAINERS EQUAL 1)
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\nMaintainer: ")
+ else()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\nMaintainers: ")
+ endif()
+ set(THIS_PROJECT_FIRST_MAINTAINER TRUE)
+ foreach(MAINTAINER ${THIS_PROJECT_MAINTAINERS})
+ string(REGEX REPLACE " *-at- *" "@" MAINTAINER ${MAINTAINER})
+ if (THIS_PROJECT_FIRST_MAINTAINER)
+ set(THIS_PROJECT_FIRST_MAINTAINER FALSE)
+ else()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}\n ")
+ endif()
+ set(THIS_PROJECT_DESCRIPTION "${THIS_PROJECT_DESCRIPTION}${MAINTAINER}")
+ endforeach(MAINTAINER)
+ endif (THIS_PROJECT_MAINTAINERS)
+
+ boost_set_cpack_variable(
+ CPACK_COMPONENT_GROUP_${UTOOLNAME}_DESCRIPTION
+ "${THIS_PROJECT_DESCRIPTION}")
+ endif (THIS_PROJECT_DESCRIPTION)
+
+ # Add this module's include directory
+ include_directories("${Boost_SOURCE_DIR}/libs/${toolname}/include")
+
+ # For each of the modular libraries on which this project depends,
+ # add the include path for that library.
+ foreach(DEP ${BOOST_${UTOOLNAME}_DEPENDS})
+ string(TOUPPER ${DEP} UDEP)
+ string(TOUPPER "BOOST_${DEP}_IS_MODULAR" BOOST_LIB_DEP_MODULAR)
+ if(BOOST_${UDEP}_IS_MODULAR)
+ include_directories("${Boost_SOURCE_DIR}/libs/${DEP}/include")
+ endif()
+ endforeach(DEP)
+ endif()
+endmacro(boost_tool_project)
+
+# TODO: Document me! (Here and on the Trac)
 macro(boost_module LIBNAME)
   parse_arguments(THIS_MODULE
     "DEPENDS"
@@ -1217,7 +1322,16 @@
     endforeach(LIB ${THIS_EXE_DEPENDS})
 
     # Build the executable
- set(THIS_EXE_NAME ${PROJECT_NAME}/${EXENAME})
+ # TODO: the use of ${PROJECT_NAME}/${EXENAME} is a bit strange.
+ # It's designed to keep the names of regression tests from one library
+ # separate from the regression tests of another library, but this can
+ # be handled better with OUTPUT_NAME. This would also allow us to eliminate
+ # the directory-creation logic in boost_library_project.
+ if (THIS_PROJECT_IS_TOOL)
+ set(THIS_EXE_NAME ${EXENAME})
+ else()
+ set(THIS_EXE_NAME ${PROJECT_NAME}/${EXENAME})
+ endif()
     add_executable(${THIS_EXE_NAME} ${THIS_EXE_SOURCES})
     
     # Set the various compilation and linking flags
@@ -1240,12 +1354,12 @@
     endif (THIS_EXE_DEBUG_AND_RELEASE)
 
     # If the user gave an output name, use it.
- if (THIS_EXE_OUTPUT_NAME)
+ if(THIS_EXE_OUTPUT_NAME)
       set_target_properties(${THIS_EXE_NAME}
         PROPERTIES
- OUTPUT_NAME "${THIS_EXE_OUTPUT_NAME}"
+ OUTPUT_NAME ${THIS_EXE_OUTPUT_NAME}
         )
- endif (THIS_EXE_OUTPUT_NAME)
+ endif()
 
     # Link against the various libraries
     if (THIS_EXE_DEBUG_AND_RELEASE)

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-26 15:30:26 EDT (Mon, 26 May 2008)
@@ -137,7 +137,20 @@
   # build the documentation.
   get_filename_component(THIS_DOC_EXT ${SOURCE} EXT)
   string(TOUPPER ${THIS_DOC_EXT} THIS_DOC_EXT)
- if (THIS_DOC_EXT STREQUAL ".XML")
+ if (THIS_DOC_EXT STREQUAL ".QBK")
+ # Transform Quickbook into BoostBook XML
+ # TODO: Check for BOOST_QUICKBOOK
+ get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE)
+ set(BOOSTBOOK_FILE ${SOURCE_FILENAME}.xml)
+ add_custom_command(OUTPUT ${BOOSTBOOK_FILE}
+ COMMAND quickbook "--output-file=${BOOSTBOOK_FILE}"
+ ${THIS_DOC_SOURCE_PATH}
+ DEPENDS ${THIS_DOC_SOURCE_PATH} ${THIS_DOPC_DEFAULT_ARGS}
+ COMMENT "Generating BoostBook documentation for Boost.${PROJECT_NAME}...")
+
+ # Transform BoostBook into other formats
+ boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${BOOSTBOOK_FILE})
+ elseif (THIS_DOC_EXT STREQUAL ".XML")
     # Transform BoostBook XML into DocBook XML
     get_filename_component(SOURCE_FILENAME ${SOURCE} NAME_WE)
     set(DOCBOOK_FILE ${SOURCE_FILENAME}.docbook)
@@ -146,7 +159,7 @@
       STYLESHEET ${BOOSTBOOK_XSL_DIR}/docbook.xsl
       CATALOG ${CMAKE_BINARY_DIR}/catalog.xml
       COMMENT "Generating DocBook documentation for Boost.${PROJECT_NAME}..."
- MAKE_TARGET docbook)
+ MAKE_TARGET ${PROJECT_NAME}-docbook)
 
     # Transform DocBook into other formats
     boost_add_documentation(${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_FILE})
@@ -163,7 +176,7 @@
                    navig.graphics.path=images
                    boost.image.src=boost.png
         COMMENT "Generating HTML documentation for Boost.${PROJECT_NAME}..."
- MAKE_ALL_TARGET html)
+ MAKE_ALL_TARGET ${PROJECT_NAME}-html)
 
       # Install generated documentation
       install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
@@ -181,7 +194,7 @@
         CATALOG ${CMAKE_BINARY_DIR}/catalog.xml
         DIRECTORY man.manifest
         COMMENT "Generating man pages for Boost.${PROJECT_NAME}..."
- MAKE_ALL_TARGET man)
+ MAKE_ALL_TARGET ${PROJECT_NAME}-man)
 
       # Install man pages
       install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man


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