[cmake-developers] Setting include directories via target_link_libraries() ?

David Cole david.cole at kitware.com
Thu Dec 6 16:56:09 EST 2012


On Thu, Dec 6, 2012 at 3:37 PM, Stephen Kelly <steveire at gmail.com> wrote:

> Alexander Neundorf wrote:
>
> > Hi,
> >
> > I haven't followed the long thread between Brad and Stephen about
> > importing and exporting targets closely...
> >
> > So, if I understand correctly, in the future the following cmake code
> >
> > find_package(Foo)
> >
> > add_executable(hello main.cpp)
> >
> > target_link_libraries(hello ${Foo_LIBRARIES})
> >
> >
> > may also set include directories ?
>
> For reference, here is where the idea of using target_link_libraries for
> that came up:
>
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3083/focus=3093
>
> (though Clinton later said he liked target_use_targets).
>
> Here's a point where Alex raised a similar concern:
>
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/2145/focus=2154
>
> Here's where I changed my mind on whether we should use target_use_targets
> or target_link_libraries:
>
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5111
>
> I'm not sure what has changed since then.
>
> Thanks,
>
> Steve.
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>


What's changed since then is that we've seen how much change is needed for
the feature. And how tangled it all is...

This is going to be a venture which risks possibly breaking existing
projects for the convenience of those who are starting from scratch.

Since the risk on this one is high, we might want to reconsider whether it
would be better to use a new command entirely as the front-end for this
thing.

I'm not sure I like the name "target_use_targets", but I think a new
command, whatever it be named, is better than changing
target_link_libraries substantially in a "." release.

For 3.0, when we finally do go to a CMake 3.0 in the future, we could ask
the question whether it's safe to combine the two commands, once they've
both proven to work in practice.


Just my opinion,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121206/63fb5586/attachment.html>


More information about the cmake-developers mailing list