SHA256
3
0
forked from pool/cmake

Accepting request 935121 from home:cgiboudeaux:Qt6:release:cmake_fix

- Adapt cmake.prov for Qt >= 6.2.2
  Upstream uses its own ConfigVersion implementation.Starting with
  Qt 6.2.2, 'PACKAGE_VERSION' is not defined in
  Qt6FooConfigVersion.cmake but in Qt6FooConfigVersionImpl.cmake.

OBS-URL: https://build.opensuse.org/request/show/935121
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=477
This commit is contained in:
Simon Lees 2021-12-02 07:35:20 +00:00 committed by Git OBS Bridge
parent 2b889871ff
commit 2388ea9f48
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Dec 1 16:36:36 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Adapt cmake.prov for Qt >= 6.2.2
Upstream uses its own ConfigVersion implementation.Starting with
Qt 6.2.2, 'PACKAGE_VERSION' is not defined in
Qt6FooConfigVersion.cmake but in Qt6FooConfigVersionImpl.cmake.
-------------------------------------------------------------------
Thu Nov 18 20:25:16 UTC 2021 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -57,11 +57,16 @@ class CMakeParser:
return result
def resolveCMakeModuleVersion(self, modulePath, cmakeModule, lowercase):
versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule)
# Qt >= 6.2.2 defines 'PACKAGE_VERSION' in *ConfigVersionImpl.cmake
versionFile = f"{modulePath}/{cmakeModule}ConfigVersionImpl.cmake" if "Qt6" in f"{cmakeModule}" else ""
try:
f = open(versionFile, 'r')
except:
return None
versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule)
try:
f = open(versionFile, 'r')
except:
return None
for line in f:
line = line.strip()