[cmake-developers] ExternalProject can't have interface library as a dependency

Brad King brad.king at kitware.com
Tue Apr 21 13:27:00 EDT 2015


On 04/21/2015 12:17 PM, Andrey Pokrovskiy wrote:
> I understand that, but I still don't understand why there is a need in
> file-level dependencies at all. When target level dependency will not
> be enough?

Each step of an external project has a timestamp file to track whether
it is up to date or not.  The "configure" step of an external project
gets a dependency on the "done" timestamp file of the EP's dependencies.
This way when an external project is updated and re-built then its
dependents get a chance to reconfigure and rebuild too.

> And what if I want to have a dependency on external project target in
> my code? Do I need to apply the same hack to also add a file-level
> dependency?

Often the ordering dependency is enough.  If you depend on library
files created by the external project then you can add dependencies
on them through other mechanisms like an IMPORTED library target.

-Brad



More information about the cmake-developers mailing list