summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-16 16:51:05 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-16 19:10:40 (GMT)
commite8fdd5f12a379ce91adcb88acdb4354bc271c911 (patch)
tree1fa0d4d344d1720151b4dd622c943611b4ded2d4 /Source
parent15f1a6b49958cc7757f951839b02a00e8c820154 (diff)
downloadCMake-e8fdd5f12a379ce91adcb88acdb4354bc271c911.zip
CMake-e8fdd5f12a379ce91adcb88acdb4354bc271c911.tar.gz
CMake-e8fdd5f12a379ce91adcb88acdb4354bc271c911.tar.bz2
QtAutogen: Workaround rcc CRCRLF newlines on Windows (#15459)
The 'rcc --list' operation may print newlines of the form CRCRLF, so strip any trailing CR characters found on each line. Update the Tests/QtAutogen test to use a resource named in a subdirectory. This causes 'rcc --list' to display a blank line and tests that it is correctly filtered out.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenerators.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4cb49c8..a5238f5 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -201,6 +201,13 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
std::string oline;
while(std::getline(ostr, oline))
{
+ // Strip CR characters rcc may have printed (possibly more than one!).
+ std::string::size_type cr = oline.find('\r');
+ if (cr != oline.npos)
+ {
+ oline = oline.substr(0, cr);
+ }
+
if (oline.empty())
{
// The output of rcc --list contains many empty lines.