summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-17 21:40:59 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-17 21:40:59 (GMT)
commit9a5b4eba97628c53f051d653cdc8a301f5f32312 (patch)
tree3fbf5ecc5ac2f0467e0b7bad1a43f4fe488e0540 /Source/cmMakefile.cxx
parentb47807fc15a35c1f9f53842b17ec283c2d3a7778 (diff)
downloadCMake-9a5b4eba97628c53f051d653cdc8a301f5f32312.zip
CMake-9a5b4eba97628c53f051d653cdc8a301f5f32312.tar.gz
CMake-9a5b4eba97628c53f051d653cdc8a301f5f32312.tar.bz2
BUG: All variable accesses should produce watch callbacks, including IF(DEFINED <var>) ones. Instead we define a new access type for IF(DEFINED) so that the error does not show up for backward compatibility variables.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9f05114..f126d0e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1633,7 +1633,7 @@ const char* cmMakefile::GetRequiredDefinition(const char* name) const
return ret;
}
-const char* cmMakefile::GetDefinitionNoWatch(const char* name) const
+bool cmMakefile::IsDefinitionSet(const char* name) const
{
const char* def = 0;
DefinitionMap::const_iterator pos = this->Definitions.find(name);
@@ -1645,12 +1645,32 @@ const char* cmMakefile::GetDefinitionNoWatch(const char* name) const
{
def = this->GetCacheManager()->GetCacheValue(name);
}
- return def;
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ if(cmVariableWatch* vv = this->GetVariableWatch())
+ {
+ if(!def)
+ {
+ vv->VariableAccessed
+ (name, cmVariableWatch::UNKNOWN_VARIABLE_DEFINED_ACCESS,
+ def, this);
+ }
+ }
+#endif
+ return def?true:false;
}
const char* cmMakefile::GetDefinition(const char* name) const
{
- const char* def = this->GetDefinitionNoWatch(name);
+ const char* def = 0;
+ DefinitionMap::const_iterator pos = this->Definitions.find(name);
+ if(pos != this->Definitions.end())
+ {
+ def = (*pos).second.c_str();
+ }
+ else
+ {
+ def = this->GetCacheManager()->GetCacheValue(name);
+ }
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
if ( vv )