From e15faa7b670ae595082fc2aaa3fc05434820a5db Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 23 Aug 2022 15:12:09 +0200 Subject: [PATCH] Fix for old CMake --- cmake/Modules/FindGNURADIO.cmake | 6 +++++- src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index 400885ede..a8f0b2a90 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -416,7 +416,11 @@ if(GNURADIO_RUNTIME_INCLUDE_DIRS) PURPOSE "Required by GNU Radio." TYPE REQUIRED ) - target_link_libraries(Gnuradio::filter INTERFACE Log4cpp::log4cpp) + if(CMAKE_VERSION VERSION_GREATER 3.0) + target_link_libraries(Gnuradio::filter INTERFACE Log4cpp::log4cpp) + else() + set(LOG4CPP_WITH_OLD_CMAKE TRUE) + endif() endif() if(${_uses_spdlog}) find_package(spdlog REQUIRED CONFIG) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index c65727296..51113a267 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -53,6 +53,13 @@ target_include_directories(input_filter_gr_blocks ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) +if(LOG4CPP_WITH_OLD_CMAKE) + target_link_libraries(input_filter_gr_blocks + PRIVATE + Log4cpp::log4cpp + ) +endif() + if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(input_filter_gr_blocks PUBLIC -DGNURADIO_USES_STD_POINTERS=1