diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-01-17 20:05:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-17 20:06:02 (GMT) |
commit | 657898ecad4fecff001964b3f0e27e77b5f9ffcd (patch) | |
tree | 0efa15d5ec4983ed5ed01e49a14600fcd76f05b7 /Source/cmMakefile.cxx | |
parent | af30899cb4431d6712fea5ac09215a92b3f16ccb (diff) | |
parent | 969c1f94aed7abbc71dc73b442817fe86a43b4df (diff) | |
download | CMake-657898ecad4fecff001964b3f0e27e77b5f9ffcd.zip CMake-657898ecad4fecff001964b3f0e27e77b5f9ffcd.tar.gz CMake-657898ecad4fecff001964b3f0e27e77b5f9ffcd.tar.bz2 |
Merge topic 'cmSourceGroup-modern-cxx'
969c1f94 cmSourceGroup: code improvements; use std::string and C++11 loops
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1656
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b42495c..eeeb54f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1965,7 +1965,7 @@ cmSourceGroup* cmMakefile::GetSourceGroup( if (sg != nullptr) { // iterate through its children to find match source group for (unsigned int i = 1; i < name.size(); ++i) { - sg = sg->LookupChild(name[i].c_str()); + sg = sg->LookupChild(name[i]); if (sg == nullptr) { break; } @@ -2009,7 +2009,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, if (i == -1) { // group does not exist nor belong to any existing group // add its first component - this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex)); + this->SourceGroups.push_back(cmSourceGroup(name[0], regex)); sg = this->GetSourceGroup(currentName); i = 0; // last component found } @@ -2019,9 +2019,8 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, } // build the whole source group path for (++i; i <= lastElement; ++i) { - sg->AddChild( - cmSourceGroup(name[i].c_str(), nullptr, sg->GetFullName().c_str())); - sg = sg->LookupChild(name[i].c_str()); + sg->AddChild(cmSourceGroup(name[i], nullptr, sg->GetFullName().c_str())); + sg = sg->LookupChild(name[i]); } sg->SetGroupRegex(regex); |