[CMake] Unable to find GTK with cmake on Ubuntu

Timothy M. Shead tshead at k-3d.com
Thu Dec 18 20:05:02 EST 2008


Pierrick Grasland wrote:

> I'm testing CMake with a little project, but I encounter a problem with GTK.

> I was building with autotools and pkg_config before, so I know I have
> GTK+-2.0 on my system.

Since pkg-config is the "officially supported" way to obtain GTK
dependencies and compiler flag (I believe it was designed by many of the
same developers), I find that using CMake's pkg-config module works best
(even on Win32).  See the documentation at

http://www.cmake.org/cmake/help/cmake2.6docs.html#module:FindPkgConfig

and try something along the lines of

find_package(PkgConfig)
pkg_check_modules(GTK gtk+-2.0)
include_directories(${GTK_INCLUDE_DIRS})

...etc

Cheers,
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tshead.vcf
Type: text/x-vcard
Size: 168 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081218/f3c9a072/attachment.vcf>


More information about the CMake mailing list