diff options
author | Matteo Settenvini <matteo.settenvini@here.com> | 2018-04-10 09:16:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-04-11 19:02:07 (GMT) |
commit | 65198cfd0f96d51269c748a84bafe27cf3312abd (patch) | |
tree | 71ef8e1935f1f8e973d5f668b65d6f4b44a174f7 /Source/cmMakefile.cxx | |
parent | e769e61f992ba0c0028e28bdf7531f495a625925 (diff) | |
download | CMake-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.cxx | 9 |
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, |