diff --git a/cmake/common/documentation.cmake b/cmake/common/documentation.cmake new file mode 100644 index 00000000..9c80df01 --- /dev/null +++ b/cmake/common/documentation.cmake @@ -0,0 +1,126 @@ +# The MIT License (MIT) +# +# Copyright (c) 2018 Mateusz Pusz +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +cmake_minimum_required(VERSION 3.12) + +find_package(Doxygen REQUIRED) +find_package(Sphinx REQUIRED) + +# +# add_documentation(TargetName [ALL] +# BREATHE_PROJECT projectName +# [DOXYFILE_TEMPLATE Doxyfile.in] +# [CODE_SOURCE_DIR dir] +# [DOCS_SOURCE_DIR dir] +# [INSTALL_DIR dir] +# CODE_DEPENDS codeDeps... +# DOC_DEPENDS docDeps...) +# +function(add_documentation targetName) + set(_options ALL) + set(_one_value_args BREATHE_PROJECT DOXYFILE_TEMPLATE CODE_SOURCE_DIR DOCS_SOURCE_DIR INSTALL_DIR) + set(_multi_value_args CODE_DEPENDS DOCS_DEPENDS) + cmake_parse_arguments(_args "${_options}" "${_one_value_args}" "${_multi_value_args}" ${ARGN}) + + if(NOT _args_BREATHE_PROJECT) + message(FATAL_ERROR "BREATHE_PROJECT not provided") + endif() + + # Validate arguments + if(NOT _args_DOXYFILE_TEMPLATE) + set(_args_DOXYFILE_TEMPLATE Doxyfile.in) + endif() + file(REAL_PATH ${_args_DOXYFILE_TEMPLATE} _doxyfileIn) + if(NOT EXISTS ${_doxyfileIn}) + message(FATAL_ERROR "'${_args_DOXYFILE_TEMPLATE}' does not exist") + endif() + + if(_args_DOCS_SOURCE_DIR) + if(NOT EXISTS ${_args_DOCS_SOURCE_DIR}) + message(FATAL_ERROR "'${_args_DOCS_SOURCE_DIR}' does not exist") + endif() + else() + set(_args_DOCS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + endif() + + # Validate CODE_SOURCE_DIR and set input for the configuration file + if(_args_CODE_SOURCE_DIR) + if(NOT EXISTS ${_args_CODE_SOURCE_DIR}) + message(FATAL_ERROR "'${_args_CODE_SOURCE_DIR}' does not exist") + endif() + set(DOXYGEN_INPUT_DIR "${_args_CODE_SOURCE_DIR}") + else() + set(DOXYGEN_INPUT_DIR "${PROJECT_SOURCE_DIR}") + endif() + set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen") + + # Replace variables inside @@ with the current values + set(_doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") + configure_file("${_doxyfileIn}" "${_doxyfile}" @ONLY) + + set(_doxygenIndexFile "${DOXYGEN_OUTPUT_DIR}/xml/index.xml") + + # Only regenerate Doxygen when the Doxyfile or given dependencies change + add_custom_command(OUTPUT "${_doxygenIndexFile}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIR} + COMMAND Doxygen::doxygen ARGS "${_doxyfile}" + MAIN_DEPENDENCY "${_doxyfileIn}" + DEPENDS + "${_doxyfile}" + "${_args_CODE_DEPENDS}" + COMMENT "Generating doxygen XML metadata" + USES_TERMINAL + VERBATIM + ) + + set(_sphinx_docs_dir "${CMAKE_CURRENT_BINARY_DIR}/sphinx") + set(_sphinx_index_file "${_sphinx_docs_dir}/index.html") + + # Only regenerate Sphinx when: + # - Doxygen has rerun + # - Our doc files have been updated + # - The Sphinx config has been updated + add_custom_command(OUTPUT "${_sphinx_index_file}" + COMMAND "${SPHINX_EXECUTABLE}" ARGS -b html -j auto "-Dbreathe_projects.${_args_BREATHE_PROJECT}=${DOXYGEN_OUTPUT_DIR}/xml" "${_args_DOCS_SOURCE_DIR}" "${_sphinx_docs_dir}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + MAIN_DEPENDENCY "${_args_DOCS_SOURCE_DIR}/conf.py" + DEPENDS + "${_doxygenIndexFile}" + "${_args_DOCS_DEPENDS}" + COMMENT "Generating documentation with Sphinx" + USES_TERMINAL + VERBATIM + ) + + # Custom target + if(_args_ALL) + set(_all ALL) + endif() + add_custom_target(${targetName} ${_all} DEPENDS "${_sphinx_index_file}") + + if(_args_INSTALL_DIR) + # Add an install step to install the docs + install(DIRECTORY ${_sphinx_docs_dir} + DESTINATION ${CMAKE_INSTALL_DOCDIR} + ) + endif() +endfunction() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 8ee1ae3b..c9e58813 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -22,251 +22,214 @@ cmake_minimum_required(VERSION 3.12) -option(BUILD_DOCS "Generate project documenation" ON) +option(BUILD_DOCS "Generate project documentation" ON) if(NOT BUILD_DOCS) return() endif() -find_package(Doxygen REQUIRED) -find_package(Sphinx REQUIRED) - -set(DOXYGEN_INPUT_DIR "${PROJECT_SOURCE_DIR}/src") -set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen") -set(DOXYGEN_INDEX_FILE "${DOXYGEN_OUTPUT_DIR}/xml/index.xml") -set(DOXYFILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in") -set(DOXYFILE_OUT "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") - # Find all the public headers -file(GLOB_RECURSE UNITS_PUBLIC_HEADERS ${DOXYGEN_INPUT_DIR}/*.h) +file(GLOB_RECURSE unitsPublicHeaders "${PROJECT_SOURCE_DIR}/src/*.h") -# Replace variables inside @@ with the current values -configure_file("${DOXYFILE_IN}" "${DOXYFILE_OUT}" @ONLY) +# Sphinx documentation dependencies +set(unitsSphinxDocs + "${CMAKE_CURRENT_SOURCE_DIR}/_static/css/custom.css" + "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/concepts.png" + "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/downcast_1.png" + "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/downcast_2.png" + "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/units.png" -# Doxygen won't create this for us -file(MAKE_DIRECTORY "${DOXYGEN_OUTPUT_DIR}") + "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md" -# Only regenerate Doxygen when the Doxyfile or public headers change -add_custom_command(OUTPUT "${DOXYGEN_INDEX_FILE}" - DEPENDS ${UNITS_PUBLIC_HEADERS} - COMMAND "${DOXYGEN_EXECUTABLE}" "${DOXYFILE_OUT}" - MAIN_DEPENDENCY "${DOXYFILE_OUT}" "${DOXYFILE_IN}" - COMMENT "Generating doxygen XML metadata" - VERBATIM) + "${CMAKE_CURRENT_SOURCE_DIR}/design.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/design/directories.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/design/downcasting.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/design/quantity.rst" -# Nice named target so we can run the job easily -add_custom_target(doxygen ALL DEPENDS "${DOXYGEN_INDEX_FILE}") + "${CMAKE_CURRENT_SOURCE_DIR}/examples.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/avg_speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/box_example.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/conversion_factor.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_systems.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/foot_pound_second.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/glide_computer.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/hello_units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter-alpha_beta_filter_example2.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/linear_algebra.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/measurement.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/total_energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/examples/unknown_dimension.rst" -set(SPHINX_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}") -set(SPHINX_BUILD "${CMAKE_CURRENT_BINARY_DIR}/sphinx") -set(SPHINX_INDEX_FILE "${SPHINX_BUILD}/index.html") + "${CMAKE_CURRENT_SOURCE_DIR}/faq.rst" -# Only regenerate Sphinx when: -# - Doxygen has rerun -# - Our doc files have been updated -# - The Sphinx config has been updated -add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}" - COMMAND - "${SPHINX_EXECUTABLE}" -b html -j auto "-Dbreathe_projects.mp-units=${DOXYGEN_OUTPUT_DIR}/xml" "${SPHINX_SOURCE}" "${SPHINX_BUILD}" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/_static/css/custom.css" - "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/concepts.png" - "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/downcast_1.png" - "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/downcast_2.png" - "${CMAKE_CURRENT_SOURCE_DIR}/_static/img/units.png" + "${CMAKE_CURRENT_SOURCE_DIR}/framework.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/basic_concepts.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/constants.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/conversions_and_casting.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/dimensions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/quantities.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/quantity_points.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/text_output.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/framework/units.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md" + "${CMAKE_CURRENT_SOURCE_DIR}/genindex.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/glossary.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/index.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/introduction.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/quick_start.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/design.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/design/directories.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/design/downcasting.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/design/quantity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/concepts.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/customization_points.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/downcasting.rst" +# "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/functions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/metafunctions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/dimensions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/prefixes.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/quantity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/quantity_point.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/basic_fixed_string.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/basic_symbol_text.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/ratio.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/avg_speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/box_example.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/capacitor_time_curve.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/clcpp_response.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/conversion_factor.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/custom_systems.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/foot_pound_second.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/glide_computer.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/hello_units.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/kalman_filter-alpha_beta_filter_example2.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/linear_algebra.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/measurement.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/total_energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/examples/unknown_dimension.rst" - - "${CMAKE_CURRENT_SOURCE_DIR}/faq.rst" +# "${CMAKE_CURRENT_SOURCE_DIR}/reference/math.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/random.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/basic_concepts.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/constants.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/conversions_and_casting.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/dimensions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/quantities.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/quantity_points.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/text_output.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/framework/units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/genindex.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/glossary.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/index.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/introduction.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/quick_start.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/bitrate.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/information.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/prefixes.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/concepts.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/customization_points.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/downcasting.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/functions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/metafunctions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/dimensions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/prefixes.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/quantity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/quantity_point.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/units.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/basic_fixed_string.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/basic_symbol_text.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/core/types/utilities/ratio.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/angle.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/dimensionless.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/unknown.rst" - # "${CMAKE_CURRENT_SOURCE_DIR}/reference/math.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/random.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/constants.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/dimensions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/units.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/bitrate.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/information.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/data/prefixes.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_cgs.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/acceleration.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/area.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/force.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/mass.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/power.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/pressure.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/time.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/angle.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/dimensionless.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/generic/unknown.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_fps.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/acceleration.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/area.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/density.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/force.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/mass.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/power.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/pressure.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/time.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/volume.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/constants.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/dimensions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_iau.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_cgs.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/acceleration.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/area.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/force.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/mass.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/power.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/pressure.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/time.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_imperial.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_international.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/area.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/volume.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_fps.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/acceleration.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/area.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/density.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/force.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/mass.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/power.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/pressure.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/time.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/volume.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/absorbed_dose.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/acceleration.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/amount_of_substance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/area.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/capacitance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/catalytic_activity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/charge_density.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/concentration.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/conductance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/constants.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/current_density.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/density.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/dynamic_viscosity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_charge.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_current.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_field_strength.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/force.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/frequency.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/heat_capacity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/inductance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/luminance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/luminous_intensity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/magnetic_flux.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/magnetic_induction.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/mass.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/molar_energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/momentum.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/permeability.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/permittivity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/power.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/prefixes.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/pressure.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/resistance.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/surface_tension.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/thermal_conductivity.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/thermodynamic_temperature.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/time.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/voltage.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/volume.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_iau.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_typographic.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_imperial.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_us.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_international.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/area.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/volume.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/references.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/absorbed_dose.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/acceleration.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/amount_of_substance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/area.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/capacitance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/catalytic_activity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/charge_density.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/concentration.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/conductance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/constants.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/current_density.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/density.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/dynamic_viscosity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_charge.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_current.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/electric_field_strength.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/force.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/frequency.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/heat_capacity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/inductance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/length.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/luminance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/luminous_intensity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/magnetic_flux.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/magnetic_induction.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/mass.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/molar_energy.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/momentum.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/permeability.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/permittivity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/power.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/prefixes.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/pressure.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/resistance.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/speed.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/surface_tension.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/thermal_conductivity.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/thermodynamic_temperature.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/time.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/voltage.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/volume.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/custom_representation_types.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/extensions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/legacy_interfaces.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/linear_algebra.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/natural_units.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/unknown_dimensions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_typographic.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic/length.rst" - - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si_us.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us/length.rst" - - "${CMAKE_CURRENT_SOURCE_DIR}/references.rst" - - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/custom_representation_types.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/extensions.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/legacy_interfaces.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/linear_algebra.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/natural_units.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/use_cases/unknown_dimensions.rst" - - "${CMAKE_CURRENT_SOURCE_DIR}/usage.rst" - "${DOXYGEN_INDEX_FILE}" - MAIN_DEPENDENCY "${SPHINX_SOURCE}/conf.py" - COMMENT "Generating documentation with Sphinx") - -# Nice named target so we can run the job easily -add_custom_target(sphinx ALL DEPENDS ${SPHINX_INDEX_FILE}) - -# Add an install target to install the docs -include(GNUInstallDirs) -install(DIRECTORY ${SPHINX_BUILD} - DESTINATION ${CMAKE_INSTALL_DOCDIR} + "${CMAKE_CURRENT_SOURCE_DIR}/usage.rst" +) + +include(documentation) +include(GNUInstallDirs) + +add_documentation(documentation ALL + BREATHE_PROJECT mp-units + CODE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src" + INSTALL_DIR ${CMAKE_INSTALL_DOCDIR} + CODE_DEPENDS ${unitsPublicHeaders} + DOCS_DEPENDS ${unitsSphinxDocs} )