summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-09-14 18:51:12 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-09-21 07:58:23 (GMT)
commit3f2237433991764479362c3f530201a0305a64d6 (patch)
tree627b0139f96e0de0a9960398bcb3d8e89c9cc64c
parent8bee55bce1ea814ed598516eee7f4e0e2adf8747 (diff)
downloadCMake-3f2237433991764479362c3f530201a0305a64d6.zip
CMake-3f2237433991764479362c3f530201a0305a64d6.tar.gz
CMake-3f2237433991764479362c3f530201a0305a64d6.tar.bz2
Autogen: Read relative paths from rcc output
-rw-r--r--Source/cmQtAutoGen.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 95cd122..d9b1fd3 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQtAutoGen.h"
#include "cmAlgorithms.h"
+#include "cmProcessOutput.h"
#include "cmSystemTools.h"
#include "cmsys/FStream.hxx"
@@ -158,15 +159,18 @@ static bool RccListInputsQt5(const std::string& rccCommand,
std::string rccStdOut;
std::string rccStdErr;
int retVal = 0;
- bool result =
- cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
- nullptr, cmSystemTools::OUTPUT_NONE);
+ bool result = cmSystemTools::RunSingleCommand(
+ command, &rccStdOut, &rccStdErr, &retVal, nullptr,
+ cmSystemTools::OUTPUT_NONE, 0.0, cmProcessOutput::Auto);
if (result && retVal == 0 &&
rccStdOut.find("--list") != std::string::npos) {
hasDashDashList = true;
}
}
+ std::string const fileDir = cmSystemTools::GetFilenamePath(fileName);
+ std::string const fileNameName = cmSystemTools::GetFilenameName(fileName);
+
// Run rcc list command
bool result = false;
int retVal = 0;
@@ -176,16 +180,16 @@ static bool RccListInputsQt5(const std::string& rccCommand,
std::vector<std::string> command;
command.push_back(rccCommand);
command.push_back(hasDashDashList ? "--list" : "-list");
- command.push_back(fileName);
- result =
- cmSystemTools::RunSingleCommand(command, &rccStdOut, &rccStdErr, &retVal,
- nullptr, cmSystemTools::OUTPUT_NONE);
+ command.push_back(fileNameName);
+ result = cmSystemTools::RunSingleCommand(
+ command, &rccStdOut, &rccStdErr, &retVal, fileDir.c_str(),
+ cmSystemTools::OUTPUT_NONE, 0.0, cmProcessOutput::Auto);
}
if (!result || retVal) {
if (errorMessage != nullptr) {
std::ostringstream ost;
- ost << "rcc list process for " << cmQtAutoGen::Quoted(fileName)
- << " failed:\n"
+ ost << "rcc list process failed for\n " << cmQtAutoGen::Quoted(fileName)
+ << "\n"
<< rccStdOut << "\n"
<< rccStdErr << "\n";
*errorMessage = ost.str();
@@ -230,6 +234,11 @@ static bool RccListInputsQt5(const std::string& rccCommand,
}
}
+ // Convert relative paths to absolute paths
+ for (std::string& resFile : files) {
+ resFile = cmSystemTools::CollapseCombinedPath(fileDir, resFile);
+ }
+
return true;
}