Skip to content

ecm_setup_version: deal with 0-prefixed version values in PROJECT mode

5c191fa1 already added the same sanity check for the non-PROJECT mode

Found while looking at the breakage with KGet after the version bump to "21.08.0" on CI with https://build.kde.org/job/Applications/job/kget/job/stable-kf5-qt5%20SUSEQt5.15/31/ (fixed by network/kget@929635c3 which changed away from PROJECT mode variant)

https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=ecm_setup_version%5C%28PROJECT hints there are quite some users of ecm_setup_version(PROJECT) in the release service, and all those which switched to requiring CMake 3.16 will also have new CMP0096 policy, which means leading zeros will be kept e.g. in the PROJECT_VERSION_{MAJOR,MINOR,PATCH} variables.

Actually surprised only KGet fall here so far (KTorrent had a related but custom issue). Possibly nothing is using the respective defines yet (though chance up with any libraries where consumers might use the FOO_VERSION for checking features/API).

@aacid @heikobecker @vkrause @cgiboudeaux

Merge request reports