From 05e48835f71e8d364d3ac5e29bdb6bf056c2e570 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 20 Dec 2015 09:14:30 -0500 Subject: Make some dependencies optional Closes #368 --- CMakeLists.txt | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a9ffde9..31e79ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,16 +41,23 @@ add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\") string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") -find_package(Cairo REQUIRED) +option(enable-swaylock "Enables the swaylock utility" YES) +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) + find_package(JsonC REQUIRED) find_package(PCRE REQUIRED) -find_package(Pango REQUIRED) find_package(WLC REQUIRED) find_package(Wayland REQUIRED) find_package(XKBCommon REQUIRED) -find_package(GdkPixbuf REQUIRED) -find_package(PAM REQUIRED) +find_package(Cairo) +find_package(Pango) +find_package(GdkPixbuf) +find_package(PAM) +include(FeatureSummary) include(Manpage) include_directories(include) @@ -60,14 +67,38 @@ add_subdirectory(common) add_subdirectory(wayland) add_subdirectory(sway) -add_subdirectory(swaybg) -add_subdirectory(swaymsg) -add_subdirectory(swaygrab) -add_subdirectory(swaybar) -add_subdirectory(swaylock) +if(enable-swaybg) + if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) + add_subdirectory(swaybg) + else() + message(WARNING "Not building swaybg - cairo, pango, and gdk-pixbuf are required.") + endif() +endif() +if(enable-swaymsg) + add_subdirectory(swaymsg) +endif() +if(enable-swaygrab) + add_subdirectory(swaygrab) +endif() +if(enable-swaybar) + if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) + add_subdirectory(swaybar) + else() + message(WARNING "Not building swaybar - cairo, pango, and gdk-pixbuf are required.") + endif() +endif() +if(enable-swaylock) + if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND AND PAM_FOUND) + add_subdirectory(swaylock) + else() + message(WARNING "Not building swaylock - cairo, pango, gdk-pixbuf, and PAM are required.") + endif() +endif() install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop DESTINATION share/wayland-sessions COMPONENT data ) + +feature_summary(WHAT ALL) -- cgit v1.2.3-54-g00ecf