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

Andrey Pokrovskiy wonder.mice at gmail.com
Tue Apr 21 12:17:43 EDT 2015


Thanks for fixing that, Brad!

>> Why there is a special case when dependency is also an external project?
>
> When one external project depends on another then we add both
> the target-level ordering dependencies (add_dependencies) and
> add file-level dependencies on the stamp files so that things
> re-run when needed.

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?
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?

On Tue, Apr 21, 2015 at 8:38 AM, Brad King <brad.king at kitware.com> wrote:
> On 04/21/2015 03:34 AM, Andrey Pokrovskiy wrote:
>> CMake Error at /usr/share/cmake/share/cmake-3.2/Modules/ExternalProject.cmake:2031
>> (get_property):
>>   INTERFACE_LIBRARY targets may only have whitelisted properties.  The
>>   property "_EP_IS_EXTERNAL_PROJECT" is not allowed.
>> Call Stack (most recent call first):
>>   /usr/share/cmake/share/cmake-3.2/Modules/ExternalProject.cmake:2328
>> (_ep_add_configure_command)
>>   src/libwebsockets/CMakeLists.txt:21 (ExternalProject_Add)
>
> Fixed:
>
>  ExternalProject: Allow dependencies on INTERFACE libraries
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bce6c5d
>
>> My first idea was that having a whitelist for get_property() is
>> probably not that good idea.
>
> The idea is to restrict INTERFACE libraries as much as possible to
> intended use cases so we can expand later without breaking projects
> depending on undefined behavior.
>
>> Why there is a special case when dependency is also an external project?
>
> When one external project depends on another then we add both
> the target-level ordering dependencies (add_dependencies) and
> add file-level dependencies on the stamp files so that things
> re-run when needed.
>
> -Brad


More information about the cmake-developers mailing list