InputConfiguration.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. message(STATUS ${CMAKE_FIND_ROOT_PATH})
  2. OPTION(ENABLE_SDL2 "Enable SDL2 for joystick handling" ON)
  3. if(ENABLE_SDL2)
  4. find_package(SDL2)
  5. if(SDL2_FOUND)
  6. if(APPLE)
  7. # find_package(Iconv)
  8. # list(APPEND SDL2_LIBRARY ${ICONV_LIBRARIES})
  9. find_package(Iconv REQUIRED)
  10. find_library(FORCEFEEDBACK ForceFeedback)
  11. find_library(CARBON Carbon)
  12. find_library(COREAUDIO CoreAudio)
  13. find_library(COREVIDEO CoreVideo)
  14. find_library(AUDIOUNIT AudioUnit)
  15. list(APPEND SDL2_LIBRARY ${FORCEFEEDBACK} ${CARBON} ${COREAUDIO} ${AUDIOUNIT} ${COREVIDEO} ${ICONV_LIBRARIES})
  16. endif(APPLE)
  17. if(UNIX AND NOT APPLE)
  18. find_package(Iconv)
  19. if(NOT ICONV_FOUND)
  20. unset(SDL2_FOUND)
  21. endif(NOT ICONV_FOUND)
  22. find_package(DL)
  23. if(NOT DL_FOUND)
  24. unset(SDL2_FOUND)
  25. endif(NOT DL_FOUND)
  26. list(APPEND SDL2_LIBRARY ${ICONV_LIBRARIES} ${DL_LIBRARIES})
  27. endif()
  28. endif(SDL2_FOUND)
  29. if(SDL2_FOUND)
  30. list(APPEND ENABLED_INPUTS SDL2)
  31. add_definitions(-DHAVE_SDL)
  32. include_directories(${SDL2_INCLUDE_DIR})
  33. set(EXTRA_LIBS ${SDL2_LIBRARY})
  34. endif(SDL2_FOUND)
  35. endif(ENABLE_SDL2)
  36. OPTION(ENABLE_CEC "Enable HDMI/CEC support with libCEC" ON)
  37. if(ENABLE_CEC)
  38. find_package(CEC)
  39. if(CEC_FOUND)
  40. list(APPEND ENABLED_INPUTS CEC)
  41. add_definitions(-DHAVE_CEC)
  42. include_directories(${CEC_INCLUDE_DIR})
  43. set(EXTRA_LIBS ${EXTRA_LIBS} ${CEC_LIBRARY})
  44. endif(CEC_FOUND)
  45. endif(ENABLE_CEC)
  46. if(UNIX AND NOT APPLE)
  47. OPTION(ENABLE_LIRC "Enable LIRC for Linux IR handling" ON)
  48. if(ENABLE_LIRC)
  49. list(APPEND ENABLED_INPUTS LIRC)
  50. add_definitions(-DHAVE_LIRC)
  51. endif(ENABLE_LIRC)
  52. endif(UNIX AND NOT APPLE)
  53. if(APPLE)
  54. list(APPEND ENABLED_INPUTS "AppleRemote")
  55. endif(APPLE)
  56. string(REPLACE ";" " " _STR "${ENABLED_INPUTS}")
  57. message(STATUS "Enabled Inputs: " ${_STR})