diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 15197ba27c..35c8367fe7 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -161,10 +161,6 @@ void cmNinjaUtilityTargetGenerator::WriteUtilBuildStatements( cmSystemTools::ReplaceString(command, "$(ARGS)", ""); command = gg->ExpandCFGIntDir(command, config); - if (command.find('$') != std::string::npos) { - return; - } - std::string ccConfig; if (genTarget->Target->IsPerConfig() && genTarget->GetType() != cmStateEnums::GLOBAL_TARGET) { diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index c145907a1b..d492811218 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -412,6 +412,10 @@ add_custom_target(do_check_command_line ALL COMMENT "Checking custom target command line escapes ($dollar-signs$)" ) add_dependencies(do_check_command_line check_command_line) +add_custom_command(TARGET do_check_command_line POST_BUILD VERBATIM + COMMAND ${CMAKE_COMMAND} -E echo "POST_BUILD command with $dollar-signs$" + COMMENT "Checking custom target POST_BUILD command line escapes ($dollar-signs$)" +) add_custom_target(pre_check_command_line COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt