diff options
author | Brad King <brad.king@kitware.com> | 2019-01-16 14:51:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-16 14:51:33 (GMT) |
commit | e44cc45530b002546bae11a34e77a3a730fd14e4 (patch) | |
tree | 4c085af51563cde788a63e4c2311e15242729299 /Source/cmQtAutoGenInitializer.cxx | |
parent | a8b447d72e13b3356893737adba0a46ea065f70d (diff) | |
parent | 5fe18eee1392c312612fad0e6f408ea7cb1ef29d (diff) | |
download | CMake-e44cc45530b002546bae11a34e77a3a730fd14e4.zip CMake-e44cc45530b002546bae11a34e77a3a730fd14e4.tar.gz CMake-e44cc45530b002546bae11a34e77a3a730fd14e4.tar.bz2 |
Merge topic 'autogen_adaptive_warning'
5fe18eee13 Autogen: Adaptive missing Qt warning
f2f1661334 Autogen: Add and use QtAutoGen::Tools method
b2343ff086 Autogen: Fix rcc validity check
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2806
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 38a4ec2..9fa8a89 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1406,32 +1406,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( |