diff options
author | Brad King <brad.king@kitware.com> | 2007-03-08 16:49:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-03-08 16:49:30 (GMT) |
commit | 7157743d69761c433af5ecbca37dede63c0603af (patch) | |
tree | 46701d6a389aa5725df5acce2da9197a39845ee1 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 91c2b84a92a7cff0bbfc253e8937dd4832690bf7 (diff) | |
download | CMake-7157743d69761c433af5ecbca37dede63c0603af.zip CMake-7157743d69761c433af5ecbca37dede63c0603af.tar.gz CMake-7157743d69761c433af5ecbca37dede63c0603af.tar.bz2 |
ENH: Updated GetRecursiveMakeCall to use EscapeForShell instead of MAKEFILE conversion. This code is special because it is the only place that a make target name is passed on a command line.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index d3a2f2e..a9c9c68 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1745,17 +1745,15 @@ cmLocalUnixMakefileGenerator3 // Add the target. if (tgt && tgt[0] != '\0') { - std::string tgt2 = this->Convert(tgt,HOME_OUTPUT,MAKEFILE); - // for make -f foo bar, foo is a file but bar (tgt2) is - // a make target. make targets should be escaped with "" - // and not \, so if we find a "\ " in the path then remove - // the \ and quote the whole string - if(tgt2.find("\\ ") != tgt2.npos) - { - cmSystemTools::ReplaceString(tgt2, "\\", ""); - tgt2 = std::string("\"") + tgt2 + std::string("\""); - } - cmd += tgt2; + // The make target is always relative to the top of the build tree. + std::string tgt2 = this->Convert(tgt, HOME_OUTPUT); + + // The target may have been written with windows paths. + cmSystemTools::ConvertToOutputSlashes(tgt2); + + // The target name is now a string that should be passed verbatim + // on the command line. + cmd += this->EscapeForShell(tgt2.c_str(), true, false); } return cmd; } |