[CMake] Postprocessing output of add_custom_command

Iwan Aucamp aucampia at gmail.com
Mon Dec 21 16:50:43 EST 2009


Hi

I am looking for a way to chain two custom commands added to a target.

To be more precise I am trying to use objdump + objcopy to add a section 
to a target if it does not already exist - if objdump -h outputs the 
header to be added then objcopy is not performed - but if it does not 
output the header to be added then objcopy is done.

Using plain gnu makefiles this is done with objdump ... | grep <header>; 
if [failed]; then objcopy ...embedheader...; fi;

Is there a way to do this with cmake except for using /bin/sh -c '...'?

regards


More information about the CMake mailing list