[cmake-developers] Moving from Module to Target-based linking

Ryan Pavlik ryan.pavlik at gmail.com
Thu Oct 8 08:58:33 EDT 2015


That's an interesting script. If you look at the bundled modules, some are
gradually being converted to use imported targets: off the top of my head,
I know glut is one. Not sure a template like yours will make it into the
standard distribution, there are just too many special cases and weird
libraries, but it certainly could be helpful in the conversion process.

One bug I noticed in your template: while it's converting frameworks to
link differently (a catch I recently hit, as apparently linking to the
library symlinks by full path no longer works), it's also stripping all
location information from them, so it will only work with frameworks
already in the search path, if I'm not mistaken.

Happy to learn the correct way to make an imported target for a found
framework if someone cares to enlighten :)

Ryan

On Wed, Oct 7, 2015, 3:04 AM Daniel Wirtz <
daniel.wirtz at simtech.uni-stuttgart.de> wrote:

> Hey all,
>
> is there any development going on towards providing FindXXX.cmake
> wrapper modules that "convert" MODULE-mode results into CONFIG style
> imported targets to consume?
> correct me if i'm wrong here, but as more and more projects are being
> cmake'ified and the config-mode is far more robust to
> manage package-interdependencies, wouldn't it fuel this progress if
> there was some sort of automatic imported target creation possible?
>
> i've attached a template that is cmake-configured and has thus far been
> able to work with all the 3rd party packages we've got involved (it's
> also got some specific stuff - ignore).
> it basically invokes the module mode and sets found libraries and paths
> to an imported target (named after what was looked for)
> which then can be consumed, much like the generated config files do.
>
> if this is of general interest, i'm happy for some feedback and
> suggestions how that could be of use in CMake.
>
> - Daniel
>
> --
> Dr. Daniel Wirtz
> Dipl. Math. Dipl. Inf.
> SRC SimTech
> Pfaffenwaldring 5a
> +49 711 685 60044
>
> --
>
> 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-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151008/af9f36e3/attachment.html>


More information about the cmake-developers mailing list