]> git.mxchange.org Git - flightgear.git/blob - src/Input/CMakeLists.txt
Make compiling of all utils/tools optional
[flightgear.git] / src / Input / CMakeLists.txt
1 include(FlightGearComponent)
2
3 IF(APPLE)
4         set(EVENT_INPUT_SOURCES FGMacOSXEventInput.cxx)
5         set(EVENT_INPUT_HEADERS FGMacOSXEventInput.hxx)
6 elseif(MSVC)
7         message(STATUS "EventInput not implemented for Windows yet")
8 else()
9         set(EVENT_INPUT_SOURCES FGLinuxEventInput.cxx)
10         set(EVENT_INPUT_HEADERS FGLinuxEventInput.hxx)
11 endif()
12
13
14 set(SOURCES
15         FGButton.cxx
16         FGCommonInput.cxx
17         FGDeviceConfigurationMap.cxx
18         FGEventInput.cxx
19         FGJoystickInput.cxx
20         FGKeyboardInput.cxx
21         FGMouseInput.cxx
22         input.cxx
23         )
24
25 set(HEADERS
26         FGButton.hxx
27         FGCommonInput.hxx
28         FGDeviceConfigurationMap.hxx
29         FGEventInput.hxx
30         FGJoystickInput.hxx
31         FGKeyboardInput.hxx
32         FGMouseInput.hxx
33         input.hxx
34         )
35
36 if(EVENT_INPUT)
37         list(APPEND SOURCES ${EVENT_INPUT_SOURCES})
38         list(APPEND SOURCES ${EVENT_INPUT_HEADERS})
39         include_directories(${UDEV_INCLUDE_DIR})
40 endif()
41
42 if(ENABLE_FGJS)
43     set(FGJS_SOURCES
44         fgjs.cxx
45         jsinput.cxx
46         jssuper.cxx
47     )
48
49     add_executable(fgjs ${FGJS_SOURCES})
50     target_link_libraries(fgjs
51         ${SIMGEAR_CORE_LIBRARIES}
52         ${PLIB_LIBRARIES}
53         ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
54     )
55
56     install(TARGETS fgjs RUNTIME DESTINATION bin)
57 endif()
58
59 if(ENABLE_JS_DEMO)
60     add_executable(js_demo js_demo.cxx)
61     target_link_libraries(js_demo
62         ${SIMGEAR_CORE_LIBRARIES}
63         ${PLIB_LIBRARIES}
64         ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
65     )
66
67     install(TARGETS js_demo RUNTIME DESTINATION bin)
68 endif()
69
70 flightgear_component(Input "${SOURCES}" "${HEADERS}")