[CMake] How to find GTK3 in CMake

Eric Noulard eric.noulard at gmail.com
Wed Nov 21 04:22:15 EST 2018


Le mer. 21 nov. 2018 à 09:46, David Demelier <markand at malikania.fr> a
écrit :

> Le 20/11/2018 à 17:03, Harry Mallon a écrit :
> > Hi,
> >
> > FindGTK and FindGTK2 exist in the CMake tree. How come there isn't one
> for GTK3? Should the GTK2 one work, or is there another way?
>
> GNOME people don't like CMake (they use meson). The philosophy behind
> CMake is to let upstream projects provides their own CMake configuration
> packages rather than providing Find modules for every single library
> existing in the world.
>

Right and the fact is even traced here:
https://gitlab.kitware.com/cmake/cmake/issues/15888



>
> CMake should already not provide any of these, but this general
> recommendation came after.
>
> It's the same thing for pkg-config, pkg-config by itself does not
> provide any .pc file.
>
> Also, Gtk is much more tied to Linux than being portable. I think that's
> why portable software don't use Gtk that much and thus, not CMake either.
>

Some project nevertheless uses GTK3 and CMake so that you may borrow
hopefully working
FindGTK3.cmake module from them:
E.g.
Darktable:
https://redmine.darktable.org/projects/darktable/repository/changes/cmake/modules/FindGTK3.cmake
WebKit:
https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGTK3.cmake

and probably many others.
-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181121/51cf22cb/attachment-0001.html>


More information about the CMake mailing list