diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-04-01 13:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-04-01 14:56:34 (GMT) |
commit | aba23c747b4a7fb342ae77d67b8b5cfbe9a67c8c (patch) | |
tree | 583a67deafe91340834232335a5e318039e2f0ff /Source/cmQtAutoGenInitializer.cxx | |
parent | cfc92b483fbd3695d4a67843977e709ba4d7ea47 (diff) | |
download | CMake-aba23c747b4a7fb342ae77d67b8b5cfbe9a67c8c.zip CMake-aba23c747b4a7fb342ae77d67b8b5cfbe9a67c8c.tar.gz CMake-aba23c747b4a7fb342ae77d67b8b5cfbe9a67c8c.tar.bz2 |
cmMakefile::GetProperty: return cmProp
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index dddba0a..a5af810 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1670,6 +1670,13 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target) } return 0u; }; + auto toUInt2 = [](cmProp input) -> unsigned int { + unsigned long tmp = 0; + if (input != nullptr && cmStrToULong(*input, &tmp)) { + return static_cast<unsigned int>(tmp); + } + return 0u; + }; // Initialize return value to a default std::pair<IntegerVersion, unsigned int> res( @@ -1691,9 +1698,9 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target) knownQtVersions.reserve(keys.size() * 2); // Adds a version to the result (nullptr safe) - auto addVersion = [&knownQtVersions, &toUInt](const char* major, - const char* minor) { - cmQtAutoGen::IntegerVersion ver(toUInt(major), toUInt(minor)); + auto addVersion = [&knownQtVersions, &toUInt2](cmProp major, + cmProp minor) { + cmQtAutoGen::IntegerVersion ver(toUInt2(major), toUInt2(minor)); if (ver.Major != 0) { knownQtVersions.emplace_back(ver); } @@ -1701,8 +1708,8 @@ cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target) // Read versions from variables for (auto const& keyPair : keys) { - addVersion(target->Makefile->GetDefinition(std::string(keyPair.first)), - target->Makefile->GetDefinition(std::string(keyPair.second))); + addVersion(target->Makefile->GetDef(std::string(keyPair.first)), + target->Makefile->GetDef(std::string(keyPair.second))); } // Read versions from directory properties |