From c27a67fa63d9815aaed5a4b5d3733af1b2d9e4fa Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Sat, 5 Oct 2013 20:53:43 -0400 Subject: [PATCH] Warn the user if pkg-config isn't installed Helpfully suggest installing pkg-config if FindLibUSB.cmake fails. This change should not impact the build mechanics. --- host/cmake/modules/FindLibUSB.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/host/cmake/modules/FindLibUSB.cmake b/host/cmake/modules/FindLibUSB.cmake index e8211384..ce6bb546 100644 --- a/host/cmake/modules/FindLibUSB.cmake +++ b/host/cmake/modules/FindLibUSB.cmake @@ -41,6 +41,10 @@ set(LIBUSB_PATH find_package ( PkgConfig ) if ( PKG_CONFIG_FOUND ) pkg_check_modules ( PKGCONFIG_LIBUSB libusb-1.0 ) +else ( PKG_CONFIG_FOUND ) + if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) + message ( WARNING "Could not find pkg-config, which is a build dependency. If libusb-1.0 can't be found, please install pkg-config." ) + endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) endif ( PKG_CONFIG_FOUND ) if ( PKGCONFIG_LIBUSB_FOUND ) @@ -118,5 +122,5 @@ if ( LIBUSB_FOUND ) check_library_exists ( "${usb_LIBRARY}" libusb_handle_events_timeout_completed "" LIBUSB_VERSION_1.0 ) check_library_exists ( "${usb_LIBRARY}" libusb_get_version "" LIBUSB_VERSION_1.0 ) else () - message ( FATAL_ERROR "libusb-1.0 not found - is it installed? If you're using a binary distribution, try setting -DLIBUSB_PATH=." ) + message ( FATAL_ERROR "libusb-1.0 not found - is it installed? If you're using a binary distribution, try setting -DLIBUSB_PATH=. If pkg-config wasn't found, try installing it." ) endif ( LIBUSB_FOUND )