Skip to content

Commit 7751b57

Browse files
committedMar 24, 2024
build: Fix CMake compatibility (closes merbanan#2884)
1 parent afb5b34 commit 7751b57

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed
 

‎CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
101101
endif()
102102

103103
# Enable Static analysis on GCC13.2.0+
104-
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "13.2.0")
104+
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND NOT "13.2.0" VERSION_GREATER CMAKE_C_COMPILER_VERSION)
105105
message(STATUS "Using GCC Static analysis")
106106
add_definitions(-fanalyzer)
107107
endif()

‎cmake/Modules/FindLibRTLSDR.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ set(LibRTLSDR_VERSION ${PC_LibRTLSDR_VERSION})
2929
include(FindPackageHandleStandardArgs)
3030
# handle the QUIETLY and REQUIRED arguments and set LibRTLSDR_FOUND to TRUE
3131
# if all listed variables are TRUE
32+
# Note that `FOUND_VAR LibRTLSDR_FOUND` is needed for cmake 3.2 and older.
3233
find_package_handle_standard_args(LibRTLSDR
34+
FOUND_VAR LibRTLSDR_FOUND
3335
REQUIRED_VARS LibRTLSDR_LIBRARY LibRTLSDR_INCLUDE_DIR
3436
VERSION_VAR LibRTLSDR_VERSION)
3537

‎cmake/Modules/FindLibUSB.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ set(LibUSB_VERSION ${PC_LibUSB_VERSION})
4444
include(FindPackageHandleStandardArgs)
4545
# handle the QUIETLY and REQUIRED arguments and set LibUSB_FOUND to TRUE
4646
# if all listed variables are TRUE
47+
# Note that `FOUND_VAR LibRTLSDR_FOUND` is needed for cmake 3.2 and older.
4748
find_package_handle_standard_args(LibUSB
49+
FOUND_VAR LibUSB_FOUND
4850
REQUIRED_VARS LibUSB_LIBRARY LibUSB_INCLUDE_DIR
4951
VERSION_VAR LibUSB_VERSION)
5052

‎cmake/Modules/GetGitRevisionDescription.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function(git_describe _var)
111111
if(NOT GIT_FOUND AND CMAKE_HOST_WIN32)
112112
# fallback to VS bundled Git
113113
find_program(GIT_EXECUTABLE NAMES git PATH_SUFFIXES Git/cmd Git/bin)
114-
find_package_handle_standard_args(Git REQUIRED_VARS GIT_EXECUTABLE)
114+
find_package_handle_standard_args(Git FOUND_VAR GIT_FOUND REQUIRED_VARS GIT_EXECUTABLE)
115115
endif()
116116
if(NOT GIT_FOUND)
117117
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
@@ -156,7 +156,7 @@ function(git_timestamp _var)
156156
if(NOT GIT_FOUND AND CMAKE_HOST_WIN32)
157157
# fallback to VS bundled Git
158158
find_program(GIT_EXECUTABLE NAMES git PATH_SUFFIXES Git/cmd Git/bin)
159-
find_package_handle_standard_args(Git REQUIRED_VARS GIT_EXECUTABLE)
159+
find_package_handle_standard_args(Git FOUND_VAR GIT_FOUND REQUIRED_VARS GIT_EXECUTABLE)
160160
endif()
161161
if(NOT GIT_FOUND)
162162
return()

‎docs/BUILDING.md

+8
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ E.g. use:
9494

9595
cmake -DENABLE_SOAPYSDR=ON ..
9696

97+
::: tip
98+
If you use CMake older than 3.13 (check `cmake --version`), you need to build using e.g. `mkdir build ; cd build ; cmake .. && cmake --build .`
99+
:::
100+
101+
::: tip
102+
In CMake 3.6 or older the OpenSSL search seems broken, you need to use `cmake -DENABLE_OPENSSL=NO ..`
103+
:::
104+
97105
::: warning
98106
If you experience trouble with SoapySDR when compiling or running: you likely mixed version 0.7 and version 0.8 headers and libs.
99107
Purge all SoapySDR packages and source installation from /usr/local.

0 commit comments

Comments
 (0)
Please sign in to comment.