New minimum version is CMake 3.7.2.
This patch has been rebased to incorporate changes that happened
since the creation of the original patch.
Original Author: A. Maitland Bottoms <bottoms@debian.org>, 07 Sep 2018
When trying to build a simple program which uses librtlsdr
as a subproject on Windows, CMake reported several problems
which were solved by:
- Added complete name of libusb in FindLibUSB module.
- Replaced CMAKE_SOURCE_DIR to PROJECT_SOURCE_DIR in src/CMakeLists.txt.
- Replaced header file <afxres.h> in src/rtlsdr.rc.in (only present when windows MFC is
installed) by <windows.h> which defines the same constants.
libusb < 1.0.9 doesn't have libusb_handle_events_timeout_completed(),
but libusb <= 1.0.8 doesn't have version.h, so we need to check
for the function.
The cmake-code was borrowed from UHD, which also checks
for libusb_error_name(), we add that as well since it might come
handy later on.
Signed-off-by: Steve Markgraf <steve@steve-m.de>