From 894961af16c83beb785b3d0fa7d1e6b80946eaac Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 13 May 2015 20:42:16 +0200 Subject: [PATCH] cmMakefile: Use the state to determine the parent directory. Do not depend on the local generator for that. --- Source/cmMakefile.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1a6d1235c..48a9b9244 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4117,11 +4117,12 @@ const char *cmMakefile::GetProperty(const std::string& prop, output = ""; if (prop == "PARENT_DIRECTORY") { - if(cmLocalGenerator* plg = this->LocalGenerator->GetParent()) + cmState::Snapshot parent = this->StateSnapshot.GetParent(); + if(parent.IsValid()) { - output = plg->GetMakefile()->GetCurrentSourceDirectory(); + return parent.GetCurrentSourceDirectory(); } - return output.c_str(); + return ""; } else if (prop == "INCLUDE_REGULAR_EXPRESSION" ) {