summaryrefslogtreecommitdiffstats
path: root/binding/CMakeLists.txt
diff options
context:
space:
mode:
authorScott Murray <scottm@ghidorah.spiteful.org>2018-05-18 11:48:09 -0400
committerScott Murray <scott.murray@konsulko.com>2018-06-05 21:17:02 -0400
commit127da1228b47486de500424e4a2ab3f0f5f0ec4a (patch)
tree31d4047e89b6c7f5a2151d2d8660fdd3c64cceef /binding/CMakeLists.txt
parenta0b0ea9312d41a6f48d3a8e92d1d12f69a714bcd (diff)
Split rtlsdr code into standalone helper
To avoid the GPL licensed code in rtl_fm.c making all of the binding GPL, rework things to wrap it with a simple standalone helper executable that is driven via stdin/stdout. While this could potentially be done by running the original unmodified rtl_fm utility itself, it would be impossible to implement scanning with that approach without some compromising of playback latency and quality. The current helper implementation is simple enough that replacing it with an alternate one should be relatively straightforward if that is desired. Change-Id: If83b834da3999f5807d1453524ae72b1c3559c90 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'binding/CMakeLists.txt')
-rw-r--r--binding/CMakeLists.txt28
1 files changed, 24 insertions, 4 deletions
diff --git a/binding/CMakeLists.txt b/binding/CMakeLists.txt
index 321022a..d279945 100644
--- a/binding/CMakeLists.txt
+++ b/binding/CMakeLists.txt
@@ -1,5 +1,6 @@
###########################################################################
# Copyright 2015, 2016, 2017 IoT.bzh
+# Copyright (C) 2018 Konsulko Group
#
# author: Fulup Ar Foll <fulup@iot.bzh>
# contrib: Romain Forlot <romain.forlot@iot.bzh>
@@ -23,11 +24,8 @@ PROJECT_TARGET_ADD(radio-binding)
# Define project Targets
set(radio_SOURCES
radio-binding.c
- radio_output.c
radio_impl_kingfisher.c
- radio_impl_rtlsdr.c
- rtl_fm.c
- convenience/convenience.c)
+ radio_impl_rtlsdr.c)
add_library(${TARGET_NAME} MODULE ${radio_SOURCES})
@@ -45,3 +43,25 @@ PROJECT_TARGET_ADD(radio-binding)
# installation directory
INSTALL(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${BINDINGS_INSTALL_DIR})
+
+# Add helper program target
+PROJECT_TARGET_ADD(rtl_fm_helper)
+
+ # Define project targets
+ set(helper_SOURCES
+ ${TARGET_NAME}.c
+ rtl_fm.c
+ convenience/convenience.c
+ radio_output.c)
+ PKG_CHECK_MODULES(SOUND REQUIRED libpulse-simple)
+
+ add_executable(${TARGET_NAME} ${helper_SOURCES})
+
+ SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+ LABELS "EXECUTABLE"
+ OUTPUT_NAME ${TARGET_NAME}
+ )
+
+ PKG_CHECK_MODULES(RTLSDR REQUIRED librtlsdr)
+ TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ ${RTLSDR_LIBRARIES} ${SOUND_LIBRARIES} ${link_libraries} m)