summaryrefslogtreecommitdiff
path: root/Source/cmElseCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-01 11:16:20 -0400
committerKen Martin <ken.martin@kitware.com>2001-05-01 11:16:20 -0400
commita99dfa60aed8b4446949c3f55e7b3ea517042bb4 (patch)
tree851088c4562a35976a9b7138831a02703d458ef3 /Source/cmElseCommand.cxx
parent2fb2207c1025f86cc5b62faf8c3a1ca15ea18152 (diff)
downloadcmake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.gz
new set command and IF NOT
Diffstat (limited to 'Source/cmElseCommand.cxx')
-rw-r--r--Source/cmElseCommand.cxx39
1 files changed, 30 insertions, 9 deletions
diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx
index b905945603..9684de1025 100644
--- a/Source/cmElseCommand.cxx
+++ b/Source/cmElseCommand.cxx
@@ -49,19 +49,40 @@ bool cmElseCommand::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"))
{
- // add block
- cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
- f->m_Define = args[0];
- m_Makefile->AddFunctionBlocker(f);
+ def = m_Makefile->GetDefinition(args[1].c_str());
+ if(!cmSystemTools::IsOff(def))
+ {
+ // remove any function blockers for this define
+ m_Makefile->RemoveFunctionBlocker("ENDIF",args);
+ }
+ else
+ {
+ // create a function blocker
+ cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
+ f->m_Define = args[1];
+ f->m_Not = true;
+ m_Makefile->AddFunctionBlocker(f);
+ }
}
else
{
- // remove any function blockers for this define
- m_Makefile->RemoveFunctionBlocker("ENDIF",args);
+ def = m_Makefile->GetDefinition(args[0].c_str());
+ if(!cmSystemTools::IsOff(def))
+ {
+ // create a function blocker
+ cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
+ f->m_Define = args[0];
+ m_Makefile->AddFunctionBlocker(f);
+ }
+ else
+ {
+ // remove any function blockers for this define
+ m_Makefile->RemoveFunctionBlocker("ENDIF",args);
+ }
}
return true;