paul wrote:
Yea, I dont think we should mangle the logical target name at all. The user should be able to write `target_link_libraries(lib boost::foo)` and that should work for either static, shared, or header-only.
As we already discussed, sl/dl/hl have the problem that when a non-header-only library links to a header-only one which in turn links to a non-header-only one, the sl/dl of the first one should propagate to the third, which is problematic if the second has to be -hl. The way this works in Boost.Build is that the user indeed writes the equivalent of the above, and then the link=static property is propagated to the dependencies. If there's a library that has an optional header-only mode, this is not encoded as link=header, but as define=BOOST_BAR_HEADER_ONLY. That is, when you have foo depending on bar depending on baz, the link=static;define=BOOST_BAR_HEADER_ONLY property set is propagated from foo to bar to baz and everything works more or less as expected.