Skip to content

Share the CMake infrastructure through cmake/, and pin ost 0.23.6 - #27

Merged
snkmcb merged 7 commits into
mainfrom
chore/cmake-cleanup
Sep 24, 2026
Merged

snkmcb merged 7 commits into
mainfrom
chore/cmake-cleanup

Conversation

@snkmcb

@snkmcb snkmcb commented Sep 24, 2026

Copy link
Copy Markdown
Member

Summary

Phases 1–5 and 7 of the CMake cleanup. The goal is separation, not shorter files: the root orchestrates, cmake/ holds the shared build infrastructure, and each component's CMakeLists.txt declares what it builds, links (PUBLIC/PRIVATE), installs and tests. Package identities, standalone builds and the OpenUSD 26.08 pin stay as they were.

Phase Commit What
1 6c3ff9c UsdMotionProject.cmake: every project reads VERSION through usdmotion_read_version(); the eleven hard-coded "0.5.1" fallbacks are gone, and check_docs.py fails a project that restates a number
2 1e9a923 usdmotion_require_openusd() resolves OpenUSD and aliases its libraries as usdmotion::pxr::<name>, so no component branches on gf vs pxr::gf. The OpenExec probe stays execMotion's alone
3 f44c095 usdmotion_require_dependency(<pkg>) (the in-tree target or find_package), and usdmotion_target_utf8(<tgt> PUBLIC|PRIVATE), where the scope stays the caller's to state
4 8645993 usdmotion_install_library() / usdmotion_install_tool() replace the install/export boilerplate
5 64219d1 UsdMotionTesting.cmake: the test interpreter, the Windows OpenUSD PATH, the OpenUSD root, /UNDEBUG
7 5ab29a7 Leftover duplication trimmed; WORKSPACE.md §4, DEPENDENCIES.md §2 and the CHANGELOG describe the layout
— 4bef3e0 ost pinned to 0.23.6 (rendered CI, release lane, docs)

One deliberate departure from the cleanup plan: project() stays a literal call in each CMakeLists.txt, with the helper called right after it. CMake requires that literal call in the top-level file, and a component is the top-level file whenever ost builds it standalone.

Phase 6 is not here. Moving execMotion's lib/ + plugInfo.json and the CLIs' bin/ out of the source tree comes in a follow-up PR. The 0.23.6 pin in this branch is the precondition: 0.23.5 added target-local stages, and 0.23.6 packages a workspace bundle from them. Until that PR, a bundle without install rules keeps its source-tree outputs, so the repin changes no behaviour.

What a consumer can see

Every installed file is byte-identical except three, all on purpose:

  • motionSource and motionBvh now write SameMinorVersion version files, like the other five libraries. The five switched when they joined the workspace; these two came later from usd-vrm-plugins and missed it. The rule is now in DEPENDENCIES.md §2.
  • motionBvhConfig.cmake checked for openstrata::motion::motionSource before find_dependency(motionSource). That is a C++ namespace, not a target, so the check never held; it now checks motionSource::motionSource.

Other fixes:

  • execMotion's boundary test read USDVRM_TEST_PYTHON, a variable name carried over from usd-vrm-plugins that nothing in this repo sets. It now uses USDMOTION_TEST_PYTHON.
  • The two boundary checks that parse link lines now understand the alias spelling. motionCore's check had been matching usd inside usdmotion; execMotion's check has new self-test cases for all three spellings.

Type of change

  • Bug fix
  • Feature or behavior change
  • Documentation or test change
  • Build or maintenance change

Validation

Windows. ost lanes ran on 0.23.5 for Phases 1–7 and on the published 0.23.6 CLI (checksum-verified) after the repin:

  • After every phase: ost build + ost test, 53/53 (installed consumer included). The ctest definitions (commands, environments, labels) were compared with main and matched, apart from the alias names handed to execMotion_boundaries. The installed tree matched main apart from the three files above.
  • Plain CMake with the Visual Studio generator (no ost), root: 53/53.
  • All eleven members configured, built and tested standalone against an installed prefix: all pass. This run caught a regression from Phase 2 that the workspace build cannot show, because there the root creates the OpenUSD aliases. motionBvh's one OpenUSD-reaching test now requires OpenUSD itself.
  • ost plugin test --workspace --graph-only; ost library build/test (motionCore, motionRecording, motionUsd, motionBvh); ost plugin build/test/package plugins/execMotion and --from-package; ost plugin package --workspace (one bundle, three tools).
  • check_docs.py and its self-test; test_check_boundaries.py.

Linux and macOS are this PR's CI.

Checklist

  • The change is focused and ready for review.
  • I added or updated tests when behavior changed.
  • I updated the owning documentation when a public fact or capability changed.
  • I did not add a motion capture, clip, avatar model or screenshot without redistribution permission.
  • This pull request does not contain a security report.

🤖 Generated with Claude Code

snkmcb and others added 7 commits September 24, 2026 02:52
Phase 1 of the CMake cleanup. cmake/UsdMotionProject.cmake reads the
repository-root VERSION for the root and every component, and applies the
project policy (C++20, Release for a single-config generator) and each
component's tests option after its project() call.

The eleven hard-coded "0.5.1" fallbacks are gone: a standalone configure
reaches VERSION the same way it reaches the module, so there was never a
build that used them, only a number to drift. check_docs.py now fails a
component that restates a version instead of checking that it mirrors one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 2 of the CMake cleanup. usdmotion_require_openusd() replaces the
find_package(pxr) + include pair every member repeated: it resolves
OpenUSD unless the root already has, enforces the 26.08 pin as before, and
aliases each library the repository names as usdmotion::pxr::<name>,
whichever of `gf` or `pxr::gf` the install exports.

