summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 917a5f7)
raw | patch | inline | side by side (parent: 917a5f7)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 6 Jan 2009 23:12:32 +0000 (23:12 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 6 Jan 2009 23:12:32 +0000 (23:12 +0000) |
CMakeScripts/FindGTK2.cmake | patch | blob | history |
index 1224b082b1ba7fd4262d2a53796694fb28d3971d..9c7346e1d4a8d165e46490debc0f3d556f42be81 100644 (file)
SET(GTK2_FOUND TRUE)
ELSE (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
+ #check whether cmake version is 2.4 or greater
+ if (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 3)
+ SET(GTK2_CMAKE_24 TRUE)
+ endif (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 3)
+
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
include(UsePkgConfig)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
find_package(PkgConfig)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
INCLUDE(UsePkgConfig)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(gtk+-2.0 _GTK2_INCLUDEDIR _GTK2_LIBDIR _GTK2_LDFLAGS _GTK2_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ MESSAGE(STATUS "DEBUG pkgconfig found: ${_GTK2_INCLUDEDIR} ${_GTK2_LIBDIR} ${_GTK2_LDFLAGS} ${_GTK2_CFLAGS}")
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_GTK2 gtk+-2.0)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
FIND_PATH(GTK2_GTK_INCLUDE_PATH gtk/gtk.h
$ENV{GTK2_HOME}
# and glib.h in different directories, so we need to look
# for both.
# - Atanas Georgiev <atanas@cs.columbia.edu>
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(glib-2.0 _GLIB2_INCLUDEDIR _GLIB2inkDir _GLIB2_LDFLAGS _GLIB2_CFLAGS)
pkgconfig(gmodule-2.0 _GMODULE2_INCLUDEDIR _GMODULE2inkDir _GMODULE2_LDFLAGS _GMODULE2_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_GLIB2 glib-2.0)
pkg_check_modules(_GMODULE2 gmodule-2.0)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
SET(GDIR /opt/gnome/lib/glib-2.0/include)
FIND_PATH(GTK2_GLIBCONFIG_INCLUDE_PATH glibconfig.h
$ENV{DEVLIBS_PATH}//include//
)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(pango _PANGO_INCLUDEDIR _PANGOinkDir _PANGO_LDFLAGS _PANGO_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_PANGO pango)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
FIND_PATH(GTK2_PANGO_INCLUDE_PATH pango/pango.h
${_PANGO_INCLUDEDIR}
$ENV{DEVLIBS_PATH}//include//
)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(gdk-2.0 _GDK2_INCLUDEDIR _GDK2inkDir _GDK2_LDFLAGS _GDK2_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_GDK2 gdk-2.0)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
FIND_PATH(GTK2_GDKCONFIG_INCLUDE_PATH gdkconfig.h
${_GDK2_INCLUDEDIR}
$ENV{DEVLIBS_PATH}//include//
)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(cairo _CAIRO_INCLUDEDIR _CAIROinkDir _CAIRO_LDFLAGS _CAIRO_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_CAIRO cairo)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
FIND_PATH(GTK2_CAIRO_INCLUDE_PATH cairo.h
${_CAIRO_INCLUDEDIR}
)
#MESSAGE(STATUS "DEBUG: GTK2_CAIRO_INCLUDE_PATH = ${GTK2_CAIRO_INCLUDE_PATH}")
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ if (GTK2_CMAKE_24)
pkgconfig(atk _ATK_INCLUDEDIR _ATKinkDir _ATK_LDFLAGS _ATK_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ else (GTK2_CMAKE_24)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_ATK atk)
endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+ endif (GTK2_CMAKE_24)
FIND_PATH(GTK2_ATK_INCLUDE_PATH atk/atk.h
${_ATK_INCLUDEDIR}