1 # - try to find GTK (and glib) and GTKGLArea
2 # GTK_INCLUDE_DIR - Directories to include to use GTK
3 # GTK_LIBRARIES - Files to link against to use GTK
4 # GTK_FOUND - GTK was found
5 # GTK_GL_FOUND - GTK's GL features were found
7 #=============================================================================
8 # Copyright 2001-2009 Kitware, Inc.
10 # Distributed under the OSI-approved BSD License (the "License");
11 # see accompanying file Copyright.txt for details.
13 # This software is distributed WITHOUT ANY WARRANTY; without even the
14 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 # See the License for more information.
16 #=============================================================================
17 # (To distribute this file outside of CMake, substitute the full
18 # License text for the above reference.)
20 # don't even bother under WIN32
23 find_path( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
24 PATH_SUFFIXES gtk-1.2 gtk12
26 /usr/openwin/share/include
31 # Some Linux distributions (e.g. Red Hat) have glibconfig.h
32 # and glib.h in different directories, so we need to look
34 # - Atanas Georgiev <atanas@cs.columbia.edu>
36 find_path( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
38 /usr/openwin/share/include
39 /usr/local/include/glib12
41 /usr/local/lib/glib/include
43 /opt/gnome/lib/glib/include
46 find_path( GTK_glib_INCLUDE_PATH NAMES glib.h
47 PATH_SUFFIXES gtk-1.2 glib-1.2 glib12
49 /usr/openwin/share/include
54 find_path( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
55 PATHS /usr/openwin/share/include
59 find_library( GTK_gtkgl_LIBRARY gtkgl
65 # The 12 suffix is thanks to the FreeBSD ports collection
68 find_library( GTK_gtk_LIBRARY
70 PATHS /usr/openwin/lib
74 find_library( GTK_gdk_LIBRARY
76 PATHS /usr/openwin/lib
80 find_library( GTK_gmodule_LIBRARY
81 NAMES gmodule gmodule12
82 PATHS /usr/openwin/lib
86 find_library( GTK_glib_LIBRARY
88 PATHS /usr/openwin/lib
92 find_library( GTK_Xi_LIBRARY
94 PATHS /usr/openwin/lib
98 find_library( GTK_gthread_LIBRARY
99 NAMES gthread gthread12
100 PATHS /usr/openwin/lib
104 if(GTK_gtk_INCLUDE_PATH
105 AND GTK_glibconfig_INCLUDE_PATH
106 AND GTK_glib_INCLUDE_PATH
108 AND GTK_glib_LIBRARY)
110 # Assume that if gtk and glib were found, the other
111 # supporting libraries have also been found.
113 set( GTK_FOUND "YES" )
114 set( GTK_INCLUDE_DIR ${GTK_gtk_INCLUDE_PATH}
115 ${GTK_glibconfig_INCLUDE_PATH}
116 ${GTK_glib_INCLUDE_PATH} )
117 set( GTK_LIBRARIES ${GTK_gtk_LIBRARY}
119 ${GTK_glib_LIBRARY} )
121 if(GTK_gmodule_LIBRARY)
122 set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
124 if(GTK_gthread_LIBRARY)
125 set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
128 set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
131 if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
132 set( GTK_GL_FOUND "YES" )
133 set( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR}
134 ${GTK_gtkgl_INCLUDE_PATH} )
135 set( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
138 GTK_gtkgl_INCLUDE_PATH
146 GTK_glib_INCLUDE_PATH
148 GTK_glibconfig_INCLUDE_PATH
154 GTK_gtkgl_INCLUDE_PATH