From 3fdf4f811fc14556869ea64b0bc27d24b61bda56 Mon Sep 17 00:00:00 2001 From: progandy Date: Mon, 7 Dec 2015 23:31:44 +0100 Subject: swaybg: load more image formats with gdk-pixbuf2 travis: added gdk-pixbuf2 dependency --- CMake/FindGdkPixbuf.cmake | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 CMake/FindGdkPixbuf.cmake (limited to 'CMake/FindGdkPixbuf.cmake') 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) -- cgit v1.2.3