forked from sensestage/hidapi
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reconfigure build to link vendor hidapi and separate components
- Loading branch information
1 parent
695b5f9
commit 7d550ff
Showing
4 changed files
with
26 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
message(STATUS " hidapi_parser" ) | ||
project(hidapi_parser) | ||
find_package(hidapi REQUIRED) | ||
option(HID_DEBUG_PARSER "verbose parser debugging output" OFF) | ||
option(HID_PARSER_TEST "install hidparsertest" OFF) | ||
if( HID_DEBUG_PARSER ) | ||
add_definitions( -DDEBUG_PARSER ) | ||
endif() | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
add_definitions( -DLINUX_FREEBSD ) | ||
endif() | ||
|
||
# message( "hidapi parser source dir is: ${hidapi_SOURCE_DIR}" ) | ||
# | ||
# set( hidapi_parser_INCLUDE_DIRS ${hidapi_SOURCE_DIR}/hidapi_parser/) | ||
# # set( hidapi_LIBS ${UDEV_LIBRARIES}) | ||
# set( hidapi_parser_SRCS hidapi_parser.c ) | ||
# | ||
# message( "hidapi_parser include dirs are: ${hidapi_parser_INCLUDE_DIRS}" ) | ||
set(SOURCES hidapi_parser.c) | ||
set(HEADERS hidapi_parser.h) | ||
add_library( hidapi_parser STATIC ${SOURCES} ) | ||
|
||
include_directories( ${hidapi_SOURCE_DIR}/hidapi/ ) | ||
add_library( hidapi_parser STATIC hidapi_parser.c ) | ||
target_link_libraries( hidapi ) | ||
target_link_libraries(hidapi_parser hidapi::hidapi) | ||
target_include_directories(hidapi_parser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
message(STATUS " hidparsertest" ) | ||
|
||
include_directories( | ||
${CMAKE_BINARY_DIR} | ||
${hidapi_SOURCE_DIR}/hidapi/ | ||
${hidapi_SOURCE_DIR}/hidapi_parser/ | ||
) | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}/hidapi_parser/) | ||
add_executable( hidparsertest hidparsertest.c ) | ||
|
||
target_link_libraries(hidparsertest hidapi hidapi_parser ${EXTRA_LIBS} m) | ||
target_link_libraries(hidparsertest hidapi::hidapi hidapi_parser ${EXTRA_LIBS} m) | ||
|
||
install(TARGETS hidparsertest DESTINATION bin) |