From 73430e1698e7410580221874123cd68952fefa8f Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 1 Sep 2015 14:24:58 +0200 Subject: [PATCH] CMake: add HAVE_LIBUDEV_H detection on Linux --- CMakeLists.txt | 4 ++++ config.h.cmake | 1 + gtk/CMakeLists.txt | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 737c15648..56329f10b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,6 +141,10 @@ if(ENABLE_NLS) include_directories(${INTL_INCLUDE_DIRS}) endif() +if(UNIX AND NOT APPLE) + include(CheckIncludeFiles) + check_include_files(libudev.h HAVE_LIBUDEV_H) +endif() include_directories( include/ diff --git a/config.h.cmake b/config.h.cmake index 831bfe181..35d7e2ac9 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -42,4 +42,5 @@ #cmakedefine HAVE_ZLIB 1 #cmakedefine HAVE_CU_GET_SUITE 1 #cmakedefine HAVE_CU_CURSES 1 +#cmakedefine HAVE_LIBUDEV_H 0 #cmakedefine ENABLE_NLS 1 diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 9808e441a..5bd36140d 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -97,6 +97,10 @@ if(ENABLE_NOTIFY) target_link_libraries(linphone-gtk ${NOTIFY_LIBRARIES}) endif() +if (HAVE_LIBUDEV_H) + target_link_libraries(linphone-gtk udev) +endif() + install(TARGETS linphone-gtk RUNTIME DESTINATION bin LIBRARY DESTINATION lib