Add libhidpp as submodule
This commit is contained in:
parent
0002d9f536
commit
00df833c54
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
|
@ -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:
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
1
src/logid/hidpp
Submodule
1
src/logid/hidpp
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit d124f4ecf99ba73a3a190c8a60015d9916b25dc0
|
Loading…
Reference in New Issue
Block a user