[CMake] Re: ADD_CUSTOM_TARGET not behaving as advertized?

Brad King brad.king at kitware.com
Wed Aug 3 16:13:32 EDT 2005


Chris Green wrote:
>> Read the documentation for ADD_DEPENDENCIES.  It is meant for use only 
>> between top-level targets (added with ADD_LIBRARY, ADD_EXECUTABLE, or 
>> ADD_CUSTOM_TARGET).
> 
> 
> OK, thanks for the clarification. I had read the ADD_DEPENDENCIES 
> documentation, but I'd read it in a slightly different way, viz:

I've re-written the documenation:

-------------------------------------------------------------------------
ADD_DEPENDENCIES
    Add a dependency between top-level targets.

      ADD_DEPENDENCIES(target-name depend-target1
                       depend-target2 ...)

    Make a top-level target depend on other top-level targets.  A
    top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, or
    ADD_CUSTOM_TARGET.  Adding dependencies with this command can be used
    to make sure one target is built before another target.  See the
    DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND for adding
    file-level dependencies in custom rules.  See the OBJECT_DEPENDS
    option in SET_SOURCE_FILES_PROPERTIES to add file-level dependencies
    to object files.
-------------------------------------------------------------------------

> Having said that, please consider this a feature request: it would
> certainly be nice to be able to use ADD_DEPENDENCIES to do exactly what
> my clarified wording above says you can't right now.

You can add this to the bug tracker:

http://www.cmake.org/Bug

-Brad


More information about the CMake mailing list