summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-01 15:16:20 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-05-01 15:16:20 (GMT)
commita99dfa60aed8b4446949c3f55e7b3ea517042bb4 (patch)
tree851088c4562a35976a9b7138831a02703d458ef3 /Source/cmIfCommand.cxx
parent2fb2207c1025f86cc5b62faf8c3a1ca15ea18152 (diff)
downloadCMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.zip
CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.gz
CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.bz2
new set command and IF NOT
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx54
1 files changed, 44 insertions, 10 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 86803de..37daba6 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -49,9 +49,23 @@ IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
{
return true;
}
- if (strcmp(args[0].c_str(),m_Define.c_str()))
+ if (m_Not && args.size() == 2)
{
- return true;
+ if (strcmp(args[0].c_str(),"NOT"))
+ {
+ return true;
+ }
+ if (strcmp(args[1].c_str(),m_Define.c_str()))
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (strcmp(args[0].c_str(),m_Define.c_str()))
+ {
+ return true;
+ }
}
return false;
}
@@ -71,18 +85,38 @@ bool cmIfCommand::Invoke(std::vector<std::string>& args)
return false;
}
- // check to see if the argument is defined first
- const char *def = m_Makefile->GetDefinition(args[0].c_str());
- if(!cmSystemTools::IsOff(def))
+ // check for the NOT vale
+ const char *def;
+ if (args.size() == 2 && (args[0] == "NOT"))
{
- // do nothing
+ def = m_Makefile->GetDefinition(args[1].c_str());
+ if(!cmSystemTools::IsOff(def))
+ {
+ // create a function blocker
+ cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
+ f->m_Define = args[1];
+ f->m_Not = true;
+ m_Makefile->AddFunctionBlocker(f);
+ }
+ else
+ {
+ // do nothing
+ }
}
else
{
- // create a function blocker
- cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
- f->m_Define = args[0];
- m_Makefile->AddFunctionBlocker(f);
+ def = m_Makefile->GetDefinition(args[0].c_str());
+ if(!cmSystemTools::IsOff(def))
+ {
+ // do nothing
+ }
+ else
+ {
+ // create a function blocker
+ cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
+ f->m_Define = args[0];
+ m_Makefile->AddFunctionBlocker(f);
+ }
}
return true;