2020-09-19 12:48:34 +02:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2020-10-24 15:33:00 +02:00
|
|
|
project(sdrpp)
|
2020-06-10 04:13:56 +02:00
|
|
|
|
2020-12-22 14:50:26 +01:00
|
|
|
option(OPT_BUILD_RTL_TCP_SOURCE "Build RTL-TCP Source Module (no dependencies required)" ON)
|
|
|
|
option(OPT_BUILD_SPYSERVER_SOURCE "Build SpyServer Source Module (no dependencies required)" ON)
|
|
|
|
option(OPT_BUILD_SOAPY_SOURCE "Build SoapySDR Source Module (Depedencies: soapysdr)" ON)
|
|
|
|
option(OPT_BUILD_AIRSPYHF_SOURCE "Build Airspy HF+ Source Module (Depedencies: libairspyhf)" ON)
|
|
|
|
option(OPT_BUILD_PLUTOSDR_SOURCE "Build PlutoSDR Source Module (Depedencies: libiio, libad9361)" ON)
|
|
|
|
option(OPT_BUILD_AUDIO_SINK "Build Audio Sink Module (Depedencies: portaudio)" ON)
|
|
|
|
|
2020-12-08 04:36:37 +01:00
|
|
|
# Core of SDR++
|
2020-09-19 12:48:34 +02:00
|
|
|
add_subdirectory("core")
|
2020-12-08 04:36:37 +01:00
|
|
|
|
2020-12-22 14:50:26 +01:00
|
|
|
# Base modules
|
2020-09-19 12:48:34 +02:00
|
|
|
add_subdirectory("radio")
|
2020-10-01 13:46:12 +02:00
|
|
|
add_subdirectory("recorder")
|
2020-12-22 14:50:26 +01:00
|
|
|
|
|
|
|
# Source modules
|
|
|
|
if (OPT_BUILD_RTL_TCP_SOURCE)
|
|
|
|
add_subdirectory("rtl_tcp_source")
|
|
|
|
endif (OPT_BUILD_RTL_TCP_SOURCE)
|
|
|
|
|
|
|
|
if (OPT_BUILD_SPYSERVER_SOURCE)
|
|
|
|
add_subdirectory("spyserver_source")
|
|
|
|
endif (OPT_BUILD_SPYSERVER_SOURCE)
|
|
|
|
|
|
|
|
if (OPT_BUILD_SOAPY_SOURCE)
|
2020-12-08 04:36:37 +01:00
|
|
|
add_subdirectory("soapy_source")
|
2020-12-22 14:50:26 +01:00
|
|
|
endif (OPT_BUILD_SOAPY_SOURCE)
|
|
|
|
|
|
|
|
if (OPT_BUILD_AIRSPYHF_SOURCE)
|
2020-12-15 23:05:11 +01:00
|
|
|
add_subdirectory("airspyhf_source")
|
2020-12-22 14:50:26 +01:00
|
|
|
endif (OPT_BUILD_AIRSPYHF_SOURCE)
|
|
|
|
|
|
|
|
if (OPT_BUILD_PLUTOSDR_SOURCE)
|
2020-11-25 21:52:37 +01:00
|
|
|
add_subdirectory("plutosdr_source")
|
2020-12-22 14:50:26 +01:00
|
|
|
endif (OPT_BUILD_PLUTOSDR_SOURCE)
|
|
|
|
|
|
|
|
if (OPT_BUILD_AUDIO_SINK)
|
|
|
|
add_subdirectory("audio_sink")
|
|
|
|
endif (OPT_BUILD_AUDIO_SINK)
|
2020-09-06 15:39:09 +02:00
|
|
|
|
2020-10-07 22:44:54 +02:00
|
|
|
if (MSVC)
|
2020-12-12 05:34:58 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc")
|
2020-10-07 22:44:54 +02:00
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "-O3 -std=c++17")
|
|
|
|
endif (MSVC)
|
|
|
|
|
2020-09-19 12:48:34 +02:00
|
|
|
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
|
|
|
|
target_link_libraries(sdrpp PRIVATE sdrpp_core)
|
2020-06-22 16:45:57 +02:00
|
|
|
|
2020-09-19 12:48:34 +02:00
|
|
|
# Copy dynamic libs over
|
2020-08-16 03:39:05 +02:00
|
|
|
if (MSVC)
|
2020-09-19 12:48:34 +02:00
|
|
|
add_custom_target(do_always ALL xcopy /s \"$<TARGET_FILE_DIR:sdrpp_core>\\*.dll\" \"$<TARGET_FILE_DIR:sdrpp>\" /Y)
|
2020-10-23 11:06:10 +02:00
|
|
|
add_custom_target(do_always_volk ALL xcopy /s \"C:/Program Files/PothosSDR/bin\\volk.dll\" \"$<TARGET_FILE_DIR:sdrpp>\" /Y)
|
2020-07-20 00:43:36 +02:00
|
|
|
endif (MSVC)
|
2020-07-19 15:59:44 +02:00
|
|
|
|
2020-10-24 17:09:25 +02:00
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
2020-10-24 17:34:18 +02:00
|
|
|
add_custom_target(do_always ALL cp \"$<TARGET_FILE_DIR:sdrpp_core>/libsdrpp_core.so\" \"$<TARGET_FILE_DIR:sdrpp>\")
|
2020-10-24 17:09:25 +02:00
|
|
|
endif ()
|
|
|
|
|
2020-10-22 02:28:43 +02:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2020-10-24 17:34:18 +02:00
|
|
|
add_custom_target(do_always ALL cp \"$<TARGET_FILE_DIR:sdrpp_core>/libsdrpp_core.so\" \"$<TARGET_FILE_DIR:sdrpp>\")
|
2020-10-22 02:28:43 +02:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2020-10-24 17:34:18 +02:00
|
|
|
add_custom_target(do_always ALL cp \"$<TARGET_FILE_DIR:sdrpp_core>/libsdrpp_core.dylib\" \"$<TARGET_FILE_DIR:sdrpp>\")
|
2020-10-22 02:28:43 +02:00
|
|
|
endif ()
|
|
|
|
|
2020-10-06 10:54:00 +02:00
|
|
|
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"
|