BUG: Fix PARENT_DIRECTORY property in top-level to not crash.

This commit is contained in:
Brad King 2008-06-26 10:58:16 -04:00
parent bb7bc28c78
commit 2ca9a70fd1
1 changed files with 4 additions and 2 deletions

View File

@ -2908,8 +2908,10 @@ const char *cmMakefile::GetProperty(const char* prop,
output = "";
if (!strcmp("PARENT_DIRECTORY",prop))
{
output = this->LocalGenerator->GetParent()
->GetMakefile()->GetStartDirectory();
if(cmLocalGenerator* plg = this->LocalGenerator->GetParent())
{
output = plg->GetMakefile()->GetStartDirectory();
}
return output.c_str();
}
else if (!strcmp("INCLUDE_REGULAR_EXPRESSION",prop) )