I'm using a custom target in a CMake file of mine, which looks like this:
add_custom_target(generated_bar
COMMAND ${CMAKE_COMMAND} -DOUT=bar -P generate-bar.cmake
BYPRODUCTS bar
COMMENT "Generating bar from foo"
SOURCES foo)
This works fine for me, and bar
gets generated. However, if I make generated_bar
again - bar
gets generated again, even though the source file foo
has not changed.
Why is this happening?
Note: This question is related.