diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-01 15:16:20 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-01 15:16:20 (GMT) |
commit | a99dfa60aed8b4446949c3f55e7b3ea517042bb4 (patch) | |
tree | 851088c4562a35976a9b7138831a02703d458ef3 /Source/cmElseCommand.cxx | |
parent | 2fb2207c1025f86cc5b62faf8c3a1ca15ea18152 (diff) | |
download | CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.zip CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.gz CMake-a99dfa60aed8b4446949c3f55e7b3ea517042bb4.tar.bz2 |
new set command and IF NOT
Diffstat (limited to 'Source/cmElseCommand.cxx')
-rw-r--r-- | Source/cmElseCommand.cxx | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index b905945..9684de1 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; |