I think you should be using ${TEST_OUTPUT} as the dependency of test_file2.txt. I don’t follow why you wouldn’t. By itself " DEPENDS gen_test_file
" just means that a target dependency will be made. But the command itself isn’t dependent upon anything. It’ll just run the first time to create test_file2.txt and once that’s done it’ll never run again. It probably should be "DEPENDS gen_test_file ${TEST_OUTPUT}
. This creates the target dependency and then if ${TEST_OUTPUT} changes it should run again.
It was recently stated again that “Custom targets don’t have outputs”. unable to get target location. The documentation confirms this “The target has no output file”. What is " $<TARGET_PROPERTY:gen_test_file,GENERATED_FILE>
supposed to evaluate to? I couldn’t file that property listed in the documentation. What is it supposed to be copying? I understand that certain generators implement stamp files and such that seems to be an implementation detail and not a real “output” to be depended upon.