From 469a3a38d5d66a2ba321c3477d2ee8d23f4ab09a Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 21 Feb 2020 17:52:03 -0800 Subject: [PATCH] Update cmake to handle gr3.8 and gr3.9 Due to the existence of the ubuntu ppa's, development builds of gnuradio are becoming more common with the version 3.9. This updates cmake to handle 3.8 and 3.9 with some minor changes for windows includes. Fixes #72 Signed-off-by: Travis F. Collins --- CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd4e88..0ad5c2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,14 @@ ENDIF() ######################################################################## # Find packages ######################################################################## -find_package(Gnuradio "3.8" REQUIRED) +set(GR_COMPONENTS blocks analog volk pmt filter fft) +find_package(Gnuradio "3.8" COMPONENTS ${GR_COMPONENTS}) +if(NOT Gnuradio_FOUND) + find_package(Gnuradio "3.9" COMPONENTS ${GR_COMPONENTS}) + if(NOT Gnuradio_FOUND) + message(FATAL_ERROR "Unable to find GNURadio") + endif(NOT Gnuradio_FOUND) +endif(NOT Gnuradio_FOUND) include(GrVersion) include(GrPlatform) #define LIB_SUFFIX >>>>>>> Update to 3.8 with new cmake requirements @@ -143,13 +150,9 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## - -# Search for GNU Radio and its components and versions. Add any -# components required to the list of GR_REQUIRED_COMPONENTS (in all -# caps such as FILTER or FFT) and change the version to the minimum -# API compatible version required. -find_package(Gnuradio COMPONENTS blocks analog volk pmt filter fft) -find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED) +if(WIN32) + find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED) +endif() find_library(IIO_LIBRARIES iio) find_path(IIO_INCLUDE_DIRS iio.h)