summaryrefslogtreecommitdiffstats
path: root/Source/cmState.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/cmState.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/cmState.cxx')
-rw-r--r--Source/cmState.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 9de58d8..e3f62b5 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1020,6 +1020,8 @@ void cmState::Directory::SetCurrentSource(std::string const& dir)
loc,
this->DirectoryState->CurrentSourceDirectoryComponents);
this->ComputeRelativePathTopSource();
+
+ this->Snapshot_.SetDefinition("CMAKE_CURRENT_SOURCE_DIR", loc.c_str());
}
const char* cmState::Directory::GetCurrentBinary() const
@@ -1038,6 +1040,8 @@ void cmState::Directory::SetCurrentBinary(std::string const& dir)
loc,
this->DirectoryState->CurrentBinaryDirectoryComponents);
this->ComputeRelativePathTopBinary();
+
+ this->Snapshot_.SetDefinition("CMAKE_CURRENT_BINARY_DIR", loc.c_str());
}
void cmState::Snapshot::SetListFile(const std::string& listfile)
@@ -1333,8 +1337,12 @@ void cmState::Snapshot::SetDirectoryDefinitions()
{
this->SetDefinition("CMAKE_SOURCE_DIR",
this->State->GetSourceDirectory());
+ this->SetDefinition("CMAKE_CURRENT_SOURCE_DIR",
+ this->State->GetSourceDirectory());
this->SetDefinition("CMAKE_BINARY_DIR",
this->State->GetBinaryDirectory());
+ this->SetDefinition("CMAKE_CURRENT_BINARY_DIR",
+ this->State->GetBinaryDirectory());
}
void cmState::Snapshot::InitializeFromParent()