[CMake] How does :: actually works?
Johannes Zarl-Zierl
johannes.zarl-zierl at jku.at
Tue Jun 16 05:49:22 EDT 2015
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].
> 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.
Cheers,
Johannes
[1] http://www.cmake.org/Wiki/CMake:Module_Maintainers#List
[2] http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages
More information about the CMake
mailing list