Преглед на файлове

expand vars nwo for exists test

Ken Martin преди 24 години
родител
ревизия
d163cb7014
променени са 2 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 3 1
      Source/cmElseCommand.cxx
  2. 3 1
      Source/cmIfCommand.cxx

+ 3 - 1
Source/cmElseCommand.cxx

@@ -75,7 +75,9 @@ bool cmElseCommand::InitialPass(std::vector<std::string> const& args)
 
   if (args.size() == 2 && (args[0] == "EXISTS"))
     {
-    if(cmSystemTools::FileExists(args[1].c_str()))
+    std::string tmp = args[1];
+    m_Makefile->ExpandVariablesInString(tmp);
+    if(cmSystemTools::FileExists(tmp.c_str()))
       {
       f = new cmIfFunctionBlocker();
       }

+ 3 - 1
Source/cmIfCommand.cxx

@@ -136,7 +136,9 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args)
 
   if (args.size() == 2 && (args[0] == "EXISTS"))
     {
-    if(!cmSystemTools::FileExists(args[1].c_str()))
+    std::string tmp = args[1];
+    m_Makefile->ExpandVariablesInString(tmp);
+    if(!cmSystemTools::FileExists(tmp.c_str()))
       {
       f = new cmIfFunctionBlocker();
       }