Set GDAL_DEV_SUFFIX to the pre-release suffix if a corresponding Git tag was found #11335
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.
As noted in #11315 as a side note, I wondered why we are getting as
${GDAL_VERSION}
3.10.0dev
and not just3.10.0
when checking out a release tag via:Reason is, that the suffix
dev
will be always added when the.git
directory is present even theGDAL_RELEASE_NAME
(withingdal_version.h.in
) doesn't contain it anymore. Therefore I added a logic to parse the git tags.Results (from CMake output) when switching between different tags or current
master
:master
:3.10.0
3.10.0RC3
(same Git revision as the release version)3.10.0RC2
3.10.0beta1
As far as I can see
${GDAL_DEV_SUFFIX}
is only used to setup${GDAL_VERSION}
and didn't found any code which parses${GDAL_VERSION}
(so it is only handled as string), so I think there should be no side effect.// Note: Not sure about the coding guide lines related to CMake, as sometimes the indentation is two spaces and sometimes 4, sometimes the temporary variables are uppercase, sometimes lowercase, not sure about line length limit, ....