diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-20 09:14:30 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-20 09:14:30 -0500 |
commit | 05e48835f71e8d364d3ac5e29bdb6bf056c2e570 (patch) | |
tree | ad2c14ae76a87aa7087dfe1869c85f8b10ca5551 /CMakeLists.txt | |
parent | Merge pull request #366 from mikkeloscar/fix-swaybar-high-cpu (diff) | |
download | sway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.tar.gz sway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.tar.zst sway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.zip |
Make some dependencies optional
Closes #368
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 49 |
1 files changed, 40 insertions, 9 deletions
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}\") | |||
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 | |||
45 | find_package(JsonC REQUIRED) | 50 | find_package(JsonC REQUIRED) |
46 | find_package(PCRE REQUIRED) | 51 | find_package(PCRE REQUIRED) |
47 | find_package(Pango REQUIRED) | ||
48 | find_package(WLC REQUIRED) | 52 | find_package(WLC REQUIRED) |
49 | find_package(Wayland REQUIRED) | 53 | find_package(Wayland REQUIRED) |
50 | find_package(XKBCommon REQUIRED) | 54 | find_package(XKBCommon REQUIRED) |
51 | find_package(GdkPixbuf REQUIRED) | 55 | find_package(Cairo) |
52 | find_package(PAM REQUIRED) | 56 | find_package(Pango) |
57 | find_package(GdkPixbuf) | ||
58 | find_package(PAM) | ||
53 | 59 | ||
60 | include(FeatureSummary) | ||
54 | include(Manpage) | 61 | include(Manpage) |
55 | 62 | ||
56 | include_directories(include) | 63 | include_directories(include) |
@@ -60,14 +67,38 @@ add_subdirectory(common) | |||
60 | add_subdirectory(wayland) | 67 | add_subdirectory(wayland) |
61 | 68 | ||
62 | add_subdirectory(sway) | 69 | add_subdirectory(sway) |
63 | add_subdirectory(swaybg) | 70 | if(enable-swaybg) |
64 | add_subdirectory(swaymsg) | 71 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) |
65 | add_subdirectory(swaygrab) | 72 | add_subdirectory(swaybg) |
66 | add_subdirectory(swaybar) | 73 | else() |
67 | add_subdirectory(swaylock) | 74 | message(WARNING "Not building swaybg - cairo, pango, and gdk-pixbuf are required.") |
75 | endif() | ||
76 | endif() | ||
77 | if(enable-swaymsg) | ||
78 | add_subdirectory(swaymsg) | ||
79 | endif() | ||
80 | if(enable-swaygrab) | ||
81 | add_subdirectory(swaygrab) | ||
82 | endif() | ||
83 | if(enable-swaybar) | ||
84 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND) | ||
85 | add_subdirectory(swaybar) | ||
86 | else() | ||
87 | message(WARNING "Not building swaybar - cairo, pango, and gdk-pixbuf are required.") | ||
88 | endif() | ||
89 | endif() | ||
90 | if(enable-swaylock) | ||
91 | if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND AND PAM_FOUND) | ||
92 | add_subdirectory(swaylock) | ||
93 | else() | ||
94 | message(WARNING "Not building swaylock - cairo, pango, gdk-pixbuf, and PAM are required.") | ||
95 | endif() | ||
96 | endif() | ||
68 | 97 | ||
69 | install( | 98 | install( |
70 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop | 99 | FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop |
71 | DESTINATION share/wayland-sessions | 100 | DESTINATION share/wayland-sessions |
72 | COMPONENT data | 101 | COMPONENT data |
73 | ) | 102 | ) |
103 | |||
104 | feature_summary(WHAT ALL) | ||