Commit graph

19 commits

Author SHA1 Message Date
Jon Szymaniak
d5718ca816 cmake: Updated FindLibUSB path default for v1.0.20 2016-06-27 15:17:35 -04:00
Nick "Darkfiber" Wolff
327dce57b1 host: Minimal build fixes for FreeBSD
Work still needs to be done to troubleshoot libusb issues.
2015-12-14 11:36:15 -05:00
Jon Szymaniak
90741dbd94 cmake: Set Windows-specific LIBUSB_PATH default only for WIN32 systems 2014-10-27 11:52:58 -04:00
Jon Szymaniak
97a44f94e4 cmake: Explicitly link libusb at runtime for version check in Windows
FindLibUSB.cmake presents issues with its try_compile() invocation
when using some dated CMake versions, such as 2.8.7 and 2.8.11, while
operating fine with more recent versions (e.g., 2.8.12.2, 3.0.0).

Using try_run() is a cleaner solution than a combination of try_compile() and
execute_process(). However, in Windows we need to stage libusb-1.0.dll in the
directory containing the resulting libusb_version.exe. As try_run() creates a
a temporary build directory and deletes it when done, this originally
posed a challenge to copying libusb-1.0.dll to the correct directory.

To address both of these challenges, the Windows version of this program now
explicitly links libusb at runtime, provided the path to the libusb DLL.

OSX and Linux variants assume libusb is in the library path, and link against
the library at compile-time.
2014-10-22 02:54:15 -04:00
Jon Szymaniak
34151f6e71 host: Added a config-time libusb version check and errors/warnings
FindLibUSB.cmake now fetches the libusb version via libusb_get_version()
so that we can warn (or error out) about the system containing an
outdated libusb version.

The following policies have been based upon support experiences and the
libusb changelog:

    Windows: Error out for libusb < 1.0.19
        v1.0.19 provides Windows 8 SuperSpeed detection support,
        and appears to address a number of issues bladeRF users
        have reported with v1.0.18 and earlier.

        We force users to update here, given that some of the failures
        on earlier versions were yielding corrupted samples.

    OSX: Warn for libusb < 1.0.18:
        v1.0.16 - v1.0.18 introduced SuperSpeed and 64-bit support,
        as well as fixes for compile-time and run-time issues.

    Linux: Warn for libusb < 1.0.16:
        This is largely based upon feedback from bladeRF users. While
        older versions may work, a number of users reported that issues
        appeared to be resolved after updating libusb to >= 1.0.16.
        (It isn't always clear if the reported update included Linux
         distro upgrades that included kernel updates.)

The version check may be skipped via LIBUSB_SKIP_VERSION_CHECK=Yes.
This is intentionally not noted in the warnings/errors, as it's
preferred that users update libusb rather than just skip the check.
2014-10-15 20:06:53 -04:00
Jon Szymaniak
a8d6065e61 cmake: Fixed if()/endif() mismatch
This was mistake was introduced in 62a0ab5e.
2014-10-02 11:47:33 -04:00
Jon Szymaniak
62a0ab5ee8 cmake: Skip libc & libusb version checks when cross-compiling
These checks break cross-compilation, as they require code to be
run on the host machine.
2014-10-01 02:44:49 -04:00
Jon Szymaniak
f607510500 cmake: Defaulted Windows LIBUSB_PATH to libusb-1.0.19 2014-07-22 23:26:58 -04:00
Jon Szymaniak
9c651b5996 cmake: Fixed default for LIBUSB_PATH (Windows) 2014-07-05 14:56:29 -04:00
Jon Szymaniak
2a90a56d55 host: Added additional configuration-time libusb function checks
Added checks for the following functions so that builds on older setups
will error out with error messages at configuration time, rather than
compilation errors at build time.
    - libusb_error_name()
    - libusb_get_device_speed()
    - libusb_handle_events_timeout()
    - libusb_handle_events_timeout_completed()
2014-05-13 00:09:53 -04:00
Jon Szymaniak
288258d58e host: Fixed FindLibUSB.cmake issues on OSX Mavericks, cmake touch-ups
Fixed Issue #242, where the FindLibUSB.cmake script wasn't finding a
libusb installed to /usr/local/ in the case where pkg-config wasn't
installed. This should also help in cases where pkg-config isn't
installed on Linux systems.

Other touch-ups include removal of an unnecessary warning message,
and some re-arrangement of operations.
2014-05-06 23:45:01 -04:00
Jon Szymaniak
95a6c1d0e0 cmake: Fixes and cleanup for libusb detection and version checks
The version checks are now enforced. (Fixes #130)

FindLibUsb now warns if the user is using < libusb-1.0.16, as this or
1.0.17 are *highly* recommended.

The redundant version check in Windows (ver.c) has been removed. Testing
with CMake 2.8.11.2 has shown check_library_exists() to be sufficient.
2013-12-09 23:53:38 -05:00
Ryan Tucker
c27a67fa63 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.
2013-10-05 20:53:43 -04:00
Jon Szymaniak
553985478b cmake: Added check for libusb_get_version (github edit)
This function is used by libbladeRF. This check effectively ensures the library is >= 1.0.10.
2013-09-19 10:03:35 -04:00
Jon Szymaniak
056c296b90 Fixed linking issue for Win64 hosts.
CMake's WIN32 is true for both 32 and 64-bit hosts, so we must
instead use CMAKE_CL_64 or CMAKE_SIZEOF_VOID_P.
2013-09-02 23:22:58 -04:00
Jon Szymaniak
d394f68084 host: Fixed build items broken by Windows build-related commits.
This includes freqmod's fixes provided in pull request/issue #57,
in addition to some other misc. cleanup items noted while reviewing
the aforementioned changset.
2013-08-25 11:16:07 -04:00
Jon Szymaniak
33365c196c host: Fixed a few minor CMake issues for Windows builds 2013-08-25 00:09:15 -04:00
Jon Szymaniak
98723ef149 host: Cleand up FindLibUSB.cmake to only search for libusb(x)-1.0
This file will likely need more test driving in Windows and OSX.
Use -DLIBUSB_PATH=<path> for binary distributions (most likely the
Windows folks)
2013-08-24 19:23:53 -04:00
Jon Szymaniak
6323d15990 libbladeRF & CLI: [WIP] In the process of switching over to CMake
*Warning:* This is a broken nightly commit.

If not obvious, quite a bit of rearranging has been done.

The build script(s) for libbladeRF is mostly complete. This still
requires further configuration of debug builds and version info being
used to populate a version header.

Some cleanup has been done in the (formerly apps, now) utilities
directory. There's no CMake support in here yet...that's comming in the
next commit.
2013-08-12 03:24:16 -04:00