summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindUDev.cmake
blob: 97fa9560218881e866438526728211804f3f0b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# - Try to find udev
# Once done this will define
#
# UDEV_FOUND - system has libudev
# UDEV_INCLUDE_DIRS - the libudev include directory
# UDEV_LIBRARIES - The libudev libraries

if(PKG_CONFIG_FOUND)
  pkg_check_modules (UDEV libudev)
  list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDEDIR})
endif()

if(NOT UDEV_FOUND)
  find_path(UDEV_INCLUDE_DIRS libudev.h)
  find_library(UDEV_LIBRARIES udev)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIRS UDEV_LIBRARIES)

mark_as_advanced(UDEV_INCLUDE_DIRS UDEV_LIBRARIES)
list(APPEND UDEV_DEFINITIONS -DHAVE_LIBUDEV=1)