From f37c23b1a7715158031a39ae124df6739a99a2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sat, 26 Apr 2014 13:44:58 -0400 Subject: [PATCH] channels/urbdrc: fix cmake scripts --- channels/urbdrc/CMakeLists.txt | 18 ++++++++++++++++-- channels/urbdrc/client/CMakeLists.txt | 4 ---- channels/urbdrc/client/libusb/CMakeLists.txt | 14 +++++--------- cmake/FindDbusGlib.cmake | 6 +++++- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/channels/urbdrc/CMakeLists.txt b/channels/urbdrc/CMakeLists.txt index 4a59f7b4f..2e10bd89b 100644 --- a/channels/urbdrc/CMakeLists.txt +++ b/channels/urbdrc/CMakeLists.txt @@ -17,6 +17,20 @@ define_channel("urbdrc") -if(WITH_CLIENT_CHANNELS) - add_channel_client(${MODULE_PREFIX} ${CHANNEL_NAME}) +if(NOT WIN32) + find_package(UDev) + find_package(UUID) + find_package(DbusGlib) + find_package(libusb-1.0) +endif() + +if(UDEV_FOUND AND UUID_FOUND AND DBUS_GLIB_FOUND AND LIBUSB_1_FOUND) + set(URBDRC_DEPENDENCIES_FOUND TRUE) + message(STATUS "Found all URBDRC dependencies") +endif() + +if(WITH_CLIENT_CHANNELS) + if(URBDRC_DEPENDENCIES_FOUND) + add_channel_client(${MODULE_PREFIX} ${CHANNEL_NAME}) + endif() endif() diff --git a/channels/urbdrc/client/CMakeLists.txt b/channels/urbdrc/client/CMakeLists.txt index 14f62b884..7af13726c 100644 --- a/channels/urbdrc/client/CMakeLists.txt +++ b/channels/urbdrc/client/CMakeLists.txt @@ -31,10 +31,6 @@ set(${MODULE_PREFIX}_SRCS include_directories(..) -find_package(UDev REQUIRED) -find_package(UUID REQUIRED) -find_package(DbusGlib REQUIRED) - add_channel_client_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} TRUE "DVCPluginEntry") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") diff --git a/channels/urbdrc/client/libusb/CMakeLists.txt b/channels/urbdrc/client/libusb/CMakeLists.txt index 47688b9b0..49386f48f 100644 --- a/channels/urbdrc/client/libusb/CMakeLists.txt +++ b/channels/urbdrc/client/libusb/CMakeLists.txt @@ -27,8 +27,6 @@ set(${MODULE_PREFIX}_SRCS include_directories(..) -find_package(libusb-1.0 REQUIRED) - add_channel_client_subsystem_library(${MODULE_PREFIX} ${MODULE_NAME} ${CHANNEL_NAME} "" TRUE "") set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "") @@ -37,10 +35,9 @@ set(${MODULE_PREFIX}_LIBS ${CMAKE_THREAD_LIBS_INIT}) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} - ${DBUS_GLIB_LIBRARIES} - ${UUID_LIBRARIES} - ${LIBUSB_1_LIBRARIES} - ) + ${DBUS_GLIB_LIBRARIES} + ${UUID_LIBRARIES} + ${LIBUSB_1_LIBRARIES}) set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD} @@ -49,6 +46,5 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) -if(NOT STATIC_CHANNELS) - install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH}) -endif() +install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH} EXPORT FreeRDPTargets) + diff --git a/cmake/FindDbusGlib.cmake b/cmake/FindDbusGlib.cmake index 95c64e48a..304860a27 100644 --- a/cmake/FindDbusGlib.cmake +++ b/cmake/FindDbusGlib.cmake @@ -35,4 +35,8 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(dbus-glib DEFAULT_MSG DBUS_GLIB_LIBRARY DBUS_GLIB_INCLUDE_DIR) -mark_as_advanced(DBUS_GLIB_INCLUDE_DIR DBUS_GLIB_LIBRARY ) +if(DBUS_GLIB_LIBRARIES AND DBUS_GLIB_INCLUDE_DIRS) + set(DBUS_GLIB_FOUND TRUE) +endif() + +mark_as_advanced(DBUS_GLIB_INCLUDE_DIR DBUS_GLIB_LIBRARY)