summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmMakefile.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 077470da92..e522320500 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1472,8 +1472,6 @@ void cmMakefile::AddLinkLibrary(const std::string& lib)
void cmMakefile::InitializeFromParent(cmMakefile* parent)
{
- this->StateSnapshot.InitializeFromParent();
-
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->GetCurrentSourceDirectory());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
@@ -1755,6 +1753,9 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
// set the subdirs start dirs
subMf->SetCurrentSourceDirectory(srcPath);
subMf->SetCurrentBinaryDirectory(binPath);
+
+ subMf->StateSnapshot.InitializeFromParent();
+
if(excludeFromAll)
{
subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE");