diff --git a/CMakeLists.txt b/CMakeLists.txt index 347b87c2b7..d6c1c4b05f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,10 @@ else() option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF) endif() +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ANDROID) + option(ENABLE_EVDEV "Enables the evdev controller backend" ON) +endif() + if(APPLE) option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF) endif() @@ -529,16 +533,16 @@ if(USE_EGL) add_definitions(-DUSE_EGL=1) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - include(FindLibudev OPTIONAL) - include(FindLibevdev OPTIONAL) +if(ENABLE_EVDEV) + include(FindLibudev REQUIRED) + include(FindLibevdev REQUIRED) if(LIBUDEV_FOUND AND LIBEVDEV_FOUND) message("libevdev/libudev found, enabling evdev controller backend") add_definitions(-DHAVE_LIBUDEV=1) add_definitions(-DHAVE_LIBEVDEV=1) include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR}) else() - message("Could find libevdev/libudev, disabling evdev controller backend") + message(FATAL_ERROR "Couldn't find libevdev and/or libudev. Can't build evdev controller backend.\nDisable ENABLE_EVDEV if you wish to build without controller support") endif() endif()