summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-11-08 20:46:08 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-11-08 20:46:08 (GMT)
commitf5d95fb078ec48755762931fe2882ed1cbe1171e (patch)
tree945dca55d34b543db452c586aba0de863cf25cec /Source/cmIfCommand.cxx
parentc72462ffb1c75573e0d67a7101438a62bfc2fda1 (diff)
downloadCMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.zip
CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.gz
CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.bz2
Complete rework of makefile generators expect trouble
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx18
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;
}