cmMakefile: Initialize dir definitions early.

This commit is contained in:
Stephen Kelly 2015-04-16 22:18:04 +02:00
parent f034bb2f54
commit 1ea085d1b6
2 changed files with 5 additions and 9 deletions

View File

@ -1543,6 +1543,11 @@ void cmMakefile::InitializeFromParent()
// Initialize definitions with the closure of the parent scope. // Initialize definitions with the closure of the parent scope.
this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure();
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
const std::vector<cmValueWithOrigin>& parentIncludes = const std::vector<cmValueWithOrigin>& parentIncludes =
parent->GetIncludeDirectoriesEntries(); parent->GetIncludeDirectoriesEntries();
this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(),
@ -1611,7 +1616,6 @@ void cmMakefile::InitializeFromParent()
void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
{ {
lg2->GetMakefile()->InitializeFromParent(); lg2->GetMakefile()->InitializeFromParent();
lg2->GetMakefile()->MakeStartDirectoriesCurrent();
if (this->GetCMakeInstance()->GetDebugOutput()) if (this->GetCMakeInstance()->GetDebugOutput())
{ {
std::string msg=" Entering "; std::string msg=" Entering ";

View File

@ -423,14 +423,6 @@ public:
bool HasCMP0054AlreadyBeenReported( bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const; cmListFileContext context) const;
void MakeStartDirectoriesCurrent()
{
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
//@{ //@{
/** /**
* Set/Get the home directory (or output directory) in the project. The * Set/Get the home directory (or output directory) in the project. The