aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-12-20 09:14:30 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-12-20 09:14:30 -0500
commit05e48835f71e8d364d3ac5e29bdb6bf056c2e570 (patch)
treead2c14ae76a87aa7087dfe1869c85f8b10ca5551
parentMerge pull request #366 from mikkeloscar/fix-swaybar-high-cpu (diff)
downloadsway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.tar.gz
sway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.tar.zst
sway-05e48835f71e8d364d3ac5e29bdb6bf056c2e570.zip
Make some dependencies optional
Closes #368
-rw-r--r--CMakeLists.txt49
-rw-r--r--README.md12
2 files changed, 48 insertions, 13 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}\")
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)
49
45find_package(JsonC REQUIRED) 50find_package(JsonC REQUIRED)
46find_package(PCRE REQUIRED) 51find_package(PCRE REQUIRED)
47find_package(Pango REQUIRED)
48find_package(WLC REQUIRED) 52find_package(WLC REQUIRED)
49find_package(Wayland REQUIRED) 53find_package(Wayland REQUIRED)
50find_package(XKBCommon REQUIRED) 54find_package(XKBCommon REQUIRED)
51find_package(GdkPixbuf REQUIRED) 55find_package(Cairo)
52find_package(PAM REQUIRED) 56find_package(Pango)
57find_package(GdkPixbuf)
58find_package(PAM)
53 59
60include(FeatureSummary)
54include(Manpage) 61include(Manpage)
55 62
56include_directories(include) 63include_directories(include)
@@ -60,14 +67,38 @@ add_subdirectory(common)
60add_subdirectory(wayland) 67add_subdirectory(wayland)
61 68
62add_subdirectory(sway) 69add_subdirectory(sway)
63add_subdirectory(swaybg) 70if(enable-swaybg)
64add_subdirectory(swaymsg) 71 if(CAIRO_FOUND AND PANGO_FOUND AND GDK_PIXBUF_FOUND)
65add_subdirectory(swaygrab) 72 add_subdirectory(swaybg)
66add_subdirectory(swaybar) 73 else()
67add_subdirectory(swaylock) 74 message(WARNING "Not building swaybg - cairo, pango, and gdk-pixbuf are required.")
75 endif()
76endif()
77if(enable-swaymsg)
78 add_subdirectory(swaymsg)
79endif()
80if(enable-swaygrab)
81 add_subdirectory(swaygrab)
82endif()
83if(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()
89endif()
90if(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()
96endif()
68 97
69install( 98install(
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
104feature_summary(WHAT ALL)
diff --git a/README.md b/README.md
index 5bbf07a2..088a4f82 100644
--- a/README.md
+++ b/README.md
@@ -41,10 +41,14 @@ Install dependencies:
41* asciidoc 41* asciidoc
42* pcre 42* pcre
43* json-c 43* json-c
44* pango 44* pango *
45* cairo 45* cairo *
46* gdk-pixbuf2 46* gdk-pixbuf2 *
47* pam 47* pam **
48
49_\*Only required for swaybar, swaybg, and swaylock_
50
51_\*\*Only required for swaylock_
48 52
49Run these commands: 53Run these commands:
50 54