forked from xbmc/peripheral.joystick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
123 lines (89 loc) · 4.08 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
project(peripheral.joystick)
cmake_minimum_required(VERSION 2.6)
enable_language(CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
include(CheckIncludeFiles)
# --- Add-on Dependencies ------------------------------------------------------
find_package(kodi REQUIRED)
find_package(kodiplatform REQUIRED)
find_package(platform REQUIRED)
include_directories(${INCLUDES}
${PROJECT_SOURCE_DIR}/src
${KODI_INCLUDE_DIR}
${kodiplatform_INCLUDE_DIRS}
${platform_INCLUDE_DIRS})
set(JOYSTICK_SOURCES src/addon.cpp
src/api/Joystick.cpp
src/api/JoystickAsync.cpp
src/api/JoystickInterfaceCallback.cpp
src/api/JoystickManager.cpp
src/api/PeripheralScanner.cpp
src/filesystem/FileUtils.cpp
src/filesystem/ReadableFile.cpp
src/filesystem/SeekableFile.cpp
src/filesystem/vfs/VFSFile.cpp
src/filesystem/vfs/VFSFileUtils.cpp
src/JoystickTranslator.cpp
src/log/Log.cpp
src/log/LogAddon.cpp
src/log/LogConsole.cpp
src/settings/Settings.cpp
src/storage/ButtonMap.cpp
src/storage/Database.cpp
src/storage/Device.cpp
src/storage/StorageManager.cpp
src/storage/web/ButtonMapAPI.cpp
src/storage/web/ButtonMapQuery.cpp
src/storage/web/DatabaseWeb.cpp
src/storage/web/DeviceQuery.cpp
src/storage/web/UserID.cpp
src/storage/xml/ButtonMapXml.cpp
src/storage/xml/DatabaseXml.cpp
src/storage/xml/DeviceXml.cpp)
check_include_files("syslog.h" HAVE_SYSLOG)
if(HAVE_SYSLOG)
list(APPEND JOYSTICK_SOURCES src/log/LogSyslog.cpp)
endif()
list(APPEND DEPLIBS ${kodiplatform_LIBRARIES} ${platform_LIBRARIES})
# --- Cocoa --------------------------------------------------------------------
if("${CORE_SYSTEM_NAME}" STREQUAL "darwin")
find_library(COCOA_LIBRARY Cocoa)
add_definitions(-DHAVE_COCOA)
list(APPEND JOYSTICK_SOURCES src/api/cocoa/JoystickCocoa.cpp
src/api/cocoa/JoystickInterfaceCocoa.cpp)
list(APPEND DEPLIBS ${COCOA_LIBRARY})
endif()
# --- SDL ----------------------------------------------------------------------
if(NOT "${CORE_SYSTEM_NAME}" STREQUAL "windows")
find_package(Sdl)
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIRS})
add_definitions(-DHAVE_SDL)
list(APPEND JOYSTICK_SOURCES src/api/sdl/JoystickInterfaceSDL.cpp
src/api/sdl/JoystickSDL.cpp)
list(APPEND DEPLIBS ${SDL_LIBRARIES})
endif()
endif()
# --- Linux Joystick API -------------------------------------------------------
check_include_files(linux/joystick.h HAVE_LINUX_JOYSTICK_H)
if(HAVE_LINUX_JOYSTICK_H)
add_definitions(-DHAVE_LINUX_JOYSTICK)
list(APPEND JOYSTICK_SOURCES src/api/linux/JoystickInterfaceLinux.cpp
src/api/linux/JoystickLinux.cpp)
endif()
# --- DirectInput --------------------------------------------------------------
if("${CORE_SYSTEM_NAME}" STREQUAL "windows")
add_definitions(-DHAVE_DIRECT_INPUT)
list(APPEND JOYSTICK_SOURCES src/api/directinput/JoystickDirectInput.cpp
src/api/directinput/JoystickInterfaceDirectInput.cpp)
endif()
# --- XInput -------------------------------------------------------------------
if("${CORE_SYSTEM_NAME}" STREQUAL "windows")
add_definitions(-DHAVE_XINPUT)
list(APPEND JOYSTICK_SOURCES src/api/xinput/JoystickInterfaceXInput.cpp
src/api/xinput/JoystickXInput.cpp
src/api/xinput/XInputDLL.cpp)
endif()
# ------------------------------------------------------------------------------
build_addon(peripheral.joystick JOYSTICK DEPLIBS)
include(CPack)