summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx43
1 files changed, 21 insertions, 22 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index e4d2c82..7721e91 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1409,32 +1409,31 @@ static std::vector<cmQtAutoGenInitializer::IntegerVersion> GetKnownQtVersions(
return result;
}
-cmQtAutoGenInitializer::IntegerVersion cmQtAutoGenInitializer::GetQtVersion(
- cmGeneratorTarget const* target)
+std::pair<cmQtAutoGenInitializer::IntegerVersion, unsigned int>
+cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target)
{
- auto knownQtVersions = GetKnownQtVersions(target);
- if (knownQtVersions.empty()) {
- return cmQtAutoGenInitializer::IntegerVersion(); // No Qt
- }
-
- // Pick a version from the known versions:
- auto targetVersion = CharPtrToInt(
- target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""));
+ std::pair<IntegerVersion, unsigned int> res(
+ IntegerVersion(),
+ CharPtrToInt(target->GetLinkInterfaceDependentStringProperty(
+ "QT_MAJOR_VERSION", "")));
- if (targetVersion == 0) {
- // No specific version was requested by the target:
- // Use highest known Qt version.
- return knownQtVersions.at(0);
- }
-
- for (auto it : knownQtVersions) {
- if (it.Major == targetVersion) {
- return it;
+ auto knownQtVersions = GetKnownQtVersions(target);
+ if (!knownQtVersions.empty()) {
+ if (res.second == 0) {
+ // No specific version was requested by the target:
+ // Use highest known Qt version.
+ res.first = knownQtVersions.at(0);
+ } else {
+ // Pick a version from the known versions:
+ for (auto it : knownQtVersions) {
+ if (it.Major == res.second) {
+ res.first = it;
+ break;
+ }
+ }
}
}
-
- // Requested version was not found
- return cmQtAutoGenInitializer::IntegerVersion();
+ return res;
}
std::pair<bool, std::string> GetQtExecutable(