make gdk-pixbuf dependency really optional

This commit is contained in:
progandy 2015-12-20 17:37:52 +01:00
parent 66554698a0
commit 21014e606b
9 changed files with 62 additions and 13 deletions

View file

@ -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()