summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorMatteo Settenvini <matteo.settenvini@here.com>2018-04-10 09:16:44 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-11 19:02:07 (GMT)
commit65198cfd0f96d51269c748a84bafe27cf3312abd (patch)
tree71ef8e1935f1f8e973d5f668b65d6f4b44a174f7 /Source/cmMakefile.cxx
parente769e61f992ba0c0028e28bdf7531f495a625925 (diff)
downloadCMake-65198cfd0f96d51269c748a84bafe27cf3312abd.zip
CMake-65198cfd0f96d51269c748a84bafe27cf3312abd.tar.gz
CMake-65198cfd0f96d51269c748a84bafe27cf3312abd.tar.bz2
variable_watch: trigger on variables set via PARENT_SCOPE
Make sure that we also trigger variable watches when a variable is set in the parent scope. Fixes: #17827
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bbe6cc9..71ac58f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3838,7 +3838,16 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef)
std::ostringstream m;
m << "Cannot set \"" << var << "\": current scope has no parent.";
this->IssueMessage(cmake::AUTHOR_WARNING, m.str());
+ return;
}
+
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ cmVariableWatch* vv = this->GetVariableWatch();
+ if (vv) {
+ vv->VariableAccessed(var, cmVariableWatch::VARIABLE_MODIFIED_ACCESS,
+ varDef, this);
+ }
+#endif
}
cmTarget* cmMakefile::AddImportedTarget(const std::string& name,