forked from inspirit/PS3EYEDriver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
58 lines (49 loc) · 1.46 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
53
54
55
56
57
58
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
add_definitions(-DNOMINMAX)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DPS3EYE_DEBUG)
if(NOT WIN32)
add_definitions(-pthread)
link_libraries(-pthread)
endif()
if(NOT MSVC)
if(PKG_CONFIG_FOUND)
pkg_check_modules(libusb "libusb-1.0" QUIET)
endif()
if(libusb_FOUND)
include_directories(SYSTEM ${libusb_INCLUDE_DIRS})
link_libraries(${libusb_LIBRARIES})
endif()
else()
set(SDK_LIBUSB CACHE PATH "")
if(SDK_LIBUSB)
set(libusb_FOUND TRUE)
link_directories("${SDK_LIBUSB}")
include_directories(SYSTEM "${SDK_LIBUSB}")
link_libraries(libusb-1.0)
endif()
endif()
if(libusb_FOUND)
add_library(ps3eye-driver STATIC
"ps3eye.cpp"
"urb.cpp"
"queue.cpp"
"mgr.cpp"
"accessors.cpp"
)
endif()
if(TARGET ps3eye-driver)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(SDL2 QUIET)
if(SDL2_FOUND)
include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
link_libraries(${SDL2_LIBRARIES})
link_libraries(ps3eye-driver)
add_executable(ps3eye-sdl "sdl.cxx")
endif()
add_executable(ps3eye-mode-test "mode-test.cxx")
target_link_libraries(ps3eye-mode-test ps3eye-driver)
add_executable(ps3eye-frame-test "frame-test.cxx")
target_link_libraries(ps3eye-frame-test ps3eye-driver)
endif()