Get version string from git-describe, git-archive or CMake config #10573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if the source directory is not a git repo, the version string will be the last released version set in the
ICINGA2_VERSIONfile.This PR makes the following improvements:
git-describefails because the source directory isn't a git repo orICINGA2_GIT_VERSION_INFOis OFF, the version is read from a file processed bygit-archive.ICINGA2_VERSIONis removed and replaced with a variable at the top of the main CMakeLists.txt that will need to be updated manually on a new release.ICINGA2_PACKAGE_(VERSION|REVISION|VENDOR)are added that can be customized by package build process. These are utilized for Windows MSI builds (via CPACK)icinga2 --versionif the new optionICINGA2_INCLUDE_PACKAGE_INFOis set to ON (defaults to OFF). I added an additional option for this because I wanted to use defaults, description and type for the package version/revision/vendor cache variables, and otherwise there is no reliable way to detect that the user has changed the information and include the--versionsection based on that.Here is an overview of how the variables/constants and their meaning has changed:
Before:
After:
Fixes #10016
Fixes #8960