]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: cleanup Findudev.cmake
authorKefu Chai <kchai@redhat.com>
Fri, 22 Jul 2016 05:15:54 +0000 (13:15 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 25 Jul 2016 07:40:30 +0000 (15:40 +0800)
remove the crufts for handling the REQUIRED argument.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/Findudev.cmake

index 5409a079cf9c44a597fc5813d5f4aadc8c11acec..fd936fc8887e0543059d5f80d6813ea22ec7c1c8 100644 (file)
 # 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)