[CMake] Adding custom target to ALL_BUILD or Package

Eric Noulard eric.noulard at gmail.com
Thu Jan 13 07:08:50 EST 2011


2011/1/13  <ariasgore at gmx.de>:
> Hello,
> I have a doxygen custom target defined which works fine when executed manually in visual studio but since it is a custom command it is not added as dependency to ALL_BUILD

you can add it to ALL if you specify ALL in add_custom_target:

"add_custom_target(Name [ALL] [command1 [args1...]]
                           [COMMAND command2 [args2...] ...]
                           [DEPENDS depend depend depend ... ]
                           [WORKING_DIRECTORY dir]
                           [COMMENT comment] [VERBATIM]
                           [SOURCES src1 [src2...]])

If the ALL option is
       specified it indicates that this target should be added to the default
       build target so that it will be run every time."

> and manually adding it as a dependency to PACKAGES fails.

Unfortunately you cannot add dependencies to "builtin" target
>
> Is there a way to do that without the need of defining an extra target which has my doxygen step and the package step as dependency?

Add another custom command which execute both your doxygen target AND
the builtin package one.

and may be vote for this bug/feature
http://public.kitware.com/Bug/view.php?id=8438
on next CMake version call vote for "high-in-my-opinion-to-be-fixed-bug"

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list