summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-12-18 14:39:26 (GMT)
committerBrad King <brad.king@kitware.com>2001-12-18 14:39:26 (GMT)
commitfd37e46eb31a418302ba789fa99bb807cf2b5450 (patch)
treea7968d313066cb97828c33b8e14233db9cdf566c /Source/cmIfCommand.cxx
parentdca0fd0859a941665c9c1648f8ca3cf42fda1141 (diff)
downloadCMake-fd37e46eb31a418302ba789fa99bb807cf2b5450.zip
CMake-fd37e46eb31a418302ba789fa99bb807cf2b5450.tar.gz
CMake-fd37e46eb31a418302ba789fa99bb807cf2b5450.tar.bz2
ENH: Added option to IF command to test if a command exists. Syntax is IF(COMMAND name-of-command).
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 903746a..e25502e 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -110,6 +110,14 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args)
}
}
+ if (args.size() == 2 && (args[0] == "COMMAND"))
+ {
+ if(!m_Makefile->CommandExists(args[1].c_str()))
+ {
+ f = new cmIfFunctionBlocker();
+ }
+ }
+
if (args.size() == 3 && (args[1] == "AND"))
{
def = m_Makefile->GetDefinition(args[0].c_str());