Ninja: shell escape $(CMAKE_SOURCE_DIR) and $(CMAKE_BINARY_DIR)
This commit is contained in:
parent
df847671b4
commit
848520859a
|
@ -78,10 +78,18 @@ void cmNinjaUtilityTargetGenerator::Generate()
|
||||||
|
|
||||||
// TODO: fix problematic global targets. For now, search and replace the
|
// TODO: fix problematic global targets. For now, search and replace the
|
||||||
// makefile vars.
|
// makefile vars.
|
||||||
cmSystemTools::ReplaceString(command, "$(CMAKE_SOURCE_DIR)",
|
cmSystemTools::ReplaceString(
|
||||||
this->GetTarget()->GetMakefile()->GetHomeDirectory());
|
command,
|
||||||
cmSystemTools::ReplaceString(command, "$(CMAKE_BINARY_DIR)",
|
"$(CMAKE_SOURCE_DIR)",
|
||||||
this->GetTarget()->GetMakefile()->GetHomeOutputDirectory());
|
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)", "");
|
cmSystemTools::ReplaceString(command, "$(ARGS)", "");
|
||||||
|
|
||||||
if (command.find('$') != std::string::npos)
|
if (command.find('$') != std::string::npos)
|
||||||
|
|
Loading…
Reference in New Issue