[cmake-developers] IMPORTED targets for some Find modules
Stephen Kelly
steveire at gmail.com
Wed Jun 25 10:13:19 EDT 2014
Philipp Moeller wrote:
> Stephen Kelly <steveire at gmail.com> writes:
>> If you populate the INTERFACE_INCLUDE_DIRECTORIES on each component
>> IMPORTED target, what can go wrong?
>
> On a non-modularized build I will need to populate it with
> Boost_INCLUDE_DIR as we don't do detection of different include
> directories yet. This would allow users to accidentally use headers from
> a different component.
Please correct me where I go wrong here:
1) All boost releases (including the next one) are monolithic
2) So there is only one Boost_INCLUDE_DIR
3) So, different components don't have different usage-include-directories
Are you talking about a scenario where there are multiple different Boost
installations found at different prefixes?
Or what do you mean about 'accidentally using headers from a different
component'?
> The way it is done now, users will be aware that
> they bring in all includes and know what to change if they wish to use a
> modular Boost.
add_executable(foo main.cpp)
target_link_libraries(foo Boost::thread)
should 'just work' without having to add another target to provide the
include dir.
I don't understand what you're saying or arguing for here, but if Brad does
I guess he'll merge it :).
> If you build a library using foo.cpp it will contain the glVertex2i
> symbol even though its headers wont include it. Likewise a consumer of
> that library does not need to have the headers,
> but will need to link against a library containing the symbol.
Ah, I guess we're talking about static libraries here.
Thanks,
Steve.
More information about the cmake-developers
mailing list