This repository has been archived by the owner on May 16, 2021. It is now read-only.
forked from xbmc/peripheral.joystick
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import CMake build system from https://github.com/notspiff/peripheral…
….joystick Only linux side is handled ATM
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
.libs | ||
.project | ||
|
||
build | ||
Build | ||
|
||
.dummy | ||
.dummy.in | ||
aclocal.m4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
project(peripheral.joystick) | ||
|
||
cmake_minimum_required(VERSION 2.6) | ||
|
||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) | ||
|
||
enable_language(CXX) | ||
|
||
find_package(kodi REQUIRED) | ||
find_package(kodiplatform REQUIRED) | ||
find_package(Sdl) | ||
|
||
include_directories(${kodiplatform_INCLUDE_DIRS} | ||
${SDL_INCLUDE_DIRS} | ||
${KODI_INCLUDE_DIR} | ||
${PROJECT_SOURCE_DIR}/src) | ||
|
||
set(DEPLIBS ${kodiplatform_LIBRARIES}) | ||
|
||
set(JOYSTICK_SOURCES src/addon.cpp | ||
src/api/Joystick.cpp | ||
src/api/JoystickInterface.cpp | ||
src/api/JoystickManager.cpp | ||
src/log/Log.cpp | ||
src/log/LogAddon.cpp | ||
src/log/LogConsole.cpp | ||
src/log/LogSyslog.cpp) | ||
|
||
if(SDL_FOUND) | ||
list(APPEND JOYSTICK_SOURCES src/api/sdl/JoystickInterfaceSDL.cpp | ||
src/api/sdl/JoystickSDL.cpp) | ||
list(APPEND DEPLIBS ${SDL_LIBRARIES}) | ||
endif() | ||
if(LINUX) | ||
list(APPEND JOYSTICK_SOURCES src/api/linux/JoystickInterfaceLinux.cpp | ||
src/api/linux/JoystickLinux.cpp) | ||
endif() | ||
|
||
build_addon(peripheral.joystick JOYSTICK DEPLIBS) | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# - Try to find SDL2 | ||
# Once done this will define | ||
# | ||
# SDL_FOUND - system has libSDL | ||
# SDL_INCLUDE_DIRS - the libSDL include directory | ||
# SDL_LIBRARIES - The libSDL libraries | ||
|
||
find_package(PkgConfig) | ||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules (SDL sdl2) | ||
else() | ||
find_package(SDL) | ||
list(APPEND SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR}) | ||
list(APPEND SDL_LIBRARIES ${SDL_LIBRARIES}) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Sdl DEFAULT_MSG SDL_INCLUDE_DIRS SDL_LIBRARIES) | ||
|
||
list(APPEND SDL_DEFINITIONS -DHAVE_SDL=1) | ||
|
||
mark_as_advanced(SDL_INCLUDE_DIRS SDL_LIBRARIES SDL_DEFINITIONS) |