Commit Graph

6 Commits (development)

Author SHA1 Message Date
Thomas Petazzoni 7396271f26 cmake/Modules/Version.cmake: don't use Git version if not in a Git repo
If the librtlsdr code comes from a tarball, it doesn't have any .git/
metadata, and therefore even if Git (as a tool) is found, the logic in
cmake/Modules/Version.cmake fails finding a version through Git:

-- Extracting version information from git describe...
fatal: Not a git repository (or any of the parent directories): .git

As a consequence, the VERSION variable is empty, which later causes
cmake to bail out with:

CMake Error at /home/test/autobuild/run/instance-1/output-1/host/share/cmake-3.15/Modules/WriteBasicConfigVersionFile.cmake:43 (message):
  No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
  /home/test/autobuild/run/instance-1/output-1/host/share/cmake-3.15/Modules/CMakePackageConfigHelpers.cmake:225 (write_basic_config_version_file)
  CMakeLists.txt:173 (write_basic_package_version_file)

To avoid this, we only use Git to determine the version if the cmake
project top-level source directory has a .git/ folder.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit feb5d9c6b7bcec788f9b01781c205e31fff260e7)
2020-08-19 22:29:34 -07:00
Steve Markgraf a2bc5b5117 lib/cmake: check for libusb_handle_events_timeout_completed()
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>
2014-01-24 03:57:53 +01:00
Steve Markgraf 3969938eb6 cmake: detect libusb on FreeBSD
Source:
http://patch-tracker.debian.org/patch/series/view/rtl-sdr/0.5.0.4.4914-2/libusb-freebsd

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-11-17 19:09:59 +01:00
Dimitri Stolnikov ce341fe53b cmake: add version module 2013-06-04 20:18:56 +02:00
Hoernchen 229ebd2ff2 add win32 compatibility
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-04-02 21:00:26 +02:00
Dimitri Stolnikov 6322c9343d add preliminary cmake build system 2012-04-01 16:52:41 +02:00