forked from capull0/SkyDumper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (21 loc) · 889 Bytes
/
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
cmake_minimum_required(VERSION 3.5)
project(SkyDumper)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(libusb-1.0 REQUIRED)
include_directories(include ${LIBUSB_1_INCLUDE_DIRS})
set(SOURCE_FILES main.cpp skylander.cpp include/skylander.h portalio.cpp include/portalio.h include/hidapi.h)
if (UNIX)
set(SOURCE_FILES ${SOURCE_FILES} hid_linux.c)
set(SL_LIBS ${LIBUSB_1_LIBRARIES} pthread)
elseif(MINGW)
set(SOURCE_FILES ${SOURCE_FILES} hid_win.c)
set(SL_LIBS ${LIBUSB_1_LIBRARIES} pthread)
elseif(APPLE)
set(SOURCE_FILES ${SOURCE_FILES} hid.c)
set(SL_LIBS ${LIBUSB_1_LIBRARIES} "-framework CoreFoundation" "-framework IOKit")
else(UNIX)
message(FATAL_ERROR "Not supported platform")
endif(UNIX)
add_executable(SkyDumper ${SOURCE_FILES})
target_link_libraries(SkyDumper ${SL_LIBS})