[cmake-developers] ninja spaces in the path do not work on linux

Bill Hoffman bill.hoffman at kitware.com
Fri Feb 17 17:59:25 EST 2012


If I edit the build.ninja file directly:

this:
ident21 = /media/Work/My\ Builds/cmake/Utilities/KWIML/test/test.c
to this:
ident21 = /media/Work/My$ Builds/cmake/Utilities/KWIML/test/test.c

Then it does not complain about test.c.  So it seems like the place to 
fix this would be where it rights out the path to the sources and to 
replace the "\ " stuff with "$ ".  Or the place that puts in the "\ " 
and use $ instead of \ to escape the spaces  in the first place.

As a quick hack I tried this:

std::string cmNinjaTargetGenerator::ConvertToNinjaPath(const char *path) 
const
{
   std::string p = this->LocalGenerator->Convert(path,
 
cmLocalGenerator::HOME_OUTPUT,
 
cmLocalGenerator::MAKEFILE);
   cmSystemTools::ReplaceString(p, "\\ ", "$ ");
   return p;
}

It got further but got hung up on Docs/ctest.txt.  That is from a custom 
command so it must be calling something else to convert to paths for 
those...

-Bill



More information about the cmake-developers mailing list