xo-unit: dep fixes needed for submodule builds (in examples)

This commit is contained in:
Roland Conybeare 2025-06-22 16:15:12 -05:00
commit 0bfaec7167
15 changed files with 52 additions and 20 deletions

View file

@ -36,8 +36,8 @@ add_subdirectory(docs)
# dependencies # dependencies
# for some reason, this doesn't reliably bring in xo_flatstring dependency # for some reason, this doesn't reliably bring in xo_flatstring dependency
xo_headeronly_dependency(${SELF_LIB} xo_ratio)
xo_headeronly_dependency(${SELF_LIB} xo_flatstring) xo_headeronly_dependency(${SELF_LIB} xo_flatstring)
xo_headeronly_dependency(${SELF_LIB} xo_ratio)
# etc.. # etc..
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -2,6 +2,7 @@
include(CMakeFindDependencyMacro) include(CMakeFindDependencyMacro)
find_dependency(xo_flatstring)
find_dependency(xo_ratio) find_dependency(xo_ratio)
find_dependency(indentlog) find_dependency(indentlog)
#find_dependency(printjson) #find_dependency(printjson)

View file

@ -44,17 +44,17 @@ Those units are implemented on top of the basis units described here.
using xo::qty::detail::bu; using xo::qty::detail::bu;
Mass Units Mass Basis Units
---------- ----------------
.. doxygengroup:: basis-unit-mass-units .. doxygengroup:: basis-unit-mass-units
Distance Units Distance Basis Units
-------------- --------------------
.. doxygengroup:: basis-unit-distance-units .. doxygengroup:: basis-unit-distance-units
Time Units Time Basis Units
---------- ----------------
.. doxygengroup:: basis-unit-time-units .. doxygengroup:: basis-unit-time-units

View file

@ -7,7 +7,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'xo unit documentation' project = 'xo unit documentation'
copyright = '2024, Roland Conybeare' copyright = '2024,2025, Roland Conybeare'
author = 'Roland Conybeare' author = 'Roland Conybeare'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------

View file

@ -19,13 +19,13 @@ and (optionally) cmake macros ``xo-cmake``. These are on github:
.. _xo-flatstring source: https://github.com/rconybea/xo-flatstring .. _xo-flatstring source: https://github.com/rconybea/xo-flatstring
.. _xo-cmake source: https://github.com/rconybea/xo-cmake .. _xo-cmake source: https://github.com/rconybea/xo-cmake
`xo-cmake` is nccessary to invoke `xo` cmake build for: `xo-cmake` is necessary to invoke `xo` cmake build for:
- site install - site install
- example programs - example programs
- unit tests - unit tests
Can omit to instead copy `xo_unit`, `xo-ratio` and `xo-flatstring` source trees; Can omit to instead copy `xo-unit`, `xo-ratio` and `xo-flatstring` source trees;
see instructions below for including as git submodule see instructions below for including as git submodule
Implementation relies on some c++20 features (for example class-instances as template arguments). Implementation relies on some c++20 features (for example class-instances as template arguments).
@ -145,7 +145,7 @@ Directories under ``PREFIX`` will then contain:
Use CMake Support Use CMake Support
----------------- -----------------
To use built-in cmake suport: To use built-in cmake suport, when using ``xo-unit`` from another project:
Make sure ``PREFIX/lib/cmake`` is searched by cmake (if necessary, include it in ``CMAKE_PREFIX_PATH``) Make sure ``PREFIX/lib/cmake`` is searched by cmake (if necessary, include it in ``CMAKE_PREFIX_PATH``)

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex1.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex2.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex3.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex4.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,6 +6,10 @@ set(SELF_SRCS ex5.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
xo_dependency(${SELF_EXE} xo_flatstring) xo_dependency(${SELF_EXE} xo_flatstring)
endif() endif()

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex6.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex7.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex8.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex_qty.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt

View file

@ -6,7 +6,10 @@ set(SELF_SRCS ex_su.cpp)
if (XO_ENABLE_EXAMPLES) if (XO_ENABLE_EXAMPLES)
xo_add_executable(${SELF_EXE} ${SELF_SRCS}) xo_add_executable(${SELF_EXE} ${SELF_SRCS})
xo_self_headeronly_dependency(${SELF_EXE} xo_unit) xo_self_headeronly_dependency(${SELF_EXE} xo_unit)
xo_dependency(${SELF_EXE} xo_flatstring) xo_headeronly_dependency(${SELF_EXE} xo_ratio)
# bug -- headeronly dependencies not getting propagated, at least in submodule build
xo_headeronly_dependency(${SELF_EXE} xo_flatstring)
xo_headeronly_dependency(${SELF_EXE} indentlog)
endif() endif()
# end CMakeLists.txt # end CMakeLists.txt