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.
This commit is contained in:
Dimitri Stolnikov 2012-05-12 23:04:03 +02:00
parent 1097fd7aba
commit 52b5a8a4d3
6 changed files with 48 additions and 10 deletions

View File

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

View File

@ -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)

View File

@ -50,7 +50,7 @@ GR_OSMOSDR_APPEND_LIBS(
# Setup OsmoSDR component # Setup OsmoSDR component
######################################################################## ########################################################################
include(GrComponent) include(GrComponent)
GR_REGISTER_COMPONENT("Sysmocom OsmoSDR" ENABLE_OSMOSDR) GR_REGISTER_COMPONENT("Sysmocom OsmoSDR" ENABLE_OSMOSDR GNURADIO_AUDIO_FOUND)
if(ENABLE_OSMOSDR) if(ENABLE_OSMOSDR)
GR_INCLUDE_SUBDIRECTORY(osmosdr) GR_INCLUDE_SUBDIRECTORY(osmosdr)
@ -70,7 +70,7 @@ endif(ENABLE_FCD)
# Setup File component # Setup File component
######################################################################## ########################################################################
include(GrComponent) 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) if(ENABLE_FILE)
GR_INCLUDE_SUBDIRECTORY(file) GR_INCLUDE_SUBDIRECTORY(file)
@ -90,7 +90,7 @@ endif(ENABLE_RTL)
# Setup RTL_TCP component # Setup RTL_TCP component
######################################################################## ########################################################################
include(GrComponent) 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) if(ENABLE_RTL_TCP)
GR_INCLUDE_SUBDIRECTORY(rtl_tcp) GR_INCLUDE_SUBDIRECTORY(rtl_tcp)
@ -100,7 +100,7 @@ endif(ENABLE_RTL_TCP)
# Setup UHD component # Setup UHD component
######################################################################## ########################################################################
include(GrComponent) 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) if(ENABLE_UHD)
GR_INCLUDE_SUBDIRECTORY(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 SOVERSION "${MAJOR_VERSION}")
SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES VERSION "${MAJOR_VERSION}.${MINOR_VERSION}") SET_TARGET_PROPERTIES(gnuradio-osmosdr PROPERTIES VERSION "${MAJOR_VERSION}.${MINOR_VERSION}")
IF(DEFINED GR_OSMOSDR_OUTPUT_NAME) 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) ENDIF(DEFINED GR_OSMOSDR_OUTPUT_NAME)
######################################################################## ########################################################################

View File

@ -21,7 +21,10 @@
# This file included, use CMake directory variables # 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 set(fcd_srcs
${CMAKE_CURRENT_SOURCE_DIR}/fcd_source.cc ${CMAKE_CURRENT_SOURCE_DIR}/fcd_source.cc

View File

@ -21,7 +21,10 @@
# This file included, use CMake directory variables # 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 set(osmosdr_srcs
${CMAKE_CURRENT_SOURCE_DIR}/osmosdr_control.cc ${CMAKE_CURRENT_SOURCE_DIR}/osmosdr_control.cc

View File

@ -21,7 +21,11 @@
# This file included, use CMake directory variables # 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 set(uhd_srcs
${CMAKE_CURRENT_SOURCE_DIR}/uhd_source_c.cc ${CMAKE_CURRENT_SOURCE_DIR}/uhd_source_c.cc
@ -31,5 +35,4 @@ set(uhd_srcs
# Append gnuradio-osmosdr library sources # Append gnuradio-osmosdr library sources
######################################################################## ########################################################################
list(APPEND gr_osmosdr_srcs ${uhd_srcs}) 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})