If a target is listed, it will be brought up to date any time the custom command’s output files are required to brought up to date.
Can I have an example for this?
What is the difference between this:
project(MyProj)
add_custom_target( tgt2 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/object2 )
add_custom_command( OUTPUT object2
COMMAND ${CMAKE_COMMAND} -E touch object2
DEPENDS tgt1
)
add_custom_target( tgt1 )
and this:
project(MyProj)
add_custom_target( tgt2 ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/object2 )
add_custom_command( OUTPUT object2
COMMAND ${CMAKE_COMMAND} -E touch object2
)
add_custom_target( tgt1 )
add_dependencies( tgt2 tgt1 )
I am trying to figure out a use case for the former, as I am always using the latter. What is the difference between a week dependency of a target and a strong dependency of a target, since custom targets are always considered out of date?