diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 0b8c85d9d..ab2d676f1 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -51,10 +51,10 @@ bool cmExecProgramCommand::InitialPass(std::vector const& argsIn) return false; } std::string output; - m_Makefile->ExpandVariablesInString(args[0]); - m_Makefile->ExpandVariablesInString(args[1]); + m_Makefile->ExpandVariablesInString(args[0]); if(args.size() == 2) { + m_Makefile->ExpandVariablesInString(args[1]); cmSystemTools::MakeDirectory(args[1].c_str()); std::string command; command = "cd ";