diff options
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 54 |
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; |