I am trying to create a custom target which creates a downloadable image after linking.
I have an executable target, let’s call it some_ELF. I want to produce an image using an objcopy variant (diab compiler’s ddump, however).
add_executable ( “some_ELF” <file list> )
add_custom_command ( OUTPUT “some_bin”, COMMAND "ddump <options> -o “some_bin”* ), DEPENDS some_ELF )
add_custom_target ( “BIN” DEPENDS “some_bin” )
First works well, more or less (my other post regarding IO redirect).
Third apparently also works. I get a corresponding directory under <BUILD>/CmakeFiles/. When I inspect build.make, I can see that BIN is added as .PHONY target.
Second does not show up in the entire <BUILD> tree. No rule is created to execute ddump … in dependency of some_ELF producing some_BIN
It appears that cmake does not properly connects (or, more likely, I havent configured it to do so) the .PHONY target with the file created by the custom command.
What am I missing?