Ninja: Ampersand symbol not handled correctly in windows POST_BUILD command
When adding POST_BUILD command on windows the Ninja generator creates a nested cmd.exe call. If there is an ampersand symbol in the POST_BUILD command it will treat the remaining line as a new command.
Example:
cmake_minimum_required(VERSION 3.16)
project(ampersand_test CXX)
add_executable(ampersand_target
project/foo.cpp
)
add_custom_command(TARGET ampersand_target
POST_BUILD
COMMAND "${CMAKE_SOURCE_DIR}/ampersand&folder/hello.bat"
)