[cmake-developers] Generator expressisons in target properties
Stephen Kelly
steveire at gmail.com
Sun Oct 28 13:09:25 EDT 2012
Stephen Kelly wrote:
> find_pacakge(Qt5Widgets REQUIRED)
> add_executable(foo main.cpp)
> target_link_libraries(foo Qt5::Widgets)
Oops, I meant
add_executable(foo WIN32 main.cpp)
here.
> For each target to build:
> compute the link closure
> For each build-property that has an INTERFACE_ variant:
> # eg COMPILE_DEFINITIONS, INCLUDE_DIRECTORIES
> for each target in the link closure:
> evaluate the INTERFACE_ variant of the property as a genex
> if uses $<TARGET_PROPERTY:LINK_LIBRARIES>:
> raise an error.
I made a mistake here. The INCLUDE_DIRECTORIES at least shouldn't be
determined by processing the targets in the link closure. At the least, that
wouldn't necessarily be the order wanted by the user. That should really be
determined by transitive evaluation of the generator expression in the
property value. It is only a requirement that this happens after computing
the link closure.
Thanks,
Steve.
More information about the cmake-developers
mailing list