summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-20 20:41:37 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-21 13:05:12 (GMT)
commitacd4f01fd81c4303cad37128a75ca390c1a42571 (patch)
tree2cc0e2639117fb32f19b3b4d7557354671187ca7
parentb2289ff6542b79772e874c6dba157f72bb17c8be (diff)
downloadCMake-acd4f01fd81c4303cad37128a75ca390c1a42571.zip
CMake-acd4f01fd81c4303cad37128a75ca390c1a42571.tar.gz
CMake-acd4f01fd81c4303cad37128a75ca390c1a42571.tar.bz2
cmQtAutoGenerators: Split CR stripping out to helper function
-rw-r--r--Source/cmQtAutoGenerators.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 329f9de..547be6e 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -170,6 +170,17 @@ static std::string getAutogenTargetDir(cmTarget const* target)
return targetDir;
}
+static std::string cmQtAutoGeneratorsStripCR(std::string const& line)
+{
+ // Strip CR characters rcc may have printed (possibly more than one!).
+ std::string::size_type cr = line.find('\r');
+ if (cr != line.npos)
+ {
+ return line.substr(0, cr);
+ }
+ return line;
+}
+
std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
cmTarget const* target,
std::vector<std::string>& depends)
@@ -202,13 +213,7 @@ 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);
- }
-
+ oline = cmQtAutoGeneratorsStripCR(oline);
if (oline.empty())
{
// The output of rcc --list contains many empty lines.