uhd: added UHD as dependency for the gr-uhd based module

this may be required for compilation since the gnuradio trunk doesn't
provide UHD's include path via pkg-config.
gr3.6
Dimitri Stolnikov 11 years ago
parent 1097fd7aba
commit 52b5a8a4d3
  1. 1
      CMakeLists.txt
  2. 28
      cmake/Modules/FindUHD.cmake
  3. 10
      lib/CMakeLists.txt
  4. 5
      lib/fcd/CMakeLists.txt
  5. 5
      lib/osmosdr/CMakeLists.txt
  6. 9
      lib/uhd/CMakeLists.txt

@ -109,6 +109,7 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
find_package(Gruel)
find_package(GnuradioCore)
find_package(GnuradioAudio)
find_package(UHD)
find_package(GnuradioUHD)
find_package(GnuradioFCD)
find_package(LibRTLSDR)

@ -0,0 +1,28 @@
########################################################################
# Find the library for the USRP Hardware Driver
########################################################################
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_UHD uhd)
FIND_PATH(
UHD_INCLUDE_DIRS
NAMES uhd/config.hpp
HINTS $ENV{UHD_DIR}/include
${PC_UHD_INCLUDEDIR}
PATHS /usr/local/include
/usr/include
)
FIND_LIBRARY(
UHD_LIBRARIES
NAMES uhd
HINTS $ENV{UHD_DIR}/lib
${PC_UHD_LIBDIR}
PATHS /usr/local/lib
/usr/lib
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)

@ -50,7 +50,7 @@ GR_OSMOSDR_APPEND_LIBS(
# Setup OsmoSDR component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("Sysmocom OsmoSDR" ENABLE_OSMOSDR)
GR_REGISTER_COMPONENT("Sysmocom OsmoSDR" ENABLE_OSMOSDR GNURADIO_AUDIO_FOUND)
if(ENABLE_OSMOSDR)
GR_INCLUDE_SUBDIRECTORY(osmosdr)
@ -70,7 +70,7 @@ endif(ENABLE_FCD)
# Setup File component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("File Source" ENABLE_FILE GNURADIO_CORE_FOUND)
GR_REGISTER_COMPONENT("IQ File Source" ENABLE_FILE GNURADIO_CORE_FOUND)
if(ENABLE_FILE)
GR_INCLUDE_SUBDIRECTORY(file)
@ -90,7 +90,7 @@ endif(ENABLE_RTL)
# Setup RTL_TCP component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("Osmocom RTLSDR TCP Client" ENABLE_RTL_TCP GNURADIO_CORE_FOUND)
GR_REGISTER_COMPONENT("RTLSDR TCP Client" ENABLE_RTL_TCP GNURADIO_CORE_FOUND)
if(ENABLE_RTL_TCP)
GR_INCLUDE_SUBDIRECTORY(rtl_tcp)
@ -100,7 +100,7 @@ endif(ENABLE_RTL_TCP)
# Setup UHD component
########################################################################
include(GrComponent)
GR_REGISTER_COMPONENT("Ettus UHD" ENABLE_UHD GNURADIO_UHD_FOUND)
GR_REGISTER_COMPONENT("Ettus UHD" ENABLE_UHD UHD_FOUND GNURADIO_UHD_FOUND)
if(ENABLE_UHD)
GR_INCLUDE_SUBDIRECTORY(uhd)
@ -125,7 +125,7 @@ SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES DEFINE_SYMBOL "gnuradio_osmosd
SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES SOVERSION "${MAJOR_VERSION}")
SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES VERSION "${MAJOR_VERSION}.${MINOR_VERSION}")
IF(DEFINED GR_OSMOSDR_OUTPUT_NAME)
SET_TARGET_PROPERTIES(uhd PROPERTIES OUTPUT_NAME ${GR_OSMOSDR_OUTPUT_NAME})
SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES OUTPUT_NAME ${GR_OSMOSDR_OUTPUT_NAME})
ENDIF(DEFINED GR_OSMOSDR_OUTPUT_NAME)
########################################################################

@ -21,7 +21,10 @@
# This file included, use CMake directory variables
########################################################################
include_directories(APPEND ${CMAKE_CURRENT_SOURCE_DIR} ${GNURADIO_FCD_INCLUDE_DIRS})
include_directories(APPEND
${CMAKE_CURRENT_SOURCE_DIR}
${GNURADIO_FCD_INCLUDE_DIRS}
)
set(fcd_srcs
${CMAKE_CURRENT_SOURCE_DIR}/fcd_source.cc

@ -21,7 +21,10 @@
# This file included, use CMake directory variables
########################################################################
include_directories(APPEND ${CMAKE_CURRENT_SOURCE_DIR} ${GNURADIO_AUDIO_INCLUDE_DIRS})
include_directories(APPEND
${CMAKE_CURRENT_SOURCE_DIR}
${GNURADIO_AUDIO_INCLUDE_DIRS}
)
set(osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/osmosdr_control.cc

@ -21,7 +21,11 @@
# This file included, use CMake directory variables
########################################################################
include_directories(APPEND ${CMAKE_CURRENT_SOURCE_DIR} ${GNURADIO_UHD_INCLUDE_DIRS})
include_directories(APPEND
${CMAKE_CURRENT_SOURCE_DIR}
${GNURADIO_UHD_INCLUDE_DIRS}
${UHD_INCLUDE_DIRS}
)
set(uhd_srcs
${CMAKE_CURRENT_SOURCE_DIR}/uhd_source_c.cc
@ -31,5 +35,4 @@ set(uhd_srcs
# Append gnuradio-osmosdr library sources
########################################################################
list(APPEND gr_osmosdr_srcs ${uhd_srcs})
list(APPEND gr_osmosdr_libs ${GNURADIO_UHD_LIBRARIES})
list(APPEND gr_osmosdr_libs ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES})

Loading…
Cancel
Save