aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2011-06-08 18:10:03 +0000
committerJörg Mayer <jmayer@loplof.de>2011-06-08 18:10:03 +0000
commit48904e0a7156dfa9be299b2283716fec5a4b39d5 (patch)
tree7e5b98a2aa79dce57fde0110f71b46f38b43df8f /cmake
parent5d78458e4bfd6a6377d320ffc5dbb110fc99883e (diff)
Add GTK3 cmake options. It doesn't build, just like its configure pendant.
svn path=/trunk/; revision=37623
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindGTK3.cmake50
1 files changed, 50 insertions, 0 deletions
diff --git a/cmake/modules/FindGTK3.cmake b/cmake/modules/FindGTK3.cmake
new file mode 100644
index 0000000000..8e5a49b893
--- /dev/null
+++ b/cmake/modules/FindGTK3.cmake
@@ -0,0 +1,50 @@
+# - Try to find GTK3
+#
+# $Id$
+#
+# Once done this will define
+#
+# GTK3_FOUND - System has GTK3
+# GTK3_INCLUDE_DIRS - The GTK3 include directory
+# GTK3_LIBRARIES - The libraries needed to use GTK3
+# GTK3_DEFINITIONS - Compiler switches required for using GTK3
+#=============================================================================
+# Copyright 2011 Duncan Mac-Vicar P. <duncan@kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GTK3 gtk+-3.0 QUIET)
+SET(GTK3_DEFINITIONS ${PC_GTK3_CFLAGS_OTHER})
+
+FIND_PATH(GTK3_INCLUDE_DIR NAMES "gtk/gtk.h"
+ HINTS
+ ${PC_GTK3_INCLUDEDIR}
+ ${PC_GTK3_INCLUDE_DIRS}
+ PATH_SUFFIXES "gtk-3.0"
+ )
+SET(GTK3_INCLUDE_DIRS ${PC_GTK3_INCLUDE_DIRS})
+
+FIND_LIBRARY(GTK3_LIBRARIES NAMES gtk-3 gtk3
+ HINTS
+ ${PC_GTK3_LIBDIR}
+ ${PC_GTK3_LIBRARY_DIRS}
+ )
+
+# handle the QUIETLY and REQUIRED arguments and set GTK3_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_LIBRARIES GTK3_INCLUDE_DIRS)
+
+MARK_AS_ADVANCED(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)
+