Skip to content

Commit

Permalink
Make some dependencies optional
Browse files Browse the repository at this point in the history
Closes #368
  • Loading branch information
ddevault committed Dec 20, 2015
1 parent 3777c89 commit 05e4883
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
49 changes: 40 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ Install dependencies:
* asciidoc
* pcre
* json-c
* pango
* cairo
* gdk-pixbuf2
* pam
* pango *
* cairo *
* gdk-pixbuf2 *
* pam **

_\*Only required for swaybar, swaybg, and swaylock_

_\*\*Only required for swaylock_

Run these commands:

Expand Down

0 comments on commit 05e4883

Please sign in to comment.