[CMake] How to build a target on install (only)?

Paul Smith paul at mad-scientist.net
Mon Feb 16 09:25:57 EST 2015


On Sun, 2015-02-15 at 18:26 -0600, Iosif Neitzke wrote:
> For conditional file install, you could try something like "cmake -E
> copy_if_different".

That won't work; I don't have any files to copy.  What I want is to run
the dsymutil command during install only, not during the normal build
(because it's slow), but only if the binary that was installed has
changed.

copy_if_different won't help here.

> On Sun, Feb 15, 2015 at 1:59 PM, Paul Smith <paul at mad-scientist.net> wrote:
> >   install(CODE "message(STATUS \"Creating dSYM for ${target} in ${dir}\")")
> >   install(CODE "execute_process(COMMAND dsymutil \"${dir}/${target}\" OUTPUT_QUIET)")





More information about the CMake mailing list