Skip to content

Commit

Permalink
cmake: cleanup Findudev.cmake
Browse files Browse the repository at this point in the history
remove the crufts for handling the REQUIRED argument.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jul 25, 2016
1 parent 342d827 commit 98c3df5
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions cmake/modules/Findudev.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 98c3df5

Please sign in to comment.