aboutsummaryrefslogtreecommitdiff
path: root/CMake/FindGdkPixbuf.cmake
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-08 07:09:21 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-08 07:09:21 -0500
commit7ed204eb02d1a83bcfd315d6f321497f3d7b41aa (patch)
treeb7caa28bec450d4f77ee8eba60b213e1c24f4be4 /CMake/FindGdkPixbuf.cmake
parent762a78be3ca22767b94adf5bba4668047aa80e4e (diff)
parent3fdf4f811fc14556869ea64b0bc27d24b61bda56 (diff)
Merge pull request #296 from progandy/pixbuf
Support for more image formats for wallpapers with gdk-pixbuf (#282)
Diffstat (limited to 'CMake/FindGdkPixbuf.cmake')
-rw-r--r--CMake/FindGdkPixbuf.cmake47
1 files changed, 47 insertions, 0 deletions
diff --git a/CMake/FindGdkPixbuf.cmake b/CMake/FindGdkPixbuf.cmake
new file mode 100644
index 00000000..53bb0501
--- /dev/null
+++ b/CMake/FindGdkPixbuf.cmake
@@ -0,0 +1,47 @@
+# - Try to find the gdk-pixbuf-2.0 library
+# Once done this will define
+#
+# GDK_PIXBUF_FOUND - system has gdk-pixbuf-2.0
+# GDK_PIXBUF_INCLUDE_DIRS - the gdk-pixbuf-2.0 include directory
+# GDK_PIXBUF_LIBRARIES - Link these to use gdk-pixbuf-2.0
+#
+# Define GDK_PIXBUF_MIN_VERSION for which version desired.
+#
+
+INCLUDE(FindPkgConfig)
+
+IF(GdkPixbuf_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "REQUIRED")
+ELSE(GdkPixbuf_FIND_REQUIRED)
+ SET(_pkgconfig_REQUIRED "")
+ENDIF(GdkPixbuf_FIND_REQUIRED)
+
+IF(GDK_PIXBUF_MIN_VERSION)
+ PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}")
+ELSE(GDK_PIXBUF_MIN_VERSION)
+ PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0")
+ENDIF(GDK_PIXBUF_MIN_VERSION)
+
+IF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
+ FIND_PATH(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h)
+ FIND_LIBRARY(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0)
+
+ # Report results
+ IF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
+ SET(GDK_PIXBUF_FOUND 1)
+ IF(NOT GdkPixbuf_FIND_QUIETLY)
+ MESSAGE(STATUS "Found GdkPixbuf: ${GDK_PIXBUF_LIBRARIES}")
+ ENDIF(NOT GdkPixbuf_FIND_QUIETLY)
+ ELSE(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
+ IF(GdkPixbuf_FIND_REQUIRED)
+ MESSAGE(SEND_ERROR "Could not find GdkPixbuf")
+ ELSE(GdkPixbuf_FIND_REQUIRED)
+ IF(NOT GdkPixbuf_FIND_QUIETLY)
+ MESSAGE(STATUS "Could not find GdkPixbuf")
+ ENDIF(NOT GdkPixbuf_FIND_QUIETLY)
+ ENDIF(GdkPixbuf_FIND_REQUIRED)
+ ENDIF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
+ENDIF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
+
+# Hide advanced variables from CMake GUIs
+MARK_AS_ADVANCED(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)