InputCommon/CMakeLists: Include evdev and udev includes on a by-target basis

Avoids including the evdev/udev includes in the top-level directory
This commit is contained in:
Lioncash 2018-04-10 09:33:00 -04:00
parent 0bfeb37a1f
commit d63d0b5069
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
2 changed files with 5 additions and 1 deletions

View File

@ -491,7 +491,6 @@ if(ENABLE_EVDEV)
message(STATUS "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(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()

View File

@ -77,6 +77,11 @@ if(LIBEVDEV_FOUND AND LIBUDEV_FOUND)
target_sources(inputcommon PRIVATE
ControllerInterface/evdev/evdev.cpp
)
target_include_directories(inputcommon
PRIVATE
${LIBEVDEV_INCLUDE_DIR}
${LIBUDEV_INCLUDE_DIR}
)
target_link_libraries(inputcommon PUBLIC
${LIBEVDEV_LIBRARY}
${LIBUDEV_LIBRARY}