From: Kefu Chai Date: Fri, 22 Jul 2016 05:15:54 +0000 (+0800) Subject: cmake: cleanup Findudev.cmake X-Git-Tag: ses5-milestone5~300^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=98c3df5a0d79417ef89f08ca5f79f4e8979eccba;p=ceph.git cmake: cleanup Findudev.cmake remove the crufts for handling the REQUIRED argument. Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/Findudev.cmake b/cmake/modules/Findudev.cmake index 5409a079cf9..fd936fc8887 100644 --- a/cmake/modules/Findudev.cmake +++ b/cmake/modules/Findudev.cmake @@ -24,34 +24,11 @@ # UDEV_FOUND - True if udev found. find_path(UDEV_INCLUDE_DIR libudev.h) +find_library(UDEV_LIBRARIES udev) -set(UDEV_NAMES ${UDEV_NAMES} udev) -find_library(UDEV_LIBRARY NAMES ${UDEV_NAMES}) - -if(UDEV_INCLUDE_DIR AND UDEV_LIBRARY) - set(UDEV_FOUND TRUE) - set(UDEV_LIBRARIES ${UDEV_LIBRARY}) -else() - set(UDEV_FOUND FALSE) - set(UDEV_LIBRARIES) -endif() - -if(UDEV_FOUND) - message(STATUS "Found libudev: ${UDEV_LIBRARY}") -else() - message(STATUS "Not Found libudev: ${UDEV_LIBRARY}") - if(UDEV_FIND_REQUIRED) - message(STATUS "Looked for libudev named ${UDEV_NAMES}.") - message(FATAL_ERROR "Could NOT find libudev") - endif() -endif() - -# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if -# all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(udev DEFAULT_MSG UDEV_LIBRARIES UDEV_INCLUDE_DIR) mark_as_advanced( - UDEV_LIBRARY - UDEV_INCLUDE_DIR -) + UDEV_LIBRARIES + UDEV_INCLUDE_DIR)