[CMake] How does :: actually works?

Klaim - Joël Lamotte mjklaim at gmail.com
Wed Jun 17 16:40:20 EDT 2015


On 17 June 2015 at 20:50, Stephen Kelly <steveire at gmail.com> wrote:

> Klaim - Joël Lamotte wrote:
>
> > I didn't realize at all that the FindPackage way is supposed to be
> > obsolete now.
>
> It is not obsolete, but it is not a good approach (since CMake 2.6.0
> already) if the upstream uses cmake, because config file packages provide a
> better experience for downstreams
>
>  http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html
>
> Even for upstreams that do not use cmake, it is preferable to generate
> config file packages for a good downstream experience for cmake users. That
> is what Qt qmake and LLVM Makefile buildsystems do. Boost b2 could do it
> too:
>
>  http://thread.gmane.org/gmane.comp.lib.boost.devel/259011/focus=259445


I remember the discussion but did not realize that it was a tool supposed
to be useful
for any project.
Thinking about boost, if package files works well with header-only
libraries (which I
suppose it should as long as the boost define header-only targets)
then it would be very useful indeed.

By the way, in one of my project I end up using one FindBoost call with all
the components
needed by all the libraries of the project. I do this to avoid having to
call FindBoost
separately for every library with different components (still using the
COMPONENTS option
listing what the whole project needs).
Then I have to have all my libraries to link with all the boost libraries
listed in the boost
library variable generated by FindBoost.
If I understand correctly, if FindBoost was supporting imported targets and
using "Boost" as a
namespace (like Qt does), then I could link my libraries to boost libraries
in a more
precise way as I would link each library separately instead of everything
FindBoost
put in the boost libraries variable.
Is my understanding correct?


>
>
> > I'm quite surprised actually.
>
> We prefer not to accept new Find modules into the cmake tree because that
> puts the maintenance burden on us, and because it is an inferior user
> experience. Some new Find modules still get in, but they need to have a
> reason to get in.
>
> > Ok I'll check PackageConfig.cmake for my new and even current projects
> > if it can help with managing the tons of libraries I work on.
>
> Do please let us know how that goes.
>

I will.


>
> > I will consider providing patches, if I can spend time on this once and
> > not bother
> > later it would help a lot.
>
> Documentation here explains how to do that for Find modules:
>
>
> http://www.cmake.org/cmake/help/v3.2/manual/cmake-developer.7.html#a-sample-find-module
>
> Thanks,
>

Thanks for the pointer.


>
> Steve.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150617/8eae0481/attachment-0001.html>


More information about the CMake mailing list