diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 61 |
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}\") | |||
41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) | 41 | string(TIMESTAMP CURRENT_DATE "%Y-%m-%d" UTC) |
42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") | 42 | add_definitions(-DSWAY_VERSION_DATE=\"${CURRENT_DATE}\") |
43 | 43 | ||
44 | find_package(Cairo REQUIRED) | 44 | option(enable-swaylock "Enables the swaylock utility" YES) |
45 | option(enable-swaybg "Enables the wallpaper utility" YES) | ||
46 | option(enable-swaybar "Enables the swaybar utility" YES) | ||
47 | option(enable-swaygrab "Enables the swaygrab utility" YES) | ||
48 | option(enable-swaymsg "Enables the swaymsg utility" YES) | ||
49 | option(enable-gdk-pixbuf "Use Pixbuf to support more image formats" YES) | ||
50 | |||
45 | find_package(JsonC REQUIRED) | 51 | find_package(JsonC REQUIRED) |
46 | find_package(PCRE REQUIRED) | 52 | find_package(PCRE REQUIRED) |
47 | find_package(Pango REQUIRED) | ||
48 | find_package(WLC REQUIRED) | 53 | find_package(WLC REQUIRED) |
49 | find_package(Wayland REQUIRED) | 54 | find_package(Wayland REQUIRED) |
50 | find_package(XKBCommon REQUIRED) | 55 | find_package(XKBCommon REQUIRED) |
51 | find_package(GdkPixbuf REQUIRED) | 56 | find_package(Cairo) |
52 | find_package(PAM REQUIRED) | 57 | find_package(Pango) |
58 | find_package(GdkPixbuf) | ||
59 | find_package(PAM) | ||
53 | 60 | ||
61 | include(FeatureSummary) | ||
54 | include(Manpage) | 62 | include(Manpage) |
55 | 63 | ||
64 | if (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() | ||
71 | else() | ||
72 | message(STATUS "Building without gdk-pixbuf, only png images supported.") | ||
73 | endif() | ||
74 | |||
56 | include_directories(include) | 75 | include_directories(include) |
57 | 76 | ||
58 | add_subdirectory(protocols) | 77 | add_subdirectory(protocols) |
@@ -60,14 +79,38 @@ add_subdirectory(common) | |||
60 | add_subdirectory(wayland) | 79 | add_subdirectory(wayland) |
61 | 80 | ||
62 | add_subdirectory(sway) | 81 | add_subdirectory(sway) |
63 | add_subdirectory(swaybg) | 82 | if(enable-swaybg) |
64 | add_subdirectory(swaymsg) | 83 | if(CAIRO_FOUND AND PANGO_FOUND) |
65 | add_subdirectory(swaygrab) | 84 | add_subdirectory(swaybg) |
66 | add_subdirectory(swaybar) | 85 | else() |
67 | add_subdirectory(swaylock) | 86 | message(WARNING "Not building swaybg - cairo, and pango are required.") |
87 | endif() | ||
88 | endif() | ||
89 | if(enable-swaymsg) | ||
90 | add_subdirectory(swaymsg) | ||
91 | endif() | ||
92 | if(enable-swaygrab) | ||
93 | add_subdirectory(swaygrab) | ||
94 | endif() | ||
95 | if(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() | ||
101 | endif() | ||
102 | if(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() | ||
108 | endif() | ||
68 | 109 | ||
69 | install( | 110 | install( |
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 | |||
116 | feature_summary(WHAT ALL) | ||