diff --git a/cmake.changes b/cmake.changes index 8ed2a50..7147c97 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Dec 1 16:36:36 UTC 2021 - Christophe Giboudeaux + +- 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 diff --git a/cmake.prov b/cmake.prov index 2b0d692..e1d5530 100644 --- a/cmake.prov +++ b/cmake.prov @@ -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()