InputConfiguration.cmake 1.7 KB

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