summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-14 12:56:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-14 12:56:16 (GMT)
commit35e3836589535bae12208a403011c7e95e589a85 (patch)
treec0d284822087be3facb17d8736cd8312c2677aa6 /Source
parent321c1799620fdb0251f070f2258470ae95c34e7c (diff)
parent1f8613e9bab142a839ec3c4dafd1aff1ba7487c7 (diff)
downloadCMake-35e3836589535bae12208a403011c7e95e589a85.zip
CMake-35e3836589535bae12208a403011c7e95e589a85.tar.gz
CMake-35e3836589535bae12208a403011c7e95e589a85.tar.bz2
Merge topic 'ctest-subdir-spaces'
1f8613e9 Fix CTest test file generation for spaces in subdirectory names 385e6a27 cmLocalGenerator: Refactor test subdirectory generation loop
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c0ecba3..a76bed3 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -175,15 +175,14 @@ void cmLocalGenerator::GenerateTestFiles()
(*gi)->Compute(this);
(*gi)->Generate(fout, config, configurationTypes);
}
- size_t i;
- std::vector<cmState::Snapshot> children =
- this->Makefile->GetStateSnapshot().GetChildren();
- for (i = 0; i < children.size(); ++i) {
+ typedef std::vector<cmState::Snapshot> vec_t;
+ vec_t const& children = this->Makefile->GetStateSnapshot().GetChildren();
+ for (vec_t::const_iterator i = children.begin(); i != children.end(); ++i) {
// TODO: Use add_subdirectory instead?
- fout << "subdirs(";
- std::string outP = children[i].GetDirectory().GetCurrentBinary();
- fout << this->ConvertToRelativePath(outP, START_OUTPUT);
- fout << ")" << std::endl;
+ std::string outP = i->GetDirectory().GetCurrentBinary();
+ outP = this->ConvertToRelativePath(outP, START_OUTPUT);
+ outP = cmOutputConverter::EscapeForCMake(outP);
+ fout << "subdirs(" << outP << ")" << std::endl;
}
}