cmake: Fix CTest custom commands

This commit is related to:
 - https://github.com/NixOS/nixpkgs/issues/762
 - http://public.kitware.com/Bug/view.php?id=13887
And fixes a bug present in recent CMake versions.

The fix should be integrated in the next CMake release.
This commit is contained in:
bbenoist 2013-08-20 10:26:54 +02:00 committed by Peter Simons
parent bef090400e
commit e13720c3c4
2 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,17 @@
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index e7491bb..57b4348 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1303,10 +1303,9 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
- std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
+ if ( !cmSystemTools::RunSingleCommand((*it).c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{

View File

@ -24,9 +24,13 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
patches =
# See https://github.com/NixOS/nixpkgs/issues/762
# and http://public.kitware.com/Bug/view.php?id=13887
# Remove this patch when a CMake release contains the corresponding fix
[ ./762-13887.patch ]
# Don't search in non-Nix locations such as /usr, but do search in
# Nixpkgs' Glibc.
optional (stdenv ? glibc) ./search-path.patch;
# Nixpkgs' Glibc.
++ optional (stdenv ? glibc) ./search-path.patch;
buildInputs = [ curl expat zlib bzip2 libarchive ]
++ optional useNcurses ncurses