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