summaryrefslogtreecommitdiffstats
path: root/Source/cmExecProgramCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-06-23 20:34:38 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-06-23 20:34:38 (GMT)
commit2705b1bf736e5f98b0862e831fe9ab2799d1d0ee (patch)
tree4e3cc1d74fbae4c2f34df019f812f00a11b21b2a /Source/cmExecProgramCommand.cxx
parentdc4a6f63b0452968dc564be46909ed228bbc141c (diff)
downloadCMake-2705b1bf736e5f98b0862e831fe9ab2799d1d0ee.zip
CMake-2705b1bf736e5f98b0862e831fe9ab2799d1d0ee.tar.gz
CMake-2705b1bf736e5f98b0862e831fe9ab2799d1d0ee.tar.bz2
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.
Diffstat (limited to 'Source/cmExecProgramCommand.cxx')
-rw-r--r--Source/cmExecProgramCommand.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index b6159ea..66e0cd6 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -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;
}