diff options
-rw-r--r-- | Source/cmElseCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmIfCommand.h | 4 |
3 files changed, 19 insertions, 1 deletions
diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx index 7daca42..c04dbeb 100644 --- a/Source/cmElseCommand.cxx +++ b/Source/cmElseCommand.cxx @@ -73,6 +73,14 @@ bool cmElseCommand::InitialPass(std::vector<std::string> const& args) } } + if (args.size() == 2 && (args[0] == "EXISTS")) + { + if(cmSystemTools::FileExists(args[1].c_str())) + { + f = new cmIfFunctionBlocker(); + } + } + if (args.size() == 2 && (args[0] == "NOT")) { def = m_Makefile->GetDefinition(args[1].c_str()); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index f549e5c..83da56f 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -134,6 +134,14 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args) } } + if (args.size() == 2 && (args[0] == "EXISTS")) + { + if(!cmSystemTools::FileExists(args[1].c_str())) + { + f = new cmIfFunctionBlocker(); + } + } + if (args.size() == 3 && (args[1] == "AND")) { def = m_Makefile->GetDefinition(args[0].c_str()); diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index 9d8910f..d663253 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -115,7 +115,9 @@ public: return "IF (define) Starts an if block. Optionally it can be invoked " "using (NOT define) (def AND def2) (def OR def2) (def MATCHES def2) " - "MATCHES checks if def matches the regular expression def2 "; + "(COMMAND cmd) (EXISTS file) MATCHES checks if def matches the " + "regular expression def2. COMMAND checks if the cmake command cmd " + "is in this cmake executable. EXISTS file checks if file exists"; } cmTypeMacro(cmIfCommand, cmCommand); |