aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1d4292..0aa0760 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,13 +19,15 @@ find_package (PkgConfig REQUIRED)
pkg_check_modules (x REQUIRED x11 xext xextproto)
pkg_check_modules (pulse REQUIRED libpulse)
pkg_check_modules (dbus REQUIRED dbus-1)
+pkg_check_modules (libusb libusb-1.0)
pkg_check_modules (gdm gdm glib-2.0 gio-2.0)
include_directories (
${x_INCLUDE_DIRS} ${pulse_INCLUDE_DIRS} ${dbus_INCLUDE_DIRS})
link_directories (
${x_LIBRARY_DIRS} ${pulse_LIBRARY_DIRS} ${dbus_LIBRARY_DIRS})
-option (WITH_GDM "Compile with GDM support" ${gdm_FOUND})
+option (WITH_USB "Compile with USB utilities" ${libusb_FOUND})
+option (WITH_GDM "Compile with GDM utilities" ${gdm_FOUND})
# Generate a configuration file
configure_file (${PROJECT_SOURCE_DIR}/config.h.in
@@ -57,10 +59,16 @@ target_link_libraries (wmstatus
${x_LIBRARIES} ${pulse_LIBRARIES} ${dbus_LIBRARIES})
add_threads (wmstatus)
+if (WITH_USB)
+ add_executable (elksmart-comm elksmart-comm.c)
+ target_include_directories (elksmart-comm PUBLIC ${libusb_INCLUDE_DIRS})
+ target_link_directories (elksmart-comm PUBLIC ${libusb_LIBRARY_DIRS})
+ target_link_libraries (elksmart-comm ${libusb_LIBRARIES})
+endif ()
if (WITH_GDM)
- include_directories (${gdm_INCLUDE_DIRS})
- link_directories (${gdm_LIBRARY_DIRS})
add_executable (gdm-switch-user gdm-switch-user.c)
+ target_include_directories (gdm-switch-user PUBLIC ${gdm_INCLUDE_DIRS})
+ target_link_directories (gdm-switch-user PUBLIC ${gdm_LIBRARY_DIRS})
target_link_libraries (gdm-switch-user ${gdm_LIBRARIES})
endif ()
@@ -95,7 +103,7 @@ endif ()
# These should be accessible by users, but need to touch system devices.
# Use the setuid bit, for simplicity.
-foreach (target brightness input-switch)
+foreach (target brightness input-switch elksmart-comm)
if (${target} IN_LIST targets)
list (REMOVE_ITEM targets ${target})
install (TARGETS ${target} DESTINATION ${CMAKE_INSTALL_BINDIR}