浏览代码

ENH: Added option to IF command to test if a command exists. Syntax is IF(COMMAND name-of-command).

Brad King 24 年之前
父节点
当前提交
16b0571d93
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Source/cmElseCommand.cxx

+ 8 - 0
Source/cmElseCommand.cxx

@@ -65,6 +65,14 @@ bool cmElseCommand::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() == 2 && (args[0] == "NOT"))
     {
     def = m_Makefile->GetDefinition(args[1].c_str());