[CMake] How does :: actually works?

Klaim - Joël Lamotte mjklaim at gmail.com
Wed Jun 17 08:09:39 EDT 2015


On 16 June 2015 at 11:49, Johannes Zarl-Zierl <johannes.zarl-zierl at jku.at>
wrote:

> On Monday 15 June 2015 22:43:41 you wrote:
> > Just a last question: I assume that most find module scripts distributed
> > with cmake are
> > not using this feature at the moment, right?
>
> Sadly, no.
>
> > After reading your explaination I looked at documentation for FindBoost
> and
> > FindGTest
> > which are both used in all my projects and they dont seem to provide
> import
> > targets.
> > Are there plans to update the cmake scripts distributed with CMake
>
> On the one hand, FindPackage modules are, as far as I'm aware, slowly being
> updated to use imported targets. On the other hand, quite a few packages
> are
> missing a maintainer[1]. If you are using a package and want it to provide
> imported targets, I think your best bet is to propose a patch for the
> module
> and get it into cmake.
>
> That said, its worth mentioning that FindPackage modules are only intended
> for
> "legacy" projects which do not provide a PackageConfig.cmake file. If you
> are
> writing a new project, especially if it's based on cmake, you should write
> a
> PackageConfig.cmake file instead [2].
>
>
I didn't realize at all that the FindPackage way is supposed to be obsolete
now.
I'm quite surprised actually.
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.


> > or is it just assumed that projects willing to use importing targets will
> > write them somewhere before using them?
>
> Creating imported targets on your own is not the way to go. Better file a
> bug
> report or write a patch to add the functionality and get that into cmake.
> IMO, until the official module provides imported targets, you're better
> off using
> the old way.
>
>
I will consider providing patches, if I can spend time on this once and not
bother
later it would help a lot.

Thanks again for these explainations.


> Cheers,
>   Johannes
>
> [1] http://www.cmake.org/Wiki/CMake:Module_Maintainers#List
> [2] http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150617/93c250f4/attachment-0001.html>


More information about the CMake mailing list