New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Auto-fill version details in rev.cpp and ottres.rc #9066
Conversation
Why not use the "builtin" variables - CPACK_PACKAGE_VERSION_MAJOR/MINOR/PATCH ? (Which then get combined into CPACK_PACKAGE_VERSION) |
CPACK stuff is for the installer only, not the build itself, and cpack relies on whatever FindVersion.cmake detected. Also FindVersion.cmake generates the files before CPACK variables are set. |
cmake/scripts/FindVersion.cmake
Outdated
@@ -124,6 +124,19 @@ if(GENERATE_OTTDREV) | |||
message(STATUS "Generating .ottdrev") | |||
file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\t${REV_YEAR}\n") | |||
else() | |||
string(REGEX MATCH "^[0-9.]+" REV_SPLIT "${REV_VERSION}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use REV_ISSTABLETAG
here to know if the version is expected to be a stable tag? No clue if that is easy to do :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could work, beta and RC would then default to hard coded version, which should not be an issue.
While touching this, I'd suggest maybe putting the branch name into the |
263e350
to
13ba88c
Compare
Fixes #9062.
Version for
release/1.11
branch hereMotivation / Problem
Version numbers are hard coded in many files, meaning we always forget to update some of them.
Description
Auto detect and fill version numbers, there's still a hard coded default value but in only one location.
Limitations
Only done
rev.cpp
and Windows specific file for now.Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.