Generator expressions don't work nicely for target_link_libraries if the linked library is in the form "-framework FrameworkName"
For reasons that are too involved to list here I am in the situation where I need to use:
target_link_libraries(MyTarget PRIVATE "-framework AppKit")
instead of
target_link_libraries(MyTarget PRIVATE "$<LINK_LIBRARY:FRAMEWORK,AppKit>")
Unfortunately this breaks down when I have to use conditionals such as:
target_link_libraries(MyTarget PRIVATE $<$<PLATFORM_ID:Darwin>:"-framework AppKit">)
since in this case "-framework AppKit" will be considered a library name and the linker will be called with -l-framework\ AppKit
instead of -framework AppKit
.
This happens with the Xcode generator.