cmMakefile: Set internal definitions directly.

The usage tracking of cmMakefile::AddDefinition is not needed.
This commit is contained in:
Stephen Kelly 2015-10-13 21:44:14 +02:00
parent c4361a265b
commit 871ab98dad

View File

@ -120,19 +120,19 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$"); this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
#endif #endif
this->AddDefinition("CMAKE_SOURCE_DIR", this->StateSnapshot.SetDefinition("CMAKE_SOURCE_DIR",
this->GetCMakeInstance()->GetHomeDirectory()); this->GetCMakeInstance()->GetHomeDirectory());
this->AddDefinition("CMAKE_BINARY_DIR", this->StateSnapshot.SetDefinition("CMAKE_BINARY_DIR",
this->GetCMakeInstance()->GetHomeOutputDirectory()); this->GetCMakeInstance()->GetHomeOutputDirectory());
{ {
const char* dir = this->StateSnapshot.GetDirectory().GetCurrentSource(); const char* dir = this->StateSnapshot.GetDirectory().GetCurrentSource();
if (dir) if (dir)
{ {
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir); this->StateSnapshot.SetDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
} }
else else
{ {
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->StateSnapshot.SetDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->GetCMakeInstance()->GetHomeDirectory()); this->GetCMakeInstance()->GetHomeDirectory());
} }
} }
@ -141,11 +141,11 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
if (dir) if (dir)
{ {
cmSystemTools::MakeDirectory(dir); cmSystemTools::MakeDirectory(dir);
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir); this->StateSnapshot.SetDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
} }
else else
{ {
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", this->StateSnapshot.SetDefinition("CMAKE_CURRENT_BINARY_DIR",
this->GetCMakeInstance()->GetHomeOutputDirectory()); this->GetCMakeInstance()->GetHomeOutputDirectory());
} }
} }