From 0bfaec71675d33512b6ad6a6a27407651ab34446 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 22 Jun 2025 16:15:12 -0500 Subject: [PATCH] xo-unit: dep fixes needed for submodule builds (in examples) --- xo-unit/CMakeLists.txt | 2 +- xo-unit/cmake/xo_unitConfig.cmake.in | 1 + xo-unit/docs/basis-unit-constants.rst | 12 ++++++------ xo-unit/docs/conf.py | 2 +- xo-unit/docs/install.rst | 6 +++--- xo-unit/example/ex1/CMakeLists.txt | 5 ++++- xo-unit/example/ex2/CMakeLists.txt | 5 ++++- xo-unit/example/ex3/CMakeLists.txt | 5 ++++- xo-unit/example/ex4/CMakeLists.txt | 5 ++++- xo-unit/example/ex5/CMakeLists.txt | 4 ++++ xo-unit/example/ex6/CMakeLists.txt | 5 ++++- xo-unit/example/ex7/CMakeLists.txt | 5 ++++- xo-unit/example/ex8/CMakeLists.txt | 5 ++++- xo-unit/example/ex_qty/CMakeLists.txt | 5 ++++- xo-unit/example/ex_su/CMakeLists.txt | 5 ++++- 15 files changed, 52 insertions(+), 20 deletions(-) diff --git a/xo-unit/CMakeLists.txt b/xo-unit/CMakeLists.txt index 50e70f0b..3b88ffcb 100644 --- a/xo-unit/CMakeLists.txt +++ b/xo-unit/CMakeLists.txt @@ -36,8 +36,8 @@ add_subdirectory(docs) # dependencies # 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_ratio) # etc.. # end CMakeLists.txt diff --git a/xo-unit/cmake/xo_unitConfig.cmake.in b/xo-unit/cmake/xo_unitConfig.cmake.in index 871a9b44..849efa07 100644 --- a/xo-unit/cmake/xo_unitConfig.cmake.in +++ b/xo-unit/cmake/xo_unitConfig.cmake.in @@ -2,6 +2,7 @@ include(CMakeFindDependencyMacro) +find_dependency(xo_flatstring) find_dependency(xo_ratio) find_dependency(indentlog) #find_dependency(printjson) diff --git a/xo-unit/docs/basis-unit-constants.rst b/xo-unit/docs/basis-unit-constants.rst index caa833f9..9d43dbfa 100644 --- a/xo-unit/docs/basis-unit-constants.rst +++ b/xo-unit/docs/basis-unit-constants.rst @@ -44,17 +44,17 @@ Those units are implemented on top of the basis units described here. using xo::qty::detail::bu; -Mass Units ----------- +Mass Basis Units +---------------- .. doxygengroup:: basis-unit-mass-units -Distance Units --------------- +Distance Basis Units +-------------------- .. doxygengroup:: basis-unit-distance-units -Time Units ----------- +Time Basis Units +---------------- .. doxygengroup:: basis-unit-time-units diff --git a/xo-unit/docs/conf.py b/xo-unit/docs/conf.py index 533aecf3..feab06c8 100644 --- a/xo-unit/docs/conf.py +++ b/xo-unit/docs/conf.py @@ -7,7 +7,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = 'xo unit documentation' -copyright = '2024, Roland Conybeare' +copyright = '2024,2025, Roland Conybeare' author = 'Roland Conybeare' # -- General configuration --------------------------------------------------- diff --git a/xo-unit/docs/install.rst b/xo-unit/docs/install.rst index 1bab499b..ce1a46e3 100644 --- a/xo-unit/docs/install.rst +++ b/xo-unit/docs/install.rst @@ -19,13 +19,13 @@ and (optionally) cmake macros ``xo-cmake``. These are on github: .. _xo-flatstring source: https://github.com/rconybea/xo-flatstring .. _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 - example programs - 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 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 ----------------- -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``) diff --git a/xo-unit/example/ex1/CMakeLists.txt b/xo-unit/example/ex1/CMakeLists.txt index fb1b6879..12b76ee0 100644 --- a/xo-unit/example/ex1/CMakeLists.txt +++ b/xo-unit/example/ex1/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex1.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex2/CMakeLists.txt b/xo-unit/example/ex2/CMakeLists.txt index 82406fe6..df9cbdb7 100644 --- a/xo-unit/example/ex2/CMakeLists.txt +++ b/xo-unit/example/ex2/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex2.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex3/CMakeLists.txt b/xo-unit/example/ex3/CMakeLists.txt index 06410943..be1ce8e0 100644 --- a/xo-unit/example/ex3/CMakeLists.txt +++ b/xo-unit/example/ex3/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex3.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex4/CMakeLists.txt b/xo-unit/example/ex4/CMakeLists.txt index cb1ce76b..dd14a7f8 100644 --- a/xo-unit/example/ex4/CMakeLists.txt +++ b/xo-unit/example/ex4/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex4.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex5/CMakeLists.txt b/xo-unit/example/ex5/CMakeLists.txt index 3d59c0ff..891c87ec 100644 --- a/xo-unit/example/ex5/CMakeLists.txt +++ b/xo-unit/example/ex5/CMakeLists.txt @@ -6,6 +6,10 @@ set(SELF_SRCS ex5.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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) endif() diff --git a/xo-unit/example/ex6/CMakeLists.txt b/xo-unit/example/ex6/CMakeLists.txt index bbb62dd1..210fdc97 100644 --- a/xo-unit/example/ex6/CMakeLists.txt +++ b/xo-unit/example/ex6/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex6.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex7/CMakeLists.txt b/xo-unit/example/ex7/CMakeLists.txt index a13bc9f7..541b1392 100644 --- a/xo-unit/example/ex7/CMakeLists.txt +++ b/xo-unit/example/ex7/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex7.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex8/CMakeLists.txt b/xo-unit/example/ex8/CMakeLists.txt index 42681a72..f050e644 100644 --- a/xo-unit/example/ex8/CMakeLists.txt +++ b/xo-unit/example/ex8/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex8.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex_qty/CMakeLists.txt b/xo-unit/example/ex_qty/CMakeLists.txt index 5da961a4..40d99478 100644 --- a/xo-unit/example/ex_qty/CMakeLists.txt +++ b/xo-unit/example/ex_qty/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex_qty.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt diff --git a/xo-unit/example/ex_su/CMakeLists.txt b/xo-unit/example/ex_su/CMakeLists.txt index bad7a1ff..751bca3e 100644 --- a/xo-unit/example/ex_su/CMakeLists.txt +++ b/xo-unit/example/ex_su/CMakeLists.txt @@ -6,7 +6,10 @@ set(SELF_SRCS ex_su.cpp) if (XO_ENABLE_EXAMPLES) xo_add_executable(${SELF_EXE} ${SELF_SRCS}) 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() # end CMakeLists.txt