Modified for standard Linux environment.
This commit is contained in:
parent
ddebae0877
commit
ec43d3ce9f
|
@ -0,0 +1,34 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(usbsio)
|
||||
|
||||
set(USBSIO_SRCS
|
||||
"src/lpcusbsio.c"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(USBSIO_HIDAPI_SRCS "src/hid_api/win/hid.c")
|
||||
elseif(APPLE)
|
||||
set(USBSIO_HIDAPI_SRCS "src/hid_api/mac/hid.c")
|
||||
else()
|
||||
set(USBSIO_HIDAPI_SRCS "src/hid_api/linux/hid.c")
|
||||
endif()
|
||||
|
||||
set(USBSIO_PRIVATE_INCS
|
||||
"src/hid_api/hidapi"
|
||||
)
|
||||
|
||||
set(USBSIO_INTERFACE_INCS
|
||||
"include"
|
||||
)
|
||||
|
||||
set(USBSIO_LIBRARIES
|
||||
"udev"
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} ${USBSIO_SRCS} ${USBSIO_HIDAPI_SRCS})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${USBSIO_LIBRARIES})
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE ${USBSIO_PRIVATE_INCS}
|
||||
PUBLIC ${USBSIO_INTERFACE_INCS}
|
||||
)
|
|
@ -20,6 +20,10 @@
|
|||
#define LPCUSBSIO_API
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
typedef int wchar_t;
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
/* Windows version requires the setupapi library */
|
||||
#pragma comment(lib,"setupapi.lib")
|
||||
|
|
Loading…
Reference in New Issue