Skip to content

Replace CMake generated version files with checked-in versions#1993

Merged
darbyjohnston merged 2 commits intoAcademySoftwareFoundation:mainfrom
darbyjohnston:source_version
Mar 20, 2026
Merged

Replace CMake generated version files with checked-in versions#1993
darbyjohnston merged 2 commits intoAcademySoftwareFoundation:mainfrom
darbyjohnston:source_version

Conversation

@darbyjohnston
Copy link
Contributor

In PR #1907 we added version headers so applications could identify which OpenTimelineIO they were using. However this also introduced a dependency on CMake to generate the headers, which can cause issues for other projects that use OTIO without CMake (for example the OTIO Swift bindings).

This PR replaces the CMake file generation with checked-in files, and instead has CMake parse the version from the checked-in header files. This is similar to what OpenEXR does for their version handling.

Copy link
Collaborator

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good, minor request

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.15%. Comparing base (f2b7693) to head (0bb458e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1993   +/-   ##
=======================================
  Coverage   85.15%   85.15%           
=======================================
  Files         181      181           
  Lines       12783    12783           
  Branches     1206     1206           
=======================================
  Hits        10885    10885           
  Misses       1715     1715           
  Partials      183      183           
Flag Coverage Δ
py-unittests 85.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2b7693...0bb458e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@meshula
Copy link
Collaborator

meshula commented Feb 24, 2026

Sorry, I don't know how I typed 4 #'s in a row. I'm still in favor of concatenation even with a helpy macro!

@darbyjohnston
Copy link
Contributor Author

Sorry, I don't know how I typed 4 #'s in a row. I'm still in favor of concatenation even with a helpy macro!

That requires updating every source file with the new macro. That seems like a lot of work to not duplicate a number, plus it also adds complexity which I think undermines the benefits of DRY.

jminor added a commit to jminor/OpenTimelineIO-Swift-Bindings that referenced this pull request Mar 1, 2026
@jminor
Copy link
Collaborator

jminor commented Mar 1, 2026

Trying this PR out on the Swift bindings here: OpenTimelineIO/OpenTimelineIO-Swift-Bindings#78

jminor added a commit to jminor/OpenTimelineIO-Swift-Bindings that referenced this pull request Mar 1, 2026
AcademySoftwareFoundation/OpenTimelineIO#1993
Signed-off-by: Joshua Minor <jminor@users.noreply.github.com>
@jminor
Copy link
Collaborator

jminor commented Mar 1, 2026

This seems to be working well for the Swift bindings.

Related: I noticed one typo in the README.md which says

namespace otio = opentimelineio::OPENTIMELINEIO_VERSION;

but I think it should be

namespace otio = opentimelineio::OPENTIMELINEIO_VERSION_NS;

@darbyjohnston
Copy link
Contributor Author

Good catch, I updated the example code to use our namespace macro OTIO_NS.

@jminor
Copy link
Collaborator

jminor commented Mar 2, 2026

Oh cool. I'll update the Swift bindings to use that macro too.

@meshula are you okay if we skip your suggestion about the ## macro concatenation?

Copy link
Collaborator

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fancy macros don't block merging, thanks for the PR!

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@darbyjohnston darbyjohnston added this to the 0.19.0 milestone Mar 20, 2026
@darbyjohnston darbyjohnston merged commit 2314a61 into AcademySoftwareFoundation:main Mar 20, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A request for something new.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants