From 9e91058ed926841d3152f888b8b87633b8ccc4f8 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Tue, 27 Aug 2024 20:36:50 +0200 Subject: Add elksmart-comm for transceiving infrared codes The receive functionality is quite unstable, however useful enough for something that is officially unsupported. The gadget is picky about cables, but it has ridiculous reach when it works. --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') 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} -- cgit v1.2.3-54-g00ecf