Commit 84852085 authored by Peter Collingbourne's avatar Peter Collingbourne

Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR)

parent df847671
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment