Skip to content

Commit 42dc367

Browse files
committed
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 <[email protected]>
1 parent 7918f0b commit 42dc367

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

CMakeLists.txt

+11-8
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ ENDIF()
8383
########################################################################
8484
# Find packages
8585
########################################################################
86-
find_package(Gnuradio "3.8" REQUIRED)
86+
set(GR_COMPONENTS blocks analog volk pmt filter fft)
87+
find_package(Gnuradio "3.8" COMPONENTS ${GR_COMPONENTS})
88+
if(NOT Gnuradio_FOUND)
89+
find_package(Gnuradio "3.9" COMPONENTS ${GR_COMPONENTS})
90+
if(NOT Gnuradio_FOUND)
91+
message(FATAL_ERROR "Unable to find GNURadio")
92+
endif(NOT Gnuradio_FOUND)
93+
endif(NOT Gnuradio_FOUND)
8794
include(GrVersion)
8895
include(GrPlatform) #define LIB_SUFFIX
8996

@@ -105,13 +112,9 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
105112
########################################################################
106113
# Find gnuradio build dependencies
107114
########################################################################
108-
109-
# Search for GNU Radio and its components and versions. Add any
110-
# components required to the list of GR_REQUIRED_COMPONENTS (in all
111-
# caps such as FILTER or FFT) and change the version to the minimum
112-
# API compatible version required.
113-
find_package(Gnuradio COMPONENTS blocks analog volk pmt filter fft)
114-
find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED)
115+
if(WIN32)
116+
find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED)
117+
endif()
115118

116119
find_library(IIO_LIBRARIES iio)
117120
find_path(IIO_INCLUDE_DIRS iio.h)

0 commit comments

Comments
 (0)