Is it possible to write a generator expression at any point that varies the output based on a property coming from being linked to something?
Such that in the following
add_library(widgets ...) add_library(mouse ...) ... add_library(input ...) target_link_library(input PUBLIC $<IF:$<LINKAGE_INCLUDES:mouse>,widgets>) add_executable(app ...) target_link_libraries(app PUBLIC input mouse)
automatically links ‘input’ against ‘widgets’ because ‘mouse’ is present?
And is it possible to write a condition based on a property that is being gained as above by inheritance (so I don’t know the target name, its the name of the thing that asked to link me against it)
if (NOT HEADLESS) set_property(TARGET some_other_target NEEDS_WIDGETS ON) endif () ... target_link_libraries(mouse PUBLIC $<IF:$<INHERITED_PROPERTY:NEEDS_WIDGETS>,widgets>)
such that mouse implies widgets but only when ‘some_other_target’ is in the link chain?