summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-01 15:32:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-05-01 15:32:59 (GMT)
commit4ac48237a0337a6d36556e0424e44baef38cad9a (patch)
treef2bc391f825cb9518f1f953834b19c6a7bd257ce /Source
parent1155f96dd911d7a46aea2160eaebc3653d93a852 (diff)
parentb3baa97e80af96eaeb7d0599e2d00071a945f7b8 (diff)
downloadCMake-4ac48237a0337a6d36556e0424e44baef38cad9a.zip
CMake-4ac48237a0337a6d36556e0424e44baef38cad9a.tar.gz
CMake-4ac48237a0337a6d36556e0424e44baef38cad9a.tar.bz2
Merge topic 'source_group-empty-prefix'
b3baa97e80 Source_Group: Allow an empty prefix with the TREE syntax. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2022
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSourceGroupCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 8c9b63c..c3df313 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -101,9 +101,13 @@ bool addFilesToItsSourceGroups(const std::string& root,
tokenizedPath = tokenizePath(sgFilesPath);
}
- if (tokenizedPath.size() > 1) {
+ if (!tokenizedPath.empty()) {
tokenizedPath.pop_back();
+ if (tokenizedPath.empty()) {
+ tokenizedPath.push_back("");
+ }
+
sg = makefile.GetOrCreateSourceGroup(tokenizedPath);
if (!sg) {