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
1 changed files with 6 additions and 6 deletions

View File

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