From 21014e606b9b28d792b98cf363f20c7df2136723 Mon Sep 17 00:00:00 2001 From: progandy Date: Sun, 20 Dec 2015 17:37:52 +0100 Subject: make gdk-pixbuf dependency really optional --- CMakeLists.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 31e79ca4..5cd9c67b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option(enable-swaybg "Enables the wallpaper utility" YES) option(enable-swaybar "Enables the swaybar utility" YES) option(enable-swaygrab "Enables the swaygrab utility" YES) option(enable-swaymsg "Enables the swaymsg utility" YES) +option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES) find_package(JsonC REQUIRED) find_package(PCRE REQUIRED) @@ -60,6 +61,17 @@ find_package(PAM) include(FeatureSummary) include(Manpage) +if (enable-gdk-pixbuf) + if (GDK_PIXBUF_FOUND) + set(WITH_GDK_PIXBUF YES) + add_definitions(-DWITH_GDK_PIXBUF) + else() + message(WARNING "gdk-pixbuf required but not found, only png images supported.") + endif() +else() + message(STATUS "Building without gdk-pixbuf, only png images supported.") +endif() + include_directories(include) add_subdirectory(protocols) @@ -68,10 +80,10 @@ add_subdirectory(wayland) add_subdirectory(sway) if(enable-swaybg) - if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) + if(CAIRO_FOUND AND PANGO_FOUND) add_subdirectory(swaybg) else() - message(WARNING "Not building swaybg - cairo, pango, and gdk-pixbuf are required.") + message(WARNING "Not building swaybg - cairo, and pango are required.") endif() endif() if(enable-swaymsg) @@ -81,17 +93,17 @@ if(enable-swaygrab) add_subdirectory(swaygrab) endif() if(enable-swaybar) - if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) + if(CAIRO_FOUND AND PANGO_FOUND) add_subdirectory(swaybar) else() - message(WARNING "Not building swaybar - cairo, pango, and gdk-pixbuf are required.") + message(WARNING "Not building swaybar - cairo, and pango are required.") endif() endif() if(enable-swaylock) - if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND AND PAM_FOUND) + if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND) add_subdirectory(swaylock) else() - message(WARNING "Not building swaylock - cairo, pango, gdk-pixbuf, and PAM are required.") + message(WARNING "Not building swaylock - cairo, pango, and PAM are required.") endif() endif() -- cgit v1.2.3-70-g09d2