# Units documentation Jamfile # # Copyright (c) 2007-2008 # Steven Watanabe # # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt import path ; import quickbook ; using boostbook ; using doxygen ; import print ; import regex ; import sequence ; path-constant here : . ; rule run_doxygen ( target : files * : name ) { doxygen $(target) : $(files) : EXTRACT_ALL=YES EXPAND_ONLY_PREDEF=YES # Horribly ugly, but then macros usually are :( "PREDEFINED= \\ \"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\ \"BOOST_UNITS_AUTO_STATIC_CONSTANT(a,b)=static const auto a = b\" \\ \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\ \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\ \"BOOST_UNITS_HAS_TYPEOF=1\" \\ \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\ namespace boost { namespace units { namespace namespace_ { \\ struct name_ ## _base_unit : boost::units::base_unit { \\ static const char* name(); \\ static const char* symbol(); \\ }; \\ } } }\" \\ \"BOOST_UNITS_DOXYGEN=1\"" HIDE_UNDOC_MEMBERS=NO EXTRACT_PRIVATE=NO ENABLE_PREPROCESSING=YES MACRO_EXPANSION=YES $(expand) SEARCH_INCLUDES=NO $(name) ; } run_doxygen units_reference : [ glob $(here)/../../../boost/units/*.hpp ] : "Units Reference" ; run_doxygen si_reference : $(here)/../../../boost/units/systems/si.hpp [ path.glob-tree $(here)/../../../boost/units/systems/si : *.hpp : detail ] : "SI System Reference" ; run_doxygen cgs_reference : $(here)/../../../boost/units/systems/cgs.hpp [ path.glob-tree $(here)/../../../boost/units/systems/cgs : *.hpp : detail ] : "CGS System Reference" ; rule make_base_units_doc ( directory : name ) { run_doxygen $(directory)_base_units_reference : [ path.glob-tree $(here)/../../../boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ] : "$(name) Base Units Reference" ; } make_base_units_doc angle : Angle ; make_base_units_doc astronomical : Astronomical ; make_base_units_doc cgs : CGS ; make_base_units_doc imperial : Imperial ; make_base_units_doc metric : Metric ; make_base_units_doc si : SI ; make_base_units_doc temperature : Temperature ; make_base_units_doc us : US ; all_base_units_doc = angle astronomical cgs imperial metric si temperature us ; all_base_units_doc = $(all_base_units_doc)_base_units_reference ; run_doxygen dimensions_reference : $(here)/../../../boost/units/physical_dimensions.hpp [ path.glob-tree $(here)/../../../boost/units/physical_dimensions : *.hpp : detail ] : "Dimensions Reference" ; run_doxygen trig_reference : #../../../boost/units/systems/trig.hpp [ path.glob-tree $(here)/../../../boost/units/systems/angle : *.hpp : detail ] : "Trigonometry and Angle System Reference" ; run_doxygen temperature_reference : [ path.glob-tree $(here)/../../../boost/units/systems/temperature : *.hpp : detail ] : "Temperature System Reference" ; run_doxygen abstract_reference : $(here)/../../../boost/units/systems/abstract.hpp : "Abstract System Reference" ; rule less ( a b ) { if [ path.basename $(a) ] < [ path.basename $(b) ] { return true ; } } rule generate-qbk ( target : sources * : properties * ) { print.output $(target) ; local as-path = [ sequence.transform path.make : $(sources:G=) ] ; local known = ; local duplicated = ; for local file in $(as-path) { local base = [ path.basename $(file) ] ; if $(base) in $(known) { if ! $(base) in $(duplicated) { duplicated += $(base) ; } } else { known += $(base) ; } } for local file in [ sequence.insertion-sort $(as-path) : less ] { local output_filename = [ path.relative-to [ path.make $(here)/../../.. ] $(file) ] ; local base_filename = [ path.basename $(file) ] ; local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ; if $(base_filename) in $(duplicated) { # tack the directory name onto the end local dir-name = [ path.basename [ path.parent $(file) ] ] ; base_unit = "$(base_unit) ($(dir-name))" ; } # this looks better, but it won't work until my boostbook patch for # annotation.xsl gets applied. # print.text "[headerref $(output_filename) $(base_unit)]\\n" : overwrite ; print.text "[headerref $(output_filename)]\\n" : overwrite ; } } make base_units.qbk : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ; explicit base_units ; install base_units_install : base_units.qbk : . ; xml units : units.qbk : base_units_install units_reference si_reference cgs_reference $(all_base_units_doc) dimensions_reference trig_reference temperature_reference abstract_reference ; path-constant images_location : ../../../doc/html ; boostbook standalone : units : toc.max.depth=1 toc.section.depth=8 chunk.section.depth=8 boost.root="../../../.." html.stylesheet=../../../../doc/html/boostbook.css # PDF Options: # TOC generation: uses XEP extensions at present, change to fop1 to use Apache FOP. pdf:xep.extensions=1 pdf:fop.extensions=0 pdf:fop1.extensions=0 # No indent on body text: pdf:body.start.indent=0pt # Margin size: pdf:page.margin.inner=0.5in # Margin size: pdf:page.margin.outer=0.5in # Paper type = A4 pdf:paper.type=A4 # Yes, we want graphics for admonishments: admon.graphics=1 # Set this one for PDF generation *only*: # default pnd graphics are awful in PDF form, # better use SVG's instead: pdf:admon.graphics.extension=".svg" pdf:img.src.path=$(images_location)/ pdf:admon.graphics.path=../../../doc/src/images pdf:draft.mode="no" ;