InputConfiguration.cmake 1.6 KB

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