diff options
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index aefec8e..406416b 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -106,7 +106,13 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args) if (!isValid) { - this->SetError("An IF command had incorrect arguments"); + std::string err = "An IF command had incorrect arguments: "; + for(int i =0; i < args.size(); ++i) + { + err += args[i]; + err += " "; + } + this->SetError(err.c_str()); return false; } @@ -177,6 +183,15 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args, bool &isValid, isValid = true; } + if (args.size() == 2 && (args[0] == "MATCHES")) + { + if(!cmSystemTools::FileExists(args[1].c_str())) + { + isTrue = false; + } + isValid = true; + } + if (args.size() == 3 && (args[1] == "AND")) { def = makefile->GetDefinition(args[0].c_str()); @@ -263,7 +278,6 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args, bool &isValid, } isValid = true; } - return isTrue; } |