add uhd dependency to cmake
This commit is contained in:
@@ -43,6 +43,11 @@ if(NOT WIN32)
|
|||||||
add_definitions(-std=c++0x)
|
add_definitions(-std=c++0x)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(UHD)
|
||||||
|
if(NOT UHD_FOUND)
|
||||||
|
message(FATAL_ERROR "UHD library not found.")
|
||||||
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Find boost
|
# Find boost
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|||||||
@@ -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)
|
||||||
+9
-3
@@ -22,8 +22,14 @@
|
|||||||
########################################################################
|
########################################################################
|
||||||
include(GrPlatform) #define LIB_SUFFIX
|
include(GrPlatform) #define LIB_SUFFIX
|
||||||
|
|
||||||
include_directories(${Boost_INCLUDE_DIR})
|
include_directories(
|
||||||
link_directories(${Boost_LIBRARY_DIRS})
|
${Boost_INCLUDE_DIR}
|
||||||
|
${UHD_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
link_directories(
|
||||||
|
${Boost_LIBRARY_DIRS}
|
||||||
|
${UHD_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
list(APPEND foo_sources
|
list(APPEND foo_sources
|
||||||
burst_tagger_impl.cc
|
burst_tagger_impl.cc
|
||||||
@@ -35,7 +41,7 @@ list(APPEND foo_sources
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_library(gnuradio-foo SHARED ${foo_sources})
|
add_library(gnuradio-foo SHARED ${foo_sources})
|
||||||
target_link_libraries(gnuradio-foo ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} uhd)
|
target_link_libraries(gnuradio-foo ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${UHD_LIBRARIES})
|
||||||
set_target_properties(gnuradio-foo PROPERTIES DEFINE_SYMBOL "gnuradio_foo_EXPORTS")
|
set_target_properties(gnuradio-foo PROPERTIES DEFINE_SYMBOL "gnuradio_foo_EXPORTS")
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user