summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenInitializer.cxx
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-03-01 16:38:39 (GMT)
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-03-04 11:45:16 (GMT)
commitbb97a377dd15819357937b4644baa8848d22a990 (patch)
tree4eb934fcc0d723c6b45bf8d6ac13bec3d1b5298e /Source/cmQtAutoGenInitializer.cxx
parent57fd4b9d65e86010b2aba0ab00d62eb90a5ddc50 (diff)
downloadCMake-bb97a377dd15819357937b4644baa8848d22a990.zip
CMake-bb97a377dd15819357937b4644baa8848d22a990.tar.gz
CMake-bb97a377dd15819357937b4644baa8848d22a990.tar.bz2
Autogen: Fallback on internal qrc parser when RCC isn't built yet
When building a Qt project, the AUTORCC functionality, by default, uses the rcc binary to get the contents of a qrc file for dependency information. This is done at CMake "generate" time. The problem is that while configuring Qt itself, the rcc binary is not built yet. In that case, to get the contents of the qrc file, fall back to the code branch which uses an ifstream instead of the rcc binary.
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenInitializer.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 2fb6fdf..ef8fe73 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -594,7 +594,7 @@ bool cmQtAutoGenInitializer::InitRcc()
if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
if (stdOut.find("--list") != std::string::npos) {
this->Rcc.ListOptions.emplace_back("--list");
- } else {
+ } else if (stdOut.find("-list") != std::string::npos) {
this->Rcc.ListOptions.emplace_back("-list");
}
}
@@ -1581,6 +1581,10 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
print_err(prop + " evaluates to an empty value");
return false;
}
+
+ // Check if the provided executable already exists (it's possible for it
+ // not to exist when building Qt itself).
+ genVars.ExecutableExists = cmSystemTools::FileExists(genVars.Executable);
return true;
}
}
@@ -1630,6 +1634,7 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
print_err(err);
return false;
}
+ genVars.ExecutableExists = true;
}
return true;
@@ -1648,7 +1653,7 @@ bool cmQtAutoGenInitializer::RccListInputs(std::string const& fileName,
error += "\n";
return false;
}
- if (!this->Rcc.ListOptions.empty()) {
+ if (this->Rcc.ExecutableExists && !this->Rcc.ListOptions.empty()) {
// Use rcc for file listing
if (this->Rcc.Executable.empty()) {
error = "rcc executable not available";