[PATCH 1/2] Remove CMake warnings.

Ron Economos w6rz at comcast.net
Thu Jan 28 17:01:49 UTC 2021


Signed-off-by: Ron Economos <w6rz at comcast.net>
---
 CMakeLists.txt                      | 3 ++-
 cmake/Modules/FindLibAIRSPY.cmake   | 6 ++++--
 cmake/Modules/FindLibAIRSPYHF.cmake | 6 ++++--
 cmake/Modules/FindLibHackRF.cmake   | 6 ++++--
 lib/CMakeLists.txt                  | 2 +-
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4bb535..96a2c90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,8 +21,8 @@
 # Project setup
 ########################################################################
 cmake_minimum_required(VERSION 3.8)
-include(GNUInstallDirs)
 project(gr-osmosdr CXX C)
+include(GNUInstallDirs)
 enable_testing()
 
 #policy setup
@@ -41,6 +41,7 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
 list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
 
 # Find GNURadio (pmt and runtime are core, always included)
+include(FindPkgConfig)
 find_package(Gnuradio "3.9" REQUIRED COMPONENTS blocks fft filter)
 
 # Set the version information here
diff --git a/cmake/Modules/FindLibAIRSPY.cmake b/cmake/Modules/FindLibAIRSPY.cmake
index 221edcc..437adc4 100644
--- a/cmake/Modules/FindLibAIRSPY.cmake
+++ b/cmake/Modules/FindLibAIRSPY.cmake
@@ -1,4 +1,6 @@
-INCLUDE(FindPkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+    INCLUDE(FindPkgConfig)
+endif()
 PKG_CHECK_MODULES(PC_LIBAIRSPY libairspy)
 
 FIND_PATH(
@@ -20,5 +22,5 @@ FIND_LIBRARY(
 )
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAIRSPY DEFAULT_MSG LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAIRSPY DEFAULT_MSG LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
 MARK_AS_ADVANCED(LIBAIRSPY_LIBRARIES LIBAIRSPY_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibAIRSPYHF.cmake b/cmake/Modules/FindLibAIRSPYHF.cmake
index edb0dda..8c06128 100644
--- a/cmake/Modules/FindLibAIRSPYHF.cmake
+++ b/cmake/Modules/FindLibAIRSPYHF.cmake
@@ -1,4 +1,6 @@
-INCLUDE(FindPkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+    INCLUDE(FindPkgConfig)
+endif()
 PKG_CHECK_MODULES(PC_LIBAIRSPYHF libairspyhf)
 
 FIND_PATH(
@@ -20,5 +22,5 @@ FIND_LIBRARY(
 )
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAIRSPYHF DEFAULT_MSG LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAIRSPYHF DEFAULT_MSG LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
 MARK_AS_ADVANCED(LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLibHackRF.cmake b/cmake/Modules/FindLibHackRF.cmake
index a0d57ef..bc2bc3e 100644
--- a/cmake/Modules/FindLibHackRF.cmake
+++ b/cmake/Modules/FindLibHackRF.cmake
@@ -1,4 +1,6 @@
-INCLUDE(FindPkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+    INCLUDE(FindPkgConfig)
+endif()
 PKG_CHECK_MODULES(PC_LIBHACKRF libhackrf)
 
 FIND_PATH(
@@ -20,6 +22,6 @@ FIND_LIBRARY(
 )
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBHACKRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibHackRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
 MARK_AS_ADVANCED(LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIRS)
 
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1bb8655..c7cfec3 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -44,7 +44,7 @@ endif()
 #this appends all unnamed implicit macro args!
 MACRO (APPEND_LIB_LIST)
       SET (gr_osmosdr_libs "${gr_osmosdr_libs};${ARGN}" CACHE INTERNAL "lib list")
-ENDMACRO (APPEND_INTERNAL_LIST)
+ENDMACRO (APPEND_LIB_LIST)
 
 set(gr_osmosdr_libs "" CACHE INTERNAL "lib that accumulates link targets")
 
-- 
2.17.1



More information about the osmocom-sdr mailing list