2 IF (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
5 ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
7 # use pkg-config to get the directories and then use these values
8 # in the FIND_PATH() and FIND_LIBRARY() calls
12 FindPkgConfig(gtk-2.0 _GTK22IncDir _GTK22LinkDir _GTK22LinkFlags _GTK22Cflags)
14 # pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
15 # checks for given modules and uses the first working one
17 FIND_PATH(GTK2_GTK_INCLUDE_PATH gtk/gtk.h
21 /usr/local/include/gtk-2.0
23 /opt/gnome/include/gtk-2.0
27 # Some Linux distributions (e.g. Red Hat) have glibconfig.h
28 # and glib.h in different directories, so we need to look
30 # - Atanas Georgiev <atanas@cs.columbia.edu>
31 PKGCONFIG(glib-2.0 _GLIB2IncDir _GLIB2inkDir _GLIB2LinkFlags _GLIB2Cflags)
32 PKGCONFIG(gmodule-2.0 _GMODULE2IncDir _GMODULE2inkDir _GMODULE2LinkFlags _GMODULE2Cflags)
33 SET(GDIR /opt/gnome/lib/glib-2.0/include)
35 FIND_PATH(GTK2_GLIBCONFIG_INCLUDE_PATH glibconfig.h
37 /opt/gnome/lib64/glib-2.0/include
38 /opt/gnome/lib/glib-2.0/include
39 /opt/lib/glib-2.0/include
40 /usr/lib64/glib-2.0/include
41 /usr/lib/glib-2.0/include
42 /sw/lib/glib-2.0/include
44 #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
46 FIND_PATH(GTK2_GLIB_INCLUDE_PATH glib.h
49 /opt/gnome/include/glib-2.0
53 #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
55 FIND_PATH(GTK2_GTKGL_INCLUDE_PATH gtkgl/gtkglarea.h
59 /usr/openwin/share/include
65 PKGCONFIG(pango _PANGOIncDir _PANGOinkDir _PANGOLinkFlags _PANGOCflags)
67 FIND_PATH(GTK2_PANGO_INCLUDE_PATH pango/pango.h
69 /opt/gnome/include/pango-1.0
70 /opt/include/pango-1.0
71 /usr/include/pango-1.0
75 PKGCONFIG(gdk-2.0 _GDK2IncDir _GDK2inkDir _GDK2LinkFlags _GDK2Cflags)
77 FIND_PATH(GTK2_GDKCONFIG_INCLUDE_PATH gdkconfig.h
79 /opt/gnome/lib/gtk-2.0/include
80 /opt/gnome/lib64/gtk-2.0/include
81 /opt/lib/gtk-2.0/include
82 /usr/lib/gtk-2.0/include
83 /usr/lib64/gtk-2.0/include
84 /sw/lib/gtk-2.0/include
88 FIND_PATH(GTK2_GDK_INCLUDE_PATH gdk.h
91 /usr/include/gtk-2.0/gdk
93 #MESSAGE(STATUS "DEBUG: GTK2_GLIBCONFIG_INCLUDE_PATH = ${GTK2_GLIBCONFIG_INCLUDE_PATH}")
95 PKGCONFIG(cairo _CAIROIncDir _CAIROinkDir _CAIROLinkFlags _CAIROCflags)
97 FIND_PATH(GTK2_CAIRO_INCLUDE_PATH cairo.h
99 /opt/gnome/include/cairo
107 #MESSAGE(STATUS "DEBUG: GTK2_CAIRO_INCLUDE_PATH = ${GTK2_CAIRO_INCLUDE_PATH}")
109 PKGCONFIG(atk _ATKIncDir _ATKinkDir _ATKLinkFlags _ATKCflags)
111 FIND_PATH(GTK2_ATK_INCLUDE_PATH atk/atk.h
113 /opt/gnome/include/atk-1.0
118 #MESSAGE(STATUS "DEBUG: GTK2_ATK_INCLUDE_PATH = ${GTK2_ATK_INCLUDE_PATH}")
120 FIND_LIBRARY(GTK2_GTKGL_LIBRARY
134 FIND_LIBRARY(GTK2_GTK_LIBRARY
148 FIND_LIBRARY(GTK2_GDK_LIBRARY
162 FIND_LIBRARY(GTK2_GMODULE_LIBRARY
176 FIND_LIBRARY(GTK2_GLIB_LIBRARY
190 FIND_LIBRARY(GTK2_Xi_LIBRARY
203 FIND_LIBRARY(GTK2_GTHREAD_LIBRARY
217 FIND_LIBRARY(GTK2_GOBJECT_LIBRARY
230 IF(GTK2_GTK_INCLUDE_PATH)
231 IF(GTK2_GLIBCONFIG_INCLUDE_PATH)
232 IF(GTK2_GLIB_INCLUDE_PATH)
234 IF(GTK2_GLIB_LIBRARY)
235 IF(GTK2_PANGO_INCLUDE_PATH)
236 IF(GTK2_ATK_INCLUDE_PATH)
237 IF(GTK2_CAIRO_INCLUDE_PATH)
238 # Assume that if gtk and glib were found, the other
239 # supporting libraries have also been found.
243 SET(GTK2_INCLUDE_DIRS
244 ${GTK2_GTK_INCLUDE_PATH}
245 ${GTK2_GLIBCONFIG_INCLUDE_PATH}
246 ${GTK2_GLIB_INCLUDE_PATH}
247 ${GTK2_PANGO_INCLUDE_PATH}
248 ${GTK2_GDKCONFIG_INCLUDE_PATH}
250 ${GTK2_GDK_INCLUDE_PATH}
251 ${GTK2_ATK_INCLUDE_PATH}
252 ${GTK2_CAIRO_INCLUDE_PATH}
260 #${GTK2_GOBJECT_LIBRARY})
262 IF(GTK2_GMODULE_LIBRARY)
265 ${GTK2_GMODULE_LIBRARY}
267 ENDIF(GTK2_GMODULE_LIBRARY)
269 IF(GTK2_GTHREAD_LIBRARY)
272 ${GTK2_GTHREAD_LIBRARY}
274 SET(GTK2_LIBRARIES ${GTK2_LIBRARIES})
275 ENDIF(GTK2_GTHREAD_LIBRARY)
276 ELSE(GTK2_CAIRO_INCLUDE_PATH)
277 MESSAGE(STATUS "Can not find cairo")
278 ENDIF(GTK2_CAIRO_INCLUDE_PATH)
279 ELSE(GTK2_ATK_INCLUDE_PATH)
280 MESSAGE(STATUS "Can not find atk")
281 ENDIF(GTK2_ATK_INCLUDE_PATH)
282 ELSE(GTK2_PANGO_INCLUDE_PATH)
283 MESSAGE(STATUS "Can not find pango includes")
284 ENDIF(GTK2_PANGO_INCLUDE_PATH)
285 ELSE(GTK2_GLIB_LIBRARY)
286 MESSAGE(STATUS "Can not find glib lib")
287 ENDIF(GTK2_GLIB_LIBRARY)
288 ELSE(GTK2_GTK_LIBRARY)
289 MESSAGE(STATUS "Can not find gtk lib")
290 ENDIF(GTK2_GTK_LIBRARY)
291 ELSE(GTK2_GLIB_INCLUDE_PATH)
292 MESSAGE(STATUS "Can not find glib includes")
293 ENDIF(GTK2_GLIB_INCLUDE_PATH)
294 ELSE(GTK2_GLIBCONFIG_INCLUDE_PATH)
295 MESSAGE(STATUS "Can not find glibconfig")
296 ENDIF(GTK2_GLIBCONFIG_INCLUDE_PATH)
297 ELSE (GTK2_GTK_INCLUDE_PATH)
298 MESSAGE(STATUS "Can not find gtk includes")
299 ENDIF (GTK2_GTK_INCLUDE_PATH)
302 IF (NOT GTK2_FIND_QUIETLY)
303 MESSAGE(STATUS "Looking for gtk2... - found ${GTK2_LIBRARIES}")
304 ENDIF (NOT GTK2_FIND_QUIETLY)
306 IF (GTK2_FIND_REQUIRED)
307 MESSAGE(SEND_ERROR "Could NOT find GTK2")
308 ENDIF (GTK2_FIND_REQUIRED)
313 GTK2_GLIB_INCLUDE_PATH
315 GTK2_GLIBCONFIG_INCLUDE_PATH
319 GTK2_GTK_INCLUDE_PATH
321 GTK2_GTKGL_INCLUDE_PATH
323 GTK2_ATK_INCLUDE_PATH
324 GTK2_GDKCONFIG_INCLUDE_PATH
326 GTK2_GDK_INCLUDE_PATH
327 #GTK2_GOBJECT_LIBRARY
328 GTK2_PANGO_INCLUDE_PATH
330 GTK2_CAIRO_INCLUDE_PATH
334 ENDIF (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)