diff options
author | Brad King <brad.king@kitware.com> | 2015-04-16 16:51:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-16 19:10:40 (GMT) |
commit | e8fdd5f12a379ce91adcb88acdb4354bc271c911 (patch) | |
tree | 1fa0d4d344d1720151b4dd622c943611b4ded2d4 /Source | |
parent | 15f1a6b49958cc7757f951839b02a00e8c820154 (diff) | |
download | CMake-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.cxx | 7 |
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. |