From f6d17d9b7b044a3e2853580c9378ee07eb220324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Sun, 3 Oct 2010 12:40:46 +0000 Subject: Add UDev finder. Not passed through revision because we needed it for the Solid sprint. Please, if it is wrong just tell me and I will take care of fixing it. CCMAIL: kde-buildsystem@kde.org svn path=/trunk/KDE/kdelibs/; revision=1182131 --- modules/FindUDev.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/FindUDev.cmake (limited to 'modules/FindUDev.cmake') diff --git a/modules/FindUDev.cmake b/modules/FindUDev.cmake new file mode 100644 index 00000000..dd25d63c --- /dev/null +++ b/modules/FindUDev.cmake @@ -0,0 +1,19 @@ +# - Try to find UDev +# Once done this will define +# +# UDEV_FOUND - system has UDev +# UDEV_LIBS - The libraries needed to use UDev + +# Copyright (c) 2010, Rafael Fernández López, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +find_library(UDEV_LIBS udev) + +if(UDEV_LIBS) + set(UDEV_FOUND TRUE) +endif(UDEV_LIBS) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR) -- cgit v1.2.1 From 7c976ea2005da3b4f1fd3c0cc0e4391a606b7399 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Sun, 3 Oct 2010 13:10:29 +0000 Subject: Make the module actually works for me. Seems to be the more standard way to deal with this kind of detection. CCMAIL: ereslibre@kde.org CCMAIL: kde-buildsystem@kde.org svn path=/trunk/KDE/kdelibs/; revision=1182142 --- modules/FindUDev.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/FindUDev.cmake') diff --git a/modules/FindUDev.cmake b/modules/FindUDev.cmake index dd25d63c..4c8390db 100644 --- a/modules/FindUDev.cmake +++ b/modules/FindUDev.cmake @@ -2,18 +2,18 @@ # Once done this will define # # UDEV_FOUND - system has UDev -# UDEV_LIBS - The libraries needed to use UDev +# UDEV_INCLUDE_DIR - the libudev include directory +# UDEV_LIBS - The libudev libraries # Copyright (c) 2010, Rafael Fernández López, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. +find_path(UDEV_INCLUDE_DIR libudev.h) find_library(UDEV_LIBS udev) -if(UDEV_LIBS) - set(UDEV_FOUND TRUE) -endif(UDEV_LIBS) - include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_LIBRARY UDEV_INCLUDE_DIR) +find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIR UDEV_LIBS) + +mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS) -- cgit v1.2.1