| 1 |
# SPDX-License-Identifier: GPL-2.0-or-later |
| 2 |
# SPDX-FileCopyrightText: 2011 James Turner <[email protected]> |
| 3 |
|
| 4 |
include(FlightGearComponent) |
| 5 |
|
| 6 |
IF(APPLE) |
| 7 |
# no Mac implementation, use HID |
| 8 |
elseif(WIN32) |
| 9 |
# no Win32 specific implementation, at least for now |
| 10 |
else() |
| 11 |
set(EVENT_INPUT_SOURCES FGLinuxEventInput.cxx) |
| 12 |
set(EVENT_INPUT_HEADERS FGLinuxEventInput.hxx) |
| 13 |
endif() |
| 14 |
|
| 15 |
if (ENABLE_HID_INPUT) |
| 16 |
list(APPEND EVENT_INPUT_SOURCES FGHIDEventInput.cxx FGHIDUsage.cxx) |
| 17 |
list(APPEND EVENT_INPUT_HEADERS FGHIDEventInput.hxx FGHIDUsage.hxx) |
| 18 |
endif() |
| 19 |
|
| 20 |
set(SOURCES |
| 21 |
FGButton.cxx |
| 22 |
FGCommonInput.cxx |
| 23 |
FGDeviceConfigurationMap.cxx |
| 24 |
FGEventInput.cxx |
| 25 |
FGKeyboardInput.cxx |
| 26 |
FGMouseInput.cxx |
| 27 |
input.cxx |
| 28 |
) |
| 29 |
|
| 30 |
set(HEADERS |
| 31 |
FGButton.hxx |
| 32 |
FGCommonInput.hxx |
| 33 |
FGDeviceConfigurationMap.hxx |
| 34 |
FGEventInput.hxx |
| 35 |
FGKeyboardInput.hxx |
| 36 |
FGMouseInput.hxx |
| 37 |
input.hxx |
| 38 |
) |
| 39 |
|
| 40 |
if (ENABLE_PLIB_JOYSTICK) |
| 41 |
list(APPEND SOURCES FGJoystickInput.cxx) |
| 42 |
list(APPEND HEADERS FGJoystickInput.hxx) |
| 43 |
endif() |
| 44 |
|
| 45 |
if(EVENT_INPUT) |
| 46 |
list(APPEND SOURCES ${EVENT_INPUT_SOURCES}) |
| 47 |
list(APPEND HEADERS ${EVENT_INPUT_HEADERS}) |
| 48 |
include_directories(${UDEV_INCLUDE_DIR}) |
| 49 |
endif() |
| 50 |
|
| 51 |
if(ENABLE_FGJS AND ENABLE_PLIB_JOYSTICK) |
| 52 |
set(FGJS_SOURCES |
| 53 |
fgjs.cxx |
| 54 |
jsinput.cxx |
| 55 |
jssuper.cxx |
| 56 |
) |
| 57 |
|
| 58 |
add_executable(fgjs ${FGJS_SOURCES}) |
| 59 |
target_link_libraries(fgjs |
| 60 |
SimGearCore |
| 61 |
PLIBJoystick |
| 62 |
) |
| 63 |
|
| 64 |
install(TARGETS fgjs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 65 |
endif() |
| 66 |
|
| 67 |
if(ENABLE_JS_DEMO AND ENABLE_PLIB_JOYSTICK) |
| 68 |
add_executable(js_demo js_demo.cxx) |
| 69 |
target_link_libraries(js_demo |
| 70 |
SimGearCore |
| 71 |
PLIBJoystick |
| 72 |
) |
| 73 |
|
| 74 |
install(TARGETS js_demo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 75 |
endif() |
| 76 |
|
| 77 |
if (ENABLE_HID_INPUT) |
| 78 |
if (COMMAND flightgear_test) |
| 79 |
set(HID_INPUT_TEST_SOURCES test_hidinput.cxx FGEventInput.cxx |
| 80 |
FGCommonInput.cxx FGDeviceConfigurationMap.cxx) |
| 81 |
|
| 82 |
flightgear_test(hidinput "${HID_INPUT_TEST_SOURCES}") |
| 83 |
target_link_libraries(hidinput ${EVENT_INPUT_LIBRARIES} hidapi) |
| 84 |
endif() |
| 85 |
endif() |
| 86 |
|
| 87 |
flightgear_component(Input "${SOURCES}" "${HEADERS}") |