[cmake-developers] $<BUILD_INTERFACE> genex regression

Brad King brad.king at kitware.com
Fri Oct 10 09:14:57 EDT 2014


On 10/10/2014 05:09 AM, Nils Gladitz wrote:
>    set(LIBRARIES
>        foobar.lib
>        barfoo.lib
>    )
> 
>    add_executable(foo foo.cpp)
>    target_link_libraries(foo PUBLIC $<BUILD_INTERFACE:${LIBRARIES}>)

This is basically writing:

 target_link_libraries(foo PUBLIC $<BUILD_INTERFACE:foobar.lib barfoo.lib>)

which was never intended to be supported.  It worked only as an accident
of the 3.0 implementation.  In 2.8.12.2 it did not work.

> I can work around this by wrapping the libraries with $<BUILD_INTERFACE> 
> individually or by quoting the entire genex.

This was the intended interface.

I'm willing to regress this because:

- It restores 2.8.12 behavior
- The quoting is easy to do
- It is very hard to fix this without un-doing all the other
  improvements enabled by the refactoring that broke this.

I will add mention of this in the 3.1 release notes.

Thanks,
-Brad



More information about the cmake-developers mailing list