summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-27 16:23:14 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-27 16:23:14 (GMT)
commit1d3308156e1fc1646873b22317265c61288e9e42 (patch)
treeff65855bca8ae897c19ce112d54d654bab2a049c /Source/cmGlobalGenerator.cxx
parent99b37665c91e91d70576298fef7bab71f794c985 (diff)
downloadCMake-1d3308156e1fc1646873b22317265c61288e9e42.zip
CMake-1d3308156e1fc1646873b22317265c61288e9e42.tar.gz
CMake-1d3308156e1fc1646873b22317265c61288e9e42.tar.bz2
ENH: Enforce unique binary directories
The second argument of add_subdirectory must name a unique binary directory or the build files will clobber each other. This enforces uniqueness with an error message.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4fc26f6..0103a85 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -732,18 +732,22 @@ void cmGlobalGenerator::Configure()
this->ProjectMap.clear();
this->RuleHashes.clear();
this->DirectoryContentMap.clear();
+ this->BinaryDirectories.clear();
// start with this directory
cmLocalGenerator *lg = this->CreateLocalGenerator();
this->LocalGenerators.push_back(lg);
// set the Start directories
+ cmMakefile* mf = lg->GetMakefile();
lg->GetMakefile()->SetStartDirectory
(this->CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory
(this->CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
+ this->BinaryDirectories.insert(mf->GetStartOutputDirectory());
+
// now do it
lg->Configure();