[hamradio-commits] [gnss-sdr] 228/251: detecting libusb-dev and including it as a dependency

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Wed Sep 2 00:22:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.

commit 785a1981b3d35c8a595a6678b6cecf6167c96bba
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Wed Jul 22 23:44:18 2015 +0200

    detecting libusb-dev and including it as a dependency
---
 drivers/gr-gn3s/README.md                   |  4 +-
 drivers/gr-gn3s/cmake/Modules/FindUSB.cmake | 68 +++++++++++++++++------------
 2 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/drivers/gr-gn3s/README.md b/drivers/gr-gn3s/README.md
index 77da75a..ee9cc73 100644
--- a/drivers/gr-gn3s/README.md
+++ b/drivers/gr-gn3s/README.md
@@ -14,10 +14,10 @@ GR-GN3S is a GNU Radio's compliant signal source block intended to be used eithe
 
 You can install GNU Radio through a .deb package *or* by using pybombs. Please choose only **one** of these two procedures.
 
-- In Ubuntu 12.10 and later, or Debian Jessie or later, install GNU Radio and its dependencies through a .deb package:
+- In Ubuntu 12.10 and later, or Debian Jessie or later, install GNU Radio and other dependencies through a .deb package:
 
 ~~~~~~ 
-$ sudo apt-get install gnuradio-dev 
+$ sudo apt-get install gnuradio-dev libusb-dev
 ~~~~~~
 
 
diff --git a/drivers/gr-gn3s/cmake/Modules/FindUSB.cmake b/drivers/gr-gn3s/cmake/Modules/FindUSB.cmake
index 43d170d..3b767d6 100644
--- a/drivers/gr-gn3s/cmake/Modules/FindUSB.cmake
+++ b/drivers/gr-gn3s/cmake/Modules/FindUSB.cmake
@@ -1,31 +1,45 @@
+
+
+find_path(USB_INCLUDE_DIR NAMES usb.h
+          PATHS /usr/include
+                /usr/local/include
+)
+
+if(NOT USB_INCLUDE_DIR_FOUND)
+   message(STATUS "libusb has not been found.")
+   message(STATUS "You can install it by 'sudo apt-get install libusb-dev' ")
+   message(ERROR "libusb is required for building gr-gn3s")
+endif(NOT USB_INCLUDE_DIR_FOUND)
+
+
 INCLUDE(FindPkgConfig)
+
 if(NOT LIBUSB_FOUND)
-  pkg_check_modules (LIBUSB_PKG libusb-1.0)
-  find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
-    PATHS
-    ${LIBUSB_PKG_INCLUDE_DIRS}
-    /usr/include/libusb-1.0
-    /usr/include
-    /usr/local/include
-    /opt/local/include/libusb-1.0
-  )
-
-  find_library(LIBUSB_LIBRARIES NAMES usb-1.0
-    PATHS
-    ${LIBUSB_PKG_LIBRARY_DIRS}
-    /usr/lib
-    /usr/local/lib
-    /opt/local/lib
-  )
-
-if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
-  set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
-  message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
-else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
-  set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
-  message(STATUS "libusb-1.0 not found.")
-endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
-
-mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
+   pkg_check_modules (LIBUSB_PKG libusb-1.0)
+   find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
+             PATHS ${LIBUSB_PKG_INCLUDE_DIRS}
+                   /usr/include/libusb-1.0
+                   /usr/include
+                   /usr/local/include
+                   /opt/local/include/libusb-1.0
+   )
+
+   find_library(LIBUSB_LIBRARIES NAMES usb-1.0
+                PATHS ${LIBUSB_PKG_LIBRARY_DIRS}
+                      /usr/lib
+                      /usr/local/lib
+                      /opt/local/lib
+   )
+
+   if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+      set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
+      message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
+   else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+      set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
+      message(STATUS "libusb-1.0 not found.")
+      message(STATUS "You can install it by 'sudo apt-get install libusb-1.0-0-dev'")
+   endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+
+   mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
 
 endif(NOT LIBUSB_FOUND)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list