diff options
author | 2015-12-08 07:09:21 -0500 | |
---|---|---|
committer | 2015-12-08 07:09:21 -0500 | |
commit | 7ed204eb02d1a83bcfd315d6f321497f3d7b41aa (patch) | |
tree | b7caa28bec450d4f77ee8eba60b213e1c24f4be4 /CMake | |
parent | Merge pull request #292 from christophgysin/man (diff) | |
parent | swaybg: load more image formats with gdk-pixbuf2 (diff) | |
download | sway-7ed204eb02d1a83bcfd315d6f321497f3d7b41aa.tar.gz sway-7ed204eb02d1a83bcfd315d6f321497f3d7b41aa.tar.zst sway-7ed204eb02d1a83bcfd315d6f321497f3d7b41aa.zip |
Merge pull request #296 from progandy/pixbuf
Support for more image formats for wallpapers with gdk-pixbuf (#282)
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/FindGdkPixbuf.cmake | 47 |
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 @@ | |||
1 | # - Try to find the gdk-pixbuf-2.0 library | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # GDK_PIXBUF_FOUND - system has gdk-pixbuf-2.0 | ||
5 | # GDK_PIXBUF_INCLUDE_DIRS - the gdk-pixbuf-2.0 include directory | ||
6 | # GDK_PIXBUF_LIBRARIES - Link these to use gdk-pixbuf-2.0 | ||
7 | # | ||
8 | # Define GDK_PIXBUF_MIN_VERSION for which version desired. | ||
9 | # | ||
10 | |||
11 | INCLUDE(FindPkgConfig) | ||
12 | |||
13 | IF(GdkPixbuf_FIND_REQUIRED) | ||
14 | SET(_pkgconfig_REQUIRED "REQUIRED") | ||
15 | ELSE(GdkPixbuf_FIND_REQUIRED) | ||
16 | SET(_pkgconfig_REQUIRED "") | ||
17 | ENDIF(GdkPixbuf_FIND_REQUIRED) | ||
18 | |||
19 | IF(GDK_PIXBUF_MIN_VERSION) | ||
20 | PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}") | ||
21 | ELSE(GDK_PIXBUF_MIN_VERSION) | ||
22 | PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0") | ||
23 | ENDIF(GDK_PIXBUF_MIN_VERSION) | ||
24 | |||
25 | IF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) | ||
26 | FIND_PATH(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h) | ||
27 | FIND_LIBRARY(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0) | ||
28 | |||
29 | # Report results | ||
30 | IF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) | ||
31 | SET(GDK_PIXBUF_FOUND 1) | ||
32 | IF(NOT GdkPixbuf_FIND_QUIETLY) | ||
33 | MESSAGE(STATUS "Found GdkPixbuf: ${GDK_PIXBUF_LIBRARIES}") | ||
34 | ENDIF(NOT GdkPixbuf_FIND_QUIETLY) | ||
35 | ELSE(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) | ||
36 | IF(GdkPixbuf_FIND_REQUIRED) | ||
37 | MESSAGE(SEND_ERROR "Could not find GdkPixbuf") | ||
38 | ELSE(GdkPixbuf_FIND_REQUIRED) | ||
39 | IF(NOT GdkPixbuf_FIND_QUIETLY) | ||
40 | MESSAGE(STATUS "Could not find GdkPixbuf") | ||
41 | ENDIF(NOT GdkPixbuf_FIND_QUIETLY) | ||
42 | ENDIF(GdkPixbuf_FIND_REQUIRED) | ||
43 | ENDIF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS) | ||
44 | ENDIF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND) | ||
45 | |||
46 | # Hide advanced variables from CMake GUIs | ||
47 | MARK_AS_ADVANCED(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS) | ||