The eight `if(TARGET gf) ... elseif(TARGET pxr::gf)` blocks and foreach
lookups are gone from libraries, tools, tests and the bundle; they link
the alias. The OpenExec probe checks the alias too, so it no longer
assumes bare names. Exported packages are unchanged -- CMake records the
imported name an alias resolves to, and the installed tree is identical
file for file.

The two boundary checks that read link names learn the alias: motionCore's
now reads its link line as names (it matched "usd" inside "usdmotion"), and
execMotion's accepts the usdmotion::pxr:: spelling, with self-test cases
for all three spellings and a refused library under each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 3 of the CMake cleanup. cmake/UsdMotionTargets.cmake adds:

  * usdmotion_require_dependency(<package>) -- the in-tree target when the
    root has built it, find_package() otherwise. It replaces nineteen
    `if(NOT TARGET x::x) find_package(x)` blocks and keeps each dependency
    on its own line, so the bundle's per-edge comments stay where they are.
  * usdmotion_target_utf8(<target> <PUBLIC|PRIVATE>) -- the scope is still
    the caller's, because it means something: a library whose installed
    headers carry UTF-8 passes PUBLIC, as before, and the exported
    packages are unchanged file for file.

UsdMotionUtf8CodePage.cmake is now reached through UsdMotionProject.cmake
like the rest, so a tool includes one module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 4 of the CMake cleanup. cmake/UsdMotionInstall.cmake adds
usdmotion_install_library(TARGET PACKAGE [COMPATIBILITY]) and
usdmotion_install_tool(), replacing the thirty-line install/export block
each library repeated and the two-line one each tool did. The package
identity is unchanged: <P>::<P>, config under <libdir>/cmake/<P>.

Two installed files change, and both on purpose:

  * motionSource and motionBvh now write SameMinorVersion like the other
    five. The others switched when they joined the workspace, so a 0.x
    consumer is never handed the next minor; these two arrived later from
    usd-vrm-plugins and kept SameMajorVersion. The helper defaults to
    SameMinorVersion, and DEPENDENCIES.md §2 now states the rule.
  * motionBvhConfig.cmake guarded find_dependency(motionSource) on
    `openstrata::motion::motionSource`, a C++ namespace rather than a
    target, so the guard never held. It names motionSource::motionSource.

Every other installed file is identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 5 of the CMake cleanup. cmake/UsdMotionTesting.cmake holds how a
suite runs, never what it checks:

  * usdmotion_find_test_python() -- the root's and every member's
    USDMOTION_TEST_PYTHON lookup, with the pxrConfig.cmake reason stated
    once. A macro, so the find's variables stay where they were.
  * usdmotion_openusd_root() -- the runtime root four test directories
    derived from pxr_DIR by hand.
  * usdmotion_test_windows_path() -- the PATH a plain-CMake ctest needs on
    Windows for OpenUSD's DLLs, which six library test directories wrote
    out in full.
  * usdmotion_keep_assertions() -- /UNDEBUG for test targets, with its
    reason once rather than seven times.

Every registered test keeps its command, environment and labels: the
ctest definitions of the workspace build are identical before and after.

execMotion's boundary test looked for USDVRM_TEST_PYTHON, a name carried
over from usd-vrm-plugins that nothing here sets, and fell back to its
own find. It now uses USDMOTION_TEST_PYTHON like every other member.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 7 of the CMake cleanup. What is left in a component's CMakeLists.txt
is what it builds, links, defines, installs and tests: comments the shared
modules now carry are dropped, and each tool links its workspace
libraries and OpenUSD in one call.

motionBvh's recorded-conversion test requires OpenUSD itself. The library
deliberately never does, so a standalone configure had no
usdmotion::pxr::gf alias for the test's Windows PATH and failed to
generate -- a regression from the target aliasing that the workspace
build could not show, because there the root creates the aliases. Found
by building every member standalone against an installed prefix.

WORKSPACE.md §4 names the modules and what stays in a component;
CHANGELOG.md records the change; docs-check runs when any cmake/ module
changes, since check_docs.py reads the pin module and every project.

Verified on Windows: ost build + ost test (53/53); plain CMake root with
the Visual Studio generator (53/53, installed consumer included); all
eleven members configured, built and tested standalone against an
installed prefix; ost library build/test motionBvh; ost plugin
build/test/package execMotion and its package-origin test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.23.5 stages a bundle that has install rules, and a root-built tool, per
target instead of reading it from the member's source tree (usd-mmd-plugins'
ost report 01); 0.23.6 packages a workspace bundle from that same stage
(usd-vrm-plugins' ost report 47). Together they are what moving
execMotion's lib/ and plugInfo.json and the CLIs' bin/ out of the source
tree needs -- the one phase of the CMake cleanup not in this branch. Until
that move, a bundle without install rules keeps its source-tree outputs,
so nothing here behaves differently.

The re-render changes nothing but the version; release.yml mirrors the pin
by hand, and check_docs.py holds the two to each other.

Verified with the published 0.23.6 Windows CLI (checksum-verified): graph
gate, ost build + ost test (53/53), ost plugin build/test/package
execMotion and its package-origin test, and ost plugin package --workspace
(one bundle, three tools).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snkmcb
snkmcb merged commit 187d5cf into main Sep 24, 2026
6 checks passed
@snkmcb
snkmcb deleted the chore/cmake-cleanup branch September 24, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant