How can I tell CMake that missing outputs should be reported as errors?
I have a CMakeLists file with custom targets in it and would like to flag typos as build errors.
add_custom_command(
OUTPUT Hello.txt
COMMAND echo Hello > Greeting.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(Hello ALL DEPENDS Hello.txt)
This is in error as the OUTPUT Hello.txt is never produced and the custom command will run every time.
How can I tell CMake that missing outputs should be reported as errors?