mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 22:50:26 -06:00
BUG: fix spaces in path on mingw, and change EXEC_PROGRAM to return false when it does not run, also do not convert the directory to an output path for EXEC_PROGRAM as this is done by the process execution, and doing it twice may cause trouble on some shells.
This commit is contained in:
@@ -88,7 +88,7 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args)
|
||||
std::string command;
|
||||
if(arguments.size())
|
||||
{
|
||||
command = cmSystemTools::ConvertToOutputPath(args[0].c_str());
|
||||
command = cmSystemTools::ConvertToRunCommandPath(args[0].c_str());
|
||||
command += " ";
|
||||
command += arguments;
|
||||
}
|
||||
@@ -103,15 +103,16 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args)
|
||||
}
|
||||
int retVal = 0;
|
||||
std::string output;
|
||||
bool result = true;
|
||||
if(args.size() - count == 2)
|
||||
{
|
||||
cmSystemTools::MakeDirectory(args[1].c_str());
|
||||
cmSystemTools::RunCommand(command.c_str(), output, retVal,
|
||||
cmSystemTools::ConvertToOutputPath(args[1].c_str()).c_str(), verbose);
|
||||
result = cmSystemTools::RunCommand(command.c_str(), output, retVal,
|
||||
args[1].c_str(), verbose);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmSystemTools::RunCommand(command.c_str(), output, retVal, 0, verbose);
|
||||
result = cmSystemTools::RunCommand(command.c_str(), output, retVal, 0, verbose);
|
||||
}
|
||||
|
||||
if ( output_variable.size() > 0 )
|
||||
@@ -138,6 +139,6 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args)
|
||||
m_Makefile->AddDefinition(return_variable.c_str(), buffer);
|
||||
}
|
||||
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user