Proper detection for udev.

This commit is contained in:
wb2osz 2020-01-19 18:44:25 -05:00
parent 7e44139eb3
commit c2b231494a
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,9 @@ find_library(UDEV_LIBRARY
PATHS
${PC_LIBUDEV_LIBRARY_DIRS}
${PC_LIBUDEV_LIBDIR}
/usr/lib64
/usr/lib
/usr/local/lib
HINTS
"${UDEV_ROOT_DIR}"
PATH_SUFFIXES
@ -49,6 +52,8 @@ find_path(UDEV_INCLUDE_DIR
NAMES
libudev.h
PATHS
/usr/include
/usr/local/include
${PC_LIBUDEV_INCLUDE_DIRS}
${PC_LIBUDEV_INCLUDEDIR}
HINTS
@ -66,6 +71,10 @@ find_package_handle_standard_args(UDEV
UDEV_INCLUDE_DIR
)
if (UDEV_INCLUDE_DIR AND UDEV_LIBRARY)
set(UDEV_FOUND TRUE)
endif (UDEV_INCLUDE_DIR AND UDEV_LIBRARY)
if(UDEV_FOUND)
list(APPEND UDEV_LIBRARIES ${UDEV_LIBRARY})
list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})