CMake Warning: libusb dependency
See original GitHub issueHey Wolfgang,
I’m running into the following issue whenever I try to build the crazyflie_ros workspace for the crazyswarm package:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
catkin_package() DEPENDS on '/usr/lib/x86_64-linux-gnu/libusb-1.0.so
but neither '/usr/lib/x86_64-linux-gnu/libusb-1.0.so_INCLUDE_DIRS' nor
/usr/lib/x86_64-linux-gnu/libusb-1.0.so_LIBRARIES' is defined.
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
crazyflie_ros/crazyflie_cpp/CMakeLists.txt:19 (catkin_package)
Running the command dpkg -l libusb*
gives me:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii libusb-0.1-4:a 2:0.1.12-28 amd64 userspace USB programming library
ii libusb-1.0-0:a 2:1.0.20-1 amd64 userspace USB programming library
ii libusb-1.0-0-d 2:1.0.20-1 amd64 userspace USB programming library
ii libusb-1.0-doc 2:1.0.20-1 all documentation for userspace USB p
un libusb-dev <none> <none> (no description available)
un libusbmuxd-too <none> <none> (no description available)
ii libusbmuxd4:am 1.0.10-2ubun amd64 USB multiplexor daemon for iPhone
Running locate libusb | grep .so
gives me:
/lib/x86_64-linux-gnu/libusb-0.1.so.4
/lib/x86_64-linux-gnu/libusb-0.1.so.4.4.4
/lib/x86_64-linux-gnu/libusb-1.0.so.0
/lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0
/usr/lib/x86_64-linux-gnu/libusbmuxd.so.4
/usr/lib/x86_64-linux-gnu/libusbmuxd.so.4.0.0
I am using a “fresh” installation of ubuntu 16.04 (as an admin) and ROS Kinetic. I’ve been searching online for answers but I am coming up short (I probably don’t know the right questions to ask).
Do you have any ideas?
Thanks, Kyle
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Your understanding is correct. Actually you only need to change ROS.cmake files (the other ones are used if you want to build crazyflie_tools standalone, i.e. without any ROS [which might be useful for debugging/trouble shooting]).
If it works with WSL, please let us know and we can update the documentation accordingly.
So after doing some digging around, I think I’ve figured out what is going on. The appearance of this warning is due to a change in the catkin_package.cmake files of catkin from version 0.6.19 (included with indigo) to version 0.7.6 (included with kinetic). When parsing through the list of provided dependencies, this script checks a different set of conditions based on which version is being used:
catkin 0.6.19 (line 160):
if(NOT ${${depend_name}_FOUND})
catkin 0.7.6 (line 165):if(NOT DEFINED ${depend_name}_INCLUDE_DIRS AND NOT DEFINED ${depend_name}_LIBRARIES)
The “issue” is that the CMakeLists.txt files of the crazyswarm package use
find_library(USB_LIB usb-1.0)
which only sets the variableUSB_LIB
to the full path of the desired library. It does not defineUSB_LIB_FOUND
,USB_LIB_INCLUDE_DIRS
, orUSB_LIB_LIBRARIES
. So Catkin 0.6.19 did not throw a warning (which is probably why this condition was changed), however the Kinetic version does.A search utilizing something like:
might be more appropriate to “properly” link the library?
As it is, since
${USB_LIB}
assess to the full path of the library’s ‘.so
’ file and the CMakeLists.txt files use:I don’t think this warning is pointing to any issues linking the usb library. BTW, what does the
catkin_make -k
command do? I have not been able to find any documentation on that option.