2019-08-09 18:25:40 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2019-07-17 05:53:51 +00:00
|
|
|
project(logid)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../CMake")
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
|
|
|
add_executable(logid
|
|
|
|
logid.cpp
|
2020-06-24 22:10:25 +00:00
|
|
|
util/log.cpp
|
2020-07-05 06:55:46 +00:00
|
|
|
InputDevice.cpp
|
2020-06-20 02:01:14 +00:00
|
|
|
DeviceManager.cpp
|
2020-06-20 01:58:33 +00:00
|
|
|
Device.cpp
|
|
|
|
Receiver.cpp
|
2020-07-02 04:38:40 +00:00
|
|
|
Configuration.cpp
|
2020-07-02 07:34:14 +00:00
|
|
|
features/DPI.cpp
|
2020-07-02 19:27:30 +00:00
|
|
|
features/SmartShift.cpp
|
2020-07-06 18:18:44 +00:00
|
|
|
features/HiresScroll.cpp
|
2020-07-05 06:55:46 +00:00
|
|
|
features/RemapButton.cpp
|
2020-07-19 02:55:51 +00:00
|
|
|
features/DeviceStatus.cpp
|
2020-08-22 20:59:10 +00:00
|
|
|
features/ThumbWheel.cpp
|
2020-07-05 06:55:46 +00:00
|
|
|
actions/Action.cpp
|
2020-07-12 03:29:07 +00:00
|
|
|
actions/NullAction.cpp
|
2020-07-05 06:55:46 +00:00
|
|
|
actions/KeypressAction.cpp
|
2020-07-08 21:12:37 +00:00
|
|
|
actions/ToggleHiresScroll.cpp
|
2020-07-08 20:29:20 +00:00
|
|
|
actions/ToggleSmartShift.cpp
|
2020-07-12 04:06:33 +00:00
|
|
|
actions/CycleDPI.cpp
|
2020-07-12 04:34:23 +00:00
|
|
|
actions/ChangeDPI.cpp
|
2020-07-11 20:31:08 +00:00
|
|
|
actions/GestureAction.cpp
|
2020-07-15 21:43:24 +00:00
|
|
|
actions/ChangeHostAction.cpp
|
2020-07-11 20:31:08 +00:00
|
|
|
actions/gesture/Gesture.cpp
|
|
|
|
actions/gesture/ReleaseGesture.cpp
|
2020-08-16 16:57:31 +00:00
|
|
|
actions/gesture/ThresholdGesture.cpp
|
2020-07-12 00:28:00 +00:00
|
|
|
actions/gesture/IntervalGesture.cpp
|
2020-07-12 03:14:32 +00:00
|
|
|
actions/gesture/AxisGesture.cpp
|
2020-07-12 03:21:15 +00:00
|
|
|
actions/gesture/NullGesture.cpp
|
2020-06-17 06:43:53 +00:00
|
|
|
backend/Error.cpp
|
2020-06-16 23:53:38 +00:00
|
|
|
backend/raw/DeviceMonitor.cpp
|
|
|
|
backend/raw/RawDevice.cpp
|
2020-06-19 07:58:00 +00:00
|
|
|
backend/dj/Receiver.cpp
|
2020-06-20 07:16:16 +00:00
|
|
|
backend/dj/ReceiverMonitor.cpp
|
2020-06-19 07:58:00 +00:00
|
|
|
backend/dj/Error.cpp
|
2020-06-16 23:53:38 +00:00
|
|
|
backend/hidpp/Device.cpp
|
|
|
|
backend/hidpp/Report.cpp
|
2020-06-18 08:47:04 +00:00
|
|
|
backend/hidpp10/Error.cpp
|
2020-06-19 07:58:00 +00:00
|
|
|
backend/hidpp10/Device.cpp
|
2020-06-18 05:34:25 +00:00
|
|
|
backend/hidpp20/Device.cpp
|
|
|
|
backend/hidpp20/Error.cpp
|
|
|
|
backend/hidpp20/Feature.cpp
|
2020-06-21 09:33:33 +00:00
|
|
|
backend/hidpp20/EssentialFeature.cpp
|
2020-06-18 05:34:25 +00:00
|
|
|
backend/hidpp20/features/Root.cpp
|
2020-06-24 06:33:26 +00:00
|
|
|
backend/hidpp20/features/FeatureSet.cpp
|
2020-06-21 09:33:33 +00:00
|
|
|
backend/hidpp20/features/DeviceName.cpp
|
2020-06-24 07:39:52 +00:00
|
|
|
backend/hidpp20/features/Reset.cpp
|
2020-06-25 00:17:32 +00:00
|
|
|
backend/hidpp20/features/AdjustableDPI.cpp
|
2020-07-02 18:50:40 +00:00
|
|
|
backend/hidpp20/features/SmartShift.cpp
|
2020-07-02 20:57:38 +00:00
|
|
|
backend/hidpp20/features/ReprogControls.cpp
|
2020-07-05 20:46:52 +00:00
|
|
|
backend/hidpp20/features/HiresScroll.cpp
|
2020-07-15 19:18:28 +00:00
|
|
|
backend/hidpp20/features/ChangeHost.cpp
|
2020-07-19 02:46:47 +00:00
|
|
|
backend/hidpp20/features/WirelessDeviceStatus.cpp
|
2020-08-22 00:28:48 +00:00
|
|
|
backend/hidpp20/features/ThumbWheel.cpp
|
2020-06-17 06:43:53 +00:00
|
|
|
backend/dj/Report.cpp
|
2020-06-24 09:48:03 +00:00
|
|
|
util/mutex_queue.h
|
2020-07-10 07:16:51 +00:00
|
|
|
util/workqueue.cpp
|
|
|
|
util/worker_thread.cpp
|
|
|
|
util/task.cpp
|
2020-06-24 09:48:03 +00:00
|
|
|
util/thread.cpp
|
|
|
|
util/ExceptionHandler.cpp)
|
2020-06-16 23:53:38 +00:00
|
|
|
|
2019-07-17 05:53:51 +00:00
|
|
|
set_target_properties(logid PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
2020-06-16 23:53:38 +00:00
|
|
|
pkg_check_modules(PC_EVDEV libevdev REQUIRED)
|
2019-08-09 18:25:40 +00:00
|
|
|
pkg_check_modules(SYSTEMD "systemd")
|
2020-06-16 23:53:38 +00:00
|
|
|
pkg_check_modules(LIBCONFIG libconfig REQUIRED)
|
|
|
|
pkg_check_modules(LIBUDEV libudev REQUIRED)
|
2019-07-17 05:53:51 +00:00
|
|
|
|
|
|
|
find_path(EVDEV_INCLUDE_DIR libevdev/libevdev.h
|
|
|
|
HINTS ${PC_EVDEV_INCLUDE_DIRS} ${PC_EVDEV_INCLUDEDIR})
|
|
|
|
find_library(EVDEV_LIBRARY
|
|
|
|
NAMES evdev libevdev)
|
|
|
|
|
2020-07-12 20:18:43 +00:00
|
|
|
include_directories(${EVDEV_INCLUDE_DIR} ${LIBUDEV_INCLUDE_DIRECTORIES})
|
2019-09-23 02:33:11 +00:00
|
|
|
|
2020-06-16 23:53:38 +00:00
|
|
|
target_link_libraries(logid ${CMAKE_THREAD_LIBS_INIT} ${EVDEV_LIBRARY} config++
|
2020-07-12 20:18:43 +00:00
|
|
|
${LIBUDEV_LIBRARIES})
|
2019-08-09 18:25:40 +00:00
|
|
|
|
|
|
|
install(TARGETS logid DESTINATION bin)
|
|
|
|
|
|
|
|
if (SYSTEMD_FOUND AND "${SYSTEMD_SERVICES_INSTALL_DIR}" STREQUAL "")
|
|
|
|
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE}
|
|
|
|
--variable=systemdsystemunitdir systemd
|
|
|
|
OUTPUT_VARIABLE SYSTEMD_SERVICES_INSTALL_DIR)
|
|
|
|
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SERVICES_INSTALL_DIR
|
|
|
|
"${SYSTEMD_SERVICES_INSTALL_DIR}")
|
|
|
|
configure_file(logid.service.cmake ${CMAKE_BINARY_DIR}/logid.service)
|
|
|
|
message(STATUS "systemd units will be installed at ${SYSTEMD_SERVICES_INSTALL_DIR}")
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/logid.service
|
|
|
|
DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}
|
|
|
|
COMPONENT cp)
|
|
|
|
elseif(NOT SYSTEMD_FOUND AND SYSTEMD_SERVICES_INSTALL_DIR)
|
|
|
|
message(FATAL_ERROR "systemd is not found w/ pkg-config but SYSTEMD_SERVICES_INSTALL_DIR is defined.")
|
|
|
|
endif()
|