Use DEFAULT_VERSION in get_git_version()#74
Conversation
When building from a source tarball (no .git directory), the version cannot be determined from git tags. Pass DEFAULT_VERSION so that the version can be set via -DPROJECT_VERSION on the CMake command line. The get_git_version() function already supports this parameter; this change simply makes use of it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CMakeLists.txt build configuration now passes ChangesVersion initialization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Sounds good, thank you. Do you need a tag with this? |
|
No tag needed, I'll drop my patch when the next release is tagged. |
When creating a conda package for FairLogger (as part of investigating moving SHiP software to conda), I noticed that correct versioning relied on being in a git repository of FairLogger. For conda, it is conventional to build from a source tarball.
This PR upstreams a patch I made for conda that allows setting the version via
-DPROJECT_VERSIONas default. When in a git repo, PROJECT_VERSION will then be overridden by the information gotten from git. This makes use of the existingDEFAULT_VERSIONfunctionality ofget_git_version.