Jamfile.v2 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. # Units documentation Jamfile
  2. #
  3. # Copyright (c) 2007-2008
  4. # Steven Watanabe
  5. #
  6. # Distributed under the Boost Software License, Version 1.0. (See
  7. # accompanying file LICENSE_1_0.txt or copy at
  8. # http://www.boost.org/LICENSE_1_0.txt
  9. import path ;
  10. import quickbook ;
  11. using boostbook ;
  12. using doxygen ;
  13. import print ;
  14. import regex ;
  15. import sequence ;
  16. path-constant here : . ;
  17. rule run_doxygen ( target : files * : name )
  18. {
  19. doxygen $(target)
  20. :
  21. $(files)
  22. :
  23. <doxygen:param>EXTRACT_ALL=YES
  24. <doxygen:param>EXPAND_ONLY_PREDEF=YES
  25. # Horribly ugly, but then macros usually are :(
  26. <doxygen:param>"PREDEFINED= \\
  27. \"BOOST_MPL_ASSERT(expr)=\" \\
  28. \"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\
  29. \"BOOST_UNITS_AUTO_STATIC_CONSTANT(a,b)=static const auto a = b\" \\
  30. \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\
  31. \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
  32. \"BOOST_UNITS_HAS_TYPEOF=1\" \\
  33. \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\
  34. namespace boost { namespace units { namespace namespace_ { \\
  35. struct name_ ## _base_unit : boost::units::base_unit<name_ ## _base_unit, other_unit::dimension_type, id> { \\
  36. static const char* name(); \\
  37. static const char* symbol(); \\
  38. }; \\
  39. } } }\" \\
  40. \"BOOST_UNITS_DOXYGEN=1\""
  41. <doxygen:param>HIDE_UNDOC_MEMBERS=NO
  42. <doxygen:param>EXTRACT_PRIVATE=NO
  43. <doxygen:param>ENABLE_PREPROCESSING=YES
  44. <doxygen:param>MACRO_EXPANSION=YES
  45. $(expand)
  46. <doxygen:param>SEARCH_INCLUDES=NO
  47. <reftitle>$(name)
  48. ;
  49. }
  50. run_doxygen units_reference
  51. :
  52. [ glob $(here)/../../../boost/units/*.hpp :
  53. $(here)/../../../boost/units/physical_dimensions.hpp ]
  54. :
  55. "Units Reference"
  56. ;
  57. run_doxygen si_reference
  58. :
  59. $(here)/../../../boost/units/systems/si.hpp
  60. [ path.glob-tree $(here)/../../../boost/units/systems/si : *.hpp : detail ]
  61. :
  62. "SI System Reference"
  63. ;
  64. run_doxygen cgs_reference
  65. :
  66. $(here)/../../../boost/units/systems/cgs.hpp
  67. [ path.glob-tree $(here)/../../../boost/units/systems/cgs : *.hpp : detail ]
  68. :
  69. "CGS System Reference"
  70. ;
  71. rule make_base_units_doc ( directory : name )
  72. {
  73. run_doxygen $(directory)_base_units_reference
  74. :
  75. [ path.glob-tree $(here)/../../../boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ]
  76. :
  77. "$(name) Base Units Reference"
  78. ;
  79. }
  80. make_base_units_doc angle : Angle ;
  81. make_base_units_doc astronomical : Astronomical ;
  82. make_base_units_doc cgs : CGS ;
  83. make_base_units_doc imperial : Imperial ;
  84. make_base_units_doc information : Information ;
  85. make_base_units_doc metric : Metric ;
  86. make_base_units_doc si : SI ;
  87. make_base_units_doc temperature : Temperature ;
  88. make_base_units_doc us : US ;
  89. all_base_units_doc = angle astronomical cgs imperial information metric si temperature us ;
  90. all_base_units_doc = $(all_base_units_doc)_base_units_reference ;
  91. run_doxygen dimensions_reference
  92. :
  93. $(here)/../../../boost/units/physical_dimensions.hpp
  94. [ path.glob-tree $(here)/../../../boost/units/physical_dimensions : *.hpp : detail ]
  95. :
  96. "Dimensions Reference"
  97. ;
  98. run_doxygen trig_reference
  99. :
  100. #../../../boost/units/systems/trig.hpp
  101. [ path.glob-tree $(here)/../../../boost/units/systems/angle : *.hpp : detail ]
  102. :
  103. "Trigonometry and Angle System Reference"
  104. ;
  105. run_doxygen temperature_reference
  106. :
  107. [ path.glob-tree $(here)/../../../boost/units/systems/temperature : *.hpp : detail ]
  108. :
  109. "Temperature System Reference"
  110. ;
  111. run_doxygen information_reference
  112. :
  113. $(here)/../../../boost/units/systems/information.hpp
  114. [ path.glob-tree $(here)/../../../boost/units/systems/information : *.hpp : detail prefixes.hpp ]
  115. :
  116. "Information System Reference"
  117. ;
  118. run_doxygen abstract_reference
  119. :
  120. $(here)/../../../boost/units/systems/abstract.hpp
  121. :
  122. "Abstract System Reference"
  123. ;
  124. rule less ( a b )
  125. {
  126. if [ path.basename $(a) ] < [ path.basename $(b) ]
  127. {
  128. return true ;
  129. }
  130. }
  131. rule generate-qbk ( target : sources * : properties * )
  132. {
  133. print.output $(target) ;
  134. local as-path = [ sequence.transform path.make : $(sources:G=) ] ;
  135. local known = ;
  136. local duplicated = ;
  137. for local file in $(as-path)
  138. {
  139. local base = [ path.basename $(file) ] ;
  140. if $(base) in $(known)
  141. {
  142. if ! $(base) in $(duplicated)
  143. {
  144. duplicated += $(base) ;
  145. }
  146. } else
  147. {
  148. known += $(base) ;
  149. }
  150. }
  151. for local file in [ sequence.insertion-sort $(as-path) : less ]
  152. {
  153. local output_filename = [ path.relative-to [ path.make $(here)/../../.. ] $(file) ] ;
  154. local base_filename = [ path.basename $(file) ] ;
  155. local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ;
  156. if $(base_filename) in $(duplicated)
  157. {
  158. # tack the directory name onto the end
  159. local dir-name = [ path.basename [ path.parent $(file) ] ] ;
  160. base_unit = "$(base_unit) ($(dir-name))" ;
  161. }
  162. print.text "[headerref $(output_filename) $(base_unit)][br]" : overwrite ;
  163. }
  164. }
  165. make base_units.qbk : [ path.glob-tree $(here)/../../../boost/units/base_units : *.hpp : detail conversions.hpp ] : @generate-qbk ;
  166. explicit base_units ;
  167. install base_units_install : base_units.qbk : <location>. ;
  168. xml units
  169. :
  170. units.qbk
  171. :
  172. <dependency>base_units_install
  173. <dependency>units_reference
  174. <dependency>si_reference
  175. <dependency>cgs_reference
  176. <dependency>$(all_base_units_doc)
  177. <dependency>dimensions_reference
  178. <dependency>trig_reference
  179. <dependency>temperature_reference
  180. <dependency>information_reference
  181. <dependency>abstract_reference
  182. ;
  183. boostbook standalone
  184. :
  185. units
  186. :
  187. <xsl:param>toc.max.depth=1
  188. <xsl:param>toc.section.depth=8
  189. <xsl:param>chunk.section.depth=8
  190. <xsl:param>boost.root="../../../.."
  191. <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
  192. ;
  193. ###############################################################################
  194. alias boostdoc
  195. : units
  196. :
  197. :
  198. : ;
  199. explicit boostdoc ;
  200. alias boostrelease ;
  201. explicit boostrelease ;