summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt61
1 files changed, 52 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a9ffde9..5cd9c67b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,18 +41,37 @@ add_definitions(-DSWAY_GIT_BRANCH=\"${GIT_BRANCH}\")
41string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) 41string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC)
42add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") 42add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\")
43 43
44find_package(Cairo REQUIRED) 44option(enable-swaylock "Enables the swaylock utility" YES)
45option(enable-swaybg "Enables the wallpaper utility" YES)
46option(enable-swaybar "Enables the swaybar utility" YES)
47option(enable-swaygrab "Enables the swaygrab utility" YES)
48option(enable-swaymsg "Enables the swaymsg utility" YES)
49option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES)
50
45find_package(JsonC REQUIRED) 51find_package(JsonC REQUIRED)
46find_package(PCRE REQUIRED) 52find_package(PCRE REQUIRED)
47find_package(Pango REQUIRED)
48find_package(WLC REQUIRED) 53find_package(WLC REQUIRED)
49find_package(Wayland REQUIRED) 54find_package(Wayland REQUIRED)
50find_package(XKBCommon REQUIRED) 55find_package(XKBCommon REQUIRED)
51find_package(GdkPixbuf REQUIRED) 56find_package(Cairo)
52find_package(PAM REQUIRED) 57find_package(Pango)
58find_package(GdkPixbuf)
59find_package(PAM)
53 60
61include(FeatureSummary)
54include(Manpage) 62include(Manpage)
55 63
64if (enable-gdk-pixbuf)
65 if (GDK_PIXBUF_FOUND)
66 set(WITH_GDK_PIXBUF YES)
67 add_definitions(-DWITH_GDK_PIXBUF)
68 else()
69 message(WARNING "gdk-pixbuf required but not found, only png images supported.")
70 endif()
71else()
72 message(STATUS "Building without gdk-pixbuf, only png images supported.")
73endif()
74
56include_directories(include) 75include_directories(include)
57 76
58add_subdirectory(protocols) 77add_subdirectory(protocols)
@@ -60,14 +79,38 @@ add_subdirectory(common)
60add_subdirectory(wayland) 79add_subdirectory(wayland)
61 80
62add_subdirectory(sway) 81add_subdirectory(sway)
63add_subdirectory(swaybg) 82if(enable-swaybg)
64add_subdirectory(swaymsg) 83 if(CAIRO_FOUND AND PANGO_FOUND)
65add_subdirectory(swaygrab) 84 add_subdirectory(swaybg)
66add_subdirectory(swaybar) 85 else()
67add_subdirectory(swaylock) 86 message(WARNING "Not building swaybg - cairo, and pango are required.")
87 endif()
88endif()
89if(enable-swaymsg)
90 add_subdirectory(swaymsg)
91endif()
92if(enable-swaygrab)
93 add_subdirectory(swaygrab)
94endif()
95if(enable-swaybar)
96 if(CAIRO_FOUND AND PANGO_FOUND)
97 add_subdirectory(swaybar)
98 else()
99 message(WARNING "Not building swaybar - cairo, and pango are required.")
100 endif()
101endif()
102if(enable-swaylock)
103 if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
104 add_subdirectory(swaylock)
105 else()
106 message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
107 endif()
108endif()
68 109
69install( 110install(
70 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop 111 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
71 DESTINATION share/wayland-sessions 112 DESTINATION share/wayland-sessions
72 COMPONENT data 113 COMPONENT data
73) 114)
115
116feature_summary(WHAT ALL)