forked from sdr/gr-osmosdr
cmake: actually make linking work
Appending to lists from subdirs does not work as expected, so work around that to allow collecting the necessary libs.gr3.8
parent
5cf6f4df96
commit
dadabeceaf
|
@ -40,8 +40,16 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
list(APPEND Boost_LIBRARIES -pthread)
|
||||
endif()
|
||||
|
||||
#dirty macro to allow appending from subdirs
|
||||
#this appends all unnamed implicit macro args!
|
||||
MACRO (APPEND_LIB_LIST)
|
||||
SET (gr_osmosdr_libs "${gr_osmosdr_libs};${ARGN}" CACHE INTERNAL "lib list")
|
||||
ENDMACRO (APPEND_INTERNAL_LIST)
|
||||
|
||||
set(gr_osmosdr_libs "" CACHE INTERNAL "lib that accumulates link targets")
|
||||
|
||||
add_library(gnuradio-osmosdr SHARED)
|
||||
list(APPEND gr_osmosdr_libs ${Boost_LIBRARIES} gnuradio::gnuradio-runtime)
|
||||
APPEND_LIB_LIST(${Boost_LIBRARIES} gnuradio::gnuradio-runtime)
|
||||
target_include_directories(gnuradio-osmosdr
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PUBLIC ${Boost_INCLUDE_DIRS}
|
||||
|
@ -100,7 +108,7 @@ CHECK_CXX_SOURCE_COMPILES("
|
|||
if(HAVE_CLOCK_GETTIME)
|
||||
message(STATUS " High resolution timing supported through clock_gettime.")
|
||||
set(TIME_SPEC_DEFS HAVE_CLOCK_GETTIME)
|
||||
list(APPEND gr_osmosdr_libs "-lrt")
|
||||
APPEND_LIB_LIST( "-lrt")
|
||||
elseif(HAVE_MACH_ABSOLUTE_TIME)
|
||||
message(STATUS " High resolution timing supported through mach_absolute_time.")
|
||||
set(TIME_SPEC_DEFS HAVE_MACH_ABSOLUTE_TIME)
|
||||
|
@ -124,7 +132,7 @@ GR_REGISTER_COMPONENT("Osmocom IQ Imbalance Correction" ENABLE_IQBALANCE gnuradi
|
|||
if(ENABLE_IQBALANCE)
|
||||
add_definitions(-DHAVE_IQBALANCE=1)
|
||||
target_include_directories(gnuradio-osmosdr PRIVATE ${gnuradio-iqbalance_INCLUDE_DIRS})
|
||||
list(APPEND gr_osmosdr_libs gnuradio::gnuradio-iqbalance)
|
||||
APPEND_LIB_LIST( gnuradio::gnuradio-iqbalance)
|
||||
endif(ENABLE_IQBALANCE)
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBAIRSPY_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
gnuradio::gnuradio-filter
|
||||
${Gnuradio-blocks_LIBRARIES}
|
||||
${LIBAIRSPY_LIBRARIES}
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBAIRSPYHF_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${Gnuradio-blocks_LIBRARIES}
|
||||
${LIBAIRSPYHF_LIBRARIES}
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${Volk_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBBLADERF_LIBRARIES}
|
||||
${Volk_LIBRARIES}
|
||||
)
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${GNURADIO_FCDPP_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${GNURADIO_FCDPP_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
gnuradio::gnuradio-blocks
|
||||
)
|
||||
message(STATUS ${gnuradio-blocks_LIBRARIES})
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBFREESRP_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBFREESRP_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBHACKRF_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBHACKRF_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBMIRISDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBMIRISDR_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBOSMOSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBOSMOSDR_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${Gnuradio-blocks_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBRTLSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBRTLSDR_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${Gnuradio-blocks_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${LIBSDRPLAY_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${LIBSDRPLAY_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${SoapySDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
${SoapySDR_LIBRARIES}
|
||||
)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ target_include_directories(gnuradio-osmosdr PRIVATE
|
|||
${UHD_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND gr_osmosdr_libs
|
||||
APPEND_LIB_LIST(
|
||||
gnuradio::gnuradio-uhd
|
||||
${UHD_LIBRARIES}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue