[CMake] Help with custom targets

Bill Hoffman bill.hoffman at kitware.com
Sat Mar 3 12:55:23 EST 2007


Ulrik Mikaelsson wrote:
> Yes, that seems to work, with the unfortunate side-effect of having my
> binary application unnecessarily re-built every time I change my EDC,
> which might not be a big problem, but a bit annoying.
>
> Is there no way of specifying an equivalent of:
> all: showroom data/interface.edj
>
> showroom: main.c
>    $(CC) -o showroom main.c
>
> data/interface.edj: data/interface.edc
>     edje_cc data/interface.edc data/interface.edj
>
> That is, what I'd really want would be to define a custom target,
> linked to a file with dependencies, and a rule to build the target if
> the dependencies are newer than the target file. Pretty much the
> standard use-case of make, but preferably without hooking up the
> dependency-chain on a certain executable or library. In the end, I
> would like to be able to run "make data/interface.edj".

You can do that with a custom target, but if a .h file changes that is 
included by main.c, then main.o will be recompiled.

-Bill



More information about the CMake mailing list