2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# FindGTK
|
|
|
|
# -------
|
|
|
|
#
|
|
|
|
# try to find GTK (and glib) and GTKGLArea
|
|
|
|
#
|
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# GTK_INCLUDE_DIR - Directories to include to use GTK
|
|
|
|
# GTK_LIBRARIES - Files to link against to use GTK
|
|
|
|
# GTK_FOUND - GTK was found
|
|
|
|
# GTK_GL_FOUND - GTK's GL features were found
|
2002-09-03 01:34:45 +04:00
|
|
|
|
2001-05-04 19:35:47 +04:00
|
|
|
# don't even bother under WIN32
|
2012-08-13 21:47:32 +04:00
|
|
|
if(UNIX)
|
2001-05-04 19:35:47 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
|
2007-07-19 17:00:51 +04:00
|
|
|
PATH_SUFFIXES gtk-1.2 gtk12
|
|
|
|
PATHS
|
2002-09-03 01:34:45 +04:00
|
|
|
/usr/openwin/share/include
|
|
|
|
/usr/openwin/include
|
|
|
|
/opt/gnome/include
|
2001-05-04 19:35:47 +04:00
|
|
|
)
|
|
|
|
|
2002-09-03 01:34:45 +04:00
|
|
|
# Some Linux distributions (e.g. Red Hat) have glibconfig.h
|
|
|
|
# and glib.h in different directories, so we need to look
|
|
|
|
# for both.
|
|
|
|
# - Atanas Georgiev <atanas@cs.columbia.edu>
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS
|
2002-09-03 01:34:45 +04:00
|
|
|
/usr/openwin/share/include
|
|
|
|
/usr/local/include/glib12
|
|
|
|
/usr/lib/glib/include
|
|
|
|
/usr/local/lib/glib/include
|
|
|
|
/opt/gnome/include
|
|
|
|
/opt/gnome/lib/glib/include
|
2001-05-04 19:35:47 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path( GTK_glib_INCLUDE_PATH NAMES glib.h
|
2007-07-19 17:00:51 +04:00
|
|
|
PATH_SUFFIXES gtk-1.2 glib-1.2 glib12
|
|
|
|
PATHS
|
2002-09-03 01:34:45 +04:00
|
|
|
/usr/openwin/share/include
|
|
|
|
/usr/lib/glib/include
|
|
|
|
/opt/gnome/include
|
2001-05-04 19:35:47 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/share/include
|
|
|
|
/opt/gnome/include
|
2002-09-03 01:34:45 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_gtkgl_LIBRARY gtkgl
|
2002-09-03 01:34:45 +04:00
|
|
|
/usr/openwin/lib
|
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
#
|
|
|
|
# The 12 suffix is thanks to the FreeBSD ports collection
|
|
|
|
#
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_gtk_LIBRARY
|
2002-09-03 01:34:45 +04:00
|
|
|
NAMES gtk gtk12
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/lib
|
2002-09-03 01:34:45 +04:00
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_gdk_LIBRARY
|
2002-09-03 01:34:45 +04:00
|
|
|
NAMES gdk gdk12
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/lib
|
2002-09-03 01:34:45 +04:00
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
2001-05-04 19:35:47 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_gmodule_LIBRARY
|
2002-09-03 01:34:45 +04:00
|
|
|
NAMES gmodule gmodule12
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/lib
|
2002-09-03 01:34:45 +04:00
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_glib_LIBRARY
|
2002-09-03 01:34:45 +04:00
|
|
|
NAMES glib glib12
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/lib
|
2002-09-03 01:34:45 +04:00
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_Xi_LIBRARY
|
2012-08-13 21:42:58 +04:00
|
|
|
NAMES Xi
|
|
|
|
PATHS /usr/openwin/lib
|
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
2004-04-23 01:08:20 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library( GTK_gthread_LIBRARY
|
2003-03-17 04:23:55 +03:00
|
|
|
NAMES gthread gthread12
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS /usr/openwin/lib
|
2003-03-17 04:23:55 +03:00
|
|
|
/opt/gnome/lib
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(GTK_gtk_INCLUDE_PATH
|
2007-07-19 17:00:51 +04:00
|
|
|
AND GTK_glibconfig_INCLUDE_PATH
|
|
|
|
AND GTK_glib_INCLUDE_PATH
|
|
|
|
AND GTK_gtk_LIBRARY
|
|
|
|
AND GTK_glib_LIBRARY)
|
2002-09-03 01:34:45 +04:00
|
|
|
|
|
|
|
# Assume that if gtk and glib were found, the other
|
|
|
|
# supporting libraries have also been found.
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set( GTK_FOUND "YES" )
|
|
|
|
set( GTK_INCLUDE_DIR ${GTK_gtk_INCLUDE_PATH}
|
2002-09-03 01:34:45 +04:00
|
|
|
${GTK_glibconfig_INCLUDE_PATH}
|
2002-09-18 16:15:04 +04:00
|
|
|
${GTK_glib_INCLUDE_PATH} )
|
2012-08-13 21:47:32 +04:00
|
|
|
set( GTK_LIBRARIES ${GTK_gtk_LIBRARY}
|
2002-09-03 01:34:45 +04:00
|
|
|
${GTK_gdk_LIBRARY}
|
2002-09-18 16:15:04 +04:00
|
|
|
${GTK_glib_LIBRARY} )
|
2003-11-13 01:44:17 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(GTK_gmodule_LIBRARY)
|
|
|
|
set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gmodule_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(GTK_gthread_LIBRARY)
|
|
|
|
set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_gthread_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(GTK_Xi_LIBRARY)
|
|
|
|
set(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
|
|
|
|
if(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
|
|
|
|
set( GTK_GL_FOUND "YES" )
|
|
|
|
set( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR}
|
2007-07-19 17:00:51 +04:00
|
|
|
${GTK_gtkgl_INCLUDE_PATH} )
|
2012-08-13 21:47:32 +04:00
|
|
|
set( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
|
|
|
|
mark_as_advanced(
|
2007-07-19 17:00:51 +04:00
|
|
|
GTK_gtkgl_LIBRARY
|
|
|
|
GTK_gtkgl_INCLUDE_PATH
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-07-19 17:00:51 +04:00
|
|
|
|
2012-08-15 19:59:36 +04:00
|
|
|
endif()
|
2002-09-03 01:34:45 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(
|
2003-03-17 04:25:14 +03:00
|
|
|
GTK_gdk_LIBRARY
|
|
|
|
GTK_glib_INCLUDE_PATH
|
2002-09-05 20:00:45 +04:00
|
|
|
GTK_glib_LIBRARY
|
|
|
|
GTK_glibconfig_INCLUDE_PATH
|
2003-03-17 04:25:14 +03:00
|
|
|
GTK_gmodule_LIBRARY
|
|
|
|
GTK_gthread_LIBRARY
|
2004-04-23 01:08:20 +04:00
|
|
|
GTK_Xi_LIBRARY
|
2002-09-05 20:00:45 +04:00
|
|
|
GTK_gtk_INCLUDE_PATH
|
2003-03-17 04:25:14 +03:00
|
|
|
GTK_gtk_LIBRARY
|
|
|
|
GTK_gtkgl_INCLUDE_PATH
|
|
|
|
GTK_gtkgl_LIBRARY
|
2002-09-05 20:00:45 +04:00
|
|
|
)
|
2002-09-03 01:34:45 +04:00
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2002-09-05 20:00:45 +04:00
|
|
|
|
2007-07-19 17:00:51 +04:00
|
|
|
|
|
|
|
|