luxonis / XLink

A cross-platform library for communicating with devices over various physical links.
Apache License 2.0
12 stars 18 forks source link

Fix LIBUSB_INCLUDE_DIR value when using XLINK_LIBUSB_SYSTEM #78

Closed traversaro closed 3 months ago

traversaro commented 3 months ago

Before this PR, with XLINK_LIBUSB_SYSTEM set to ON~ iflibusbwas installed in, theLIBUSB_INCLUDE_DIRvariable contained the path\include\libusb-1.0`.

However, the code itself includes the libusb headers as #include <libusb-1.0\libusb.h>, and so using <install_prefix>\include\libusb-1.0 resulted in errors related to the fact that libusb-1.0\libusb.h could not be found.

After this PR, LIBUSB_INCLUDE_DIR variable will contain the path <install_prefix>\include, ensuring that the correct include header is passed to the pre-processor.

I guess that this problem was never detected as the <install_prefix>\include of libusb was in the header path of the system, and so the compilation ended up well anyhow, but the compilation fails if the external libusb used is not installed in the system prefix.

traversaro commented 3 months ago

The Windows failure is unrelated and related to https://github.com/luxonis/depthai-core/pull/1037 and https://github.com/cpp-pm/hunter/pull/747 .