summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-13 19:57:54 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-13 22:16:07 (GMT)
commit841164cb36650574a1a7363c78e4cdf28d5d37fd (patch)
tree2bb2395b9077969517ffd7751076697d11fce98e /Source/cmMakefile.cxx
parent2c219bafc045dfdf49529b8ad141fed3dbb4d8e9 (diff)
downloadCMake-841164cb36650574a1a7363c78e4cdf28d5d37fd.zip
CMake-841164cb36650574a1a7363c78e4cdf28d5d37fd.tar.gz
CMake-841164cb36650574a1a7363c78e4cdf28d5d37fd.tar.bz2
cmState: Initialize current directories immediately.
Don't leave this as cmMakefile responsibility.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx28
1 files changed, 2 insertions, 26 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2c5501e..f804d06 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -118,32 +118,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->AddSourceGroup("Resources", "\\.plist$");
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
#endif
-
- {
- const char* dir = this->StateSnapshot.GetDirectory().GetCurrentSource();
- if (dir)
- {
- this->StateSnapshot.SetDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
- }
- else
- {
- this->StateSnapshot.SetDefinition("CMAKE_CURRENT_SOURCE_DIR",
- this->GetCMakeInstance()->GetHomeDirectory());
- }
- }
- {
- const char* dir = this->StateSnapshot.GetDirectory().GetCurrentBinary();
- if (dir)
- {
- cmSystemTools::MakeDirectory(dir);
- this->StateSnapshot.SetDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
- }
- else
- {
- this->StateSnapshot.SetDefinition("CMAKE_CURRENT_BINARY_DIR",
- this->GetCMakeInstance()->GetHomeOutputDirectory());
- }
- }
}
cmMakefile::~cmMakefile()
@@ -1756,6 +1730,8 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
newSnapshot.GetDirectory().SetCurrentSource(srcPath);
newSnapshot.GetDirectory().SetCurrentBinary(binPath);
+ cmSystemTools::MakeDirectory(binPath.c_str());
+
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
this->GetGlobalGenerator()->AddMakefile(subMf);