Add libhidpp as submodule

master
PixlOne 5 years ago
parent 0002d9f536
commit 00df833c54
  1. 4
      .gitmodules
  2. 4
      README.md
  3. 33
      src/logid/CMakeLists.txt
  4. 1
      src/logid/hidpp

4
.gitmodules vendored

@ -0,0 +1,4 @@
[submodule "src/logid/hidpp"]
path = src/logid/hidpp
url = https://github.com/PixlOne/hidpp.git
branch = master

@ -11,7 +11,7 @@ You may also refer to logid.example.cfg for an example.
## Building
This project requires a C++14 compiler, cmake, libevdev, libconfig, and [my fork of libhidpp](https://github.com/PixlOne/hidpp)
This project requires a C++14 compiler, cmake, libevdev, libudev, and libconfig
To build this project, run:
@ -34,4 +34,4 @@ To install, run `sudo make install` after building. You can set the daemon to st
| K350 | Untested |
| M325c | Untested |
I own the MX Master, T400, K400r, K350, and M325c. Feel free to add to this list if you can test any additional devices.
I own the MX Master, T400, K400r, K350, and M325c. Feel free to add to this list if you can test any additional devices.

@ -37,6 +37,39 @@ find_library(EVDEV_LIBRARY
include_directories(${HIDPP_INCLUDE_DIR}/hidpp ${EVDEV_INCLUDE_DIR})
if((NOT HIDPP_INCLUDE_DIR) OR (NOT EXISTS ${HIDPP_INCLUDE_DIR}) OR (NOT HIDPP_LIBRARY) OR FORCE_BUILD_HIDPP)
message("Could not find libhidpp include dir, getting submodule")
execute_process(COMMAND git submodule update --init -- hidpp
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(DEFAULT_HID_BACKEND "linux")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(DEFAULT_HID_BACKEND "windows")
else()
message(WARNING "System is not supported")
endif()
set(HID_BACKEND "${DEFAULT_HID_BACKEND}" CACHE STRING "Backend used for accessing HID devices")
set_property(CACHE HID_BACKEND PROPERTY STRINGS linux windows)
if("${HID_BACKEND}" STREQUAL "linux")
pkg_check_modules(LIBUDEV libudev REQUIRED)
elseif("${HID_BACKEND}" STREQUAL "windows")
add_definitions(-DUNICODE -D_UNICODE)
add_definitions(-D_WIN32_WINNT=0x0600) # Use vista or later
else()
message(FATAL_ERROR "HID_BACKEND is invalid.")
endif()
add_subdirectory(hidpp/src/libhidpp)
set(HIDPP_INCLUDE_DIR "hidpp/src/libhidpp/")
set(HIDPP_LIBRARY hidpp)
endif()
target_link_libraries(logid ${CMAKE_THREAD_LIBS_INIT} ${EVDEV_LIBRARY} config++ ${HIDPP_LIBRARY})
install(TARGETS logid DESTINATION bin)

@ -0,0 +1 @@
Subproject commit d124f4ecf99ba73a3a190c8a60015d9916b25dc0
Loading…
Cancel
Save