Skip to content

Commit

Permalink
Strip prefixed v from librtlsdr versions
Browse files Browse the repository at this point in the history
Some versions of librtlsdr (including versions <= 0.5.4 built directly
from source) have a leading 'v' on their versions as reported by
pkg-config. This causes the version check for bias tees to yield
incorrect results, preventing the use of a bias tee even if the
underlying librtlsdr supports it. Removing the 'v' avoids this.
  • Loading branch information
agrif committed May 27, 2022
1 parent da0fb22 commit cecc0be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/goesrecv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ if(NOT RTLSDR_FOUND)
message(WARNING "Unable to find librtlsdr")
else()
add_library(rtlsdr_source rtlsdr_source.cc)

# Some rtlsdr versions begin with an extraneous 'v', such as older
# versions (<= 0.5.4) built from source, or the version provided by MacPorts.
# Newer versions built from source, as well as Debian packages, have
# versions that do not begin with this 'v'.
# Remove prefix 'v' here to handle all versions consistently.
if(RTLSDR_VERSION MATCHES "^v")
string(SUBSTRING ${RTLSDR_VERSION} 1 -1 RTLSDR_VERSION)
endif()

if((RTLSDR_VERSION VERSION_EQUAL 0.5.4) OR
(RTLSDR_VERSION VERSION_GREATER 0.5.4))
target_compile_definitions(rtlsdr_source PRIVATE RTLSDR_HAS_BIAS_TEE)
Expand Down

0 comments on commit cecc0be

Please sign in to comment.