summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaUtilityTargetGenerator.cxx
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-03-17 20:55:09 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2012-03-17 23:16:40 (GMT)
commit848520859afebb3353a91561725e4e96b48a6c35 (patch)
tree0d9b085f4cdc9ac12445719cee22e3ed58799d79 /Source/cmNinjaUtilityTargetGenerator.cxx
parentdf847671b43f35162570db1e6f2801bc3b2de11a (diff)
downloadCMake-848520859afebb3353a91561725e4e96b48a6c35.zip
CMake-848520859afebb3353a91561725e4e96b48a6c35.tar.gz
CMake-848520859afebb3353a91561725e4e96b48a6c35.tar.bz2
Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR)
Diffstat (limited to 'Source/cmNinjaUtilityTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 8eeca77..9c2fd13 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -78,10 +78,18 @@ void cmNinjaUtilityTargetGenerator::Generate()
// TODO: fix problematic global targets. For now, search and replace the
// makefile vars.
- cmSystemTools::ReplaceString(command, "$(CMAKE_SOURCE_DIR)",
- this->GetTarget()->GetMakefile()->GetHomeDirectory());
- cmSystemTools::ReplaceString(command, "$(CMAKE_BINARY_DIR)",
- this->GetTarget()->GetMakefile()->GetHomeOutputDirectory());
+ cmSystemTools::ReplaceString(
+ command,
+ "$(CMAKE_SOURCE_DIR)",
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->GetTarget()->GetMakefile()->GetHomeDirectory(),
+ cmLocalGenerator::SHELL).c_str());
+ cmSystemTools::ReplaceString(
+ command,
+ "$(CMAKE_BINARY_DIR)",
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->GetTarget()->GetMakefile()->GetHomeOutputDirectory(),
+ cmLocalGenerator::SHELL).c_str());
cmSystemTools::ReplaceString(command, "$(ARGS)", "");
if (command.find('$') != std::string::npos)