A traditional make process that I cannot modify produces a target on which I must do some post-processing.
I use add_custom_target
to force the makefile to
Make the add_custom_command call depend on a file that changes when "the external make actually updated its target." The custom command will only run if one of its DEPENDS is newer than its OUTPUT.
The DEPENDS for CMake add_custom_command calls work best with older versions of CMake when they are full path file name references. More recent versions of CMake should work with file name or CMake target name references.