[CMake] Custom Command Target Pre_Link

alexander at camek.de alexander at camek.de
Wed Oct 10 12:17:30 EDT 2007


Hi all,

I have a problem with a custom command.
This custom command should be called after all custom commands, so i decided to used the TARGET specific one with the option PRE_LINK. But when i run first cmake and then make, the custom command will not be build.

I use Linux and the command which I wrote looks similar to:
ADD_CUSTOM_COMMAND(TARGET FOO PRE_LINK
                   <do something>
                   COMMENT "Building for target foo")

I can't use a custom command with OUTPUT because i use the name (source files) already in a macro, so cmake will complain about that.

So the idea was to use this custom command with target as a postprocessing of my generated files (generated during macro use). The macro is for general use, so I can't put the custom command target into the macro, because sometimes I don't have postprocessing and sometimes the postprocess differ.

So now my questions:

1. Have I understand the docu correctly? Because my custom command target is never called. Even if i have forced a dependency with ADD_DEPENDENCIES!

2. Is there any other way I can do the postprocessing? What I don't want to use is a custom target with ADD_CUSTOM_TARGET, because the postprocess should only be invoked when the files have changed and the postprocessed files should be deleted when i call clean.

Any help would be recommended.

Greetings

Alexander


More information about the CMake mailing list