[CMake] How to add dependencies to ExternalProject_Add()

Rolf Eike Beer eike at sf-mail.de
Mon Mar 28 17:25:44 EDT 2011


I wrote:
> David Cole wrote:

> > I am not sure I like this patch, or not. I'm on the fence.
> > 
> > I would recommend just using:
> >   ExternalProject_Add(xyz ...)
> >   add_dependencies(xyz mylib)
> > 
> > to add non-ExternalProject dependencies. Just to make it clear that the
> > dependencies are target-level dependencies and not file dependencies.
> 
> This only "sort-of" works. If I delete the library from the build try
> (only the .so) and rebuild the external project does not get relinked.
> Also the documentation of ExternalProject_Add says:
> 
>   [DEPENDS projects...]       # Targets on which the project depends
> 
> No word that these need to be file-level dependencies. In fact since
> ExternalProject.cmake unconditionally uses the _EP_STAMP_DIR property of
> the target this will only work with ExternalProject targets at all (not
> even file level dependencies) which looks just wrong to me.

Here is the patch in case you are going to apply it.

Eike


More information about the CMake mailing list