-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakelists.txt
52 lines (41 loc) · 1.33 KB
/
CMakelists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# OSVR Central Libraries
#
cmake_minimum_required(VERSION 3.0)
project(com_sensics_usb_monitor)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
option(BUILD_SHARED_LIBS "Build Shared Libs" ON)
set(EXPORT_BASENAME "OSVR_USBDETECTION")
set(LIBNAME_FULL "osvrUSBDetection")
include(PlatformDefinitions)
define_platform_macros(OSVR)
configure_file("Export.h.in"
Export.h
@ONLY NEWLINE_STYLE LF)
configure_file(PlatformConfig.h.in
"${CMAKE_CURRENT_BINARY_DIR}/PlatformConfig.h")
if(WIN32)
find_package(WinHID REQUIRED)
find_package(WindowsSDK REQUIRED)
endif()
set(API USBDetectionC.h)
set(SOURCES USBDetection.h
USBDetectionC.cpp
USBCallbackTypesC.h
USBDeviceC.h
USBReturnCodesC.h
"${CMAKE_CURRENT_BINARY_DIR}/Export.h"
"${CMAKE_CURRENT_BINARY_DIR}/PlatformConfig.h")
add_library(${LIBNAME_FULL}
${API}
${SOURCES})
target_link_libraries(${LIBNAME_FULL}
${WINHID_LIBRARIES})
add_executable(USBDetectionExampleC
USBDetectionExampleC.c)
target_link_libraries(USBDetectionExampleC
PRIVATE ${LIBNAME_FULL})
install(TARGETS ${LIBNAME_FULL}
RUNTIME DESTINATION ./)