summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-17 19:12:13 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-17 19:12:13 (GMT)
commitb8928b0c8e2d6e649cf52d28021cf349194f2485 (patch)
tree3ae692d050471c02ff5a2fa7d91ae96c9e0ff13c /Source
parentbdc7792e4003c2737e4b3e5b670795d5f59f667a (diff)
downloadCMake-b8928b0c8e2d6e649cf52d28021cf349194f2485.zip
CMake-b8928b0c8e2d6e649cf52d28021cf349194f2485.tar.gz
CMake-b8928b0c8e2d6e649cf52d28021cf349194f2485.tar.bz2
BUG: Do not complain about missing watched variables when they are accessd with IF(DEFINED VAR).
Diffstat (limited to 'Source')
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmMakefile.h1
3 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index e28956f..2814f72 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -315,7 +315,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
}
else
{
- def = makefile->GetDefinition((argP1)->c_str());
+ def = makefile->GetDefinitionNoWatch((argP1)->c_str());
}
if(def)
{
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 50270b4..9f05114 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::GetDefinition(const char* name) const
+const char* cmMakefile::GetDefinitionNoWatch(const char* name) const
{
const char* def = 0;
DefinitionMap::const_iterator pos = this->Definitions.find(name);
@@ -1645,6 +1645,12 @@ const char* cmMakefile::GetDefinition(const char* name) const
{
def = this->GetCacheManager()->GetCacheValue(name);
}
+ return def;
+}
+
+const char* cmMakefile::GetDefinition(const char* name) const
+{
+ const char* def = this->GetDefinitionNoWatch(name);
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
if ( vv )
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 68780cf..1ea866c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -492,6 +492,7 @@ public:
* cache is then queried.
*/
const char* GetDefinition(const char*) const;
+ const char* GetDefinitionNoWatch(const char*) const;
const char* GetSafeDefinition(const char*) const;
const char* GetRequiredDefinition(const char* name) const;
/**