2020-11-05 02:31:38 -05:00
|
|
|
cmake_minimum_required(VERSION 3.10.0)
|
2014-11-05 07:34:33 -05:00
|
|
|
|
2020-11-01 07:03:13 -05:00
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
2019-05-24 02:32:40 -04:00
|
|
|
|
2019-05-02 02:07:05 -04:00
|
|
|
project(sdrangel)
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
2016-02-24 05:51:36 -05:00
|
|
|
|
2019-05-03 11:46:01 -04:00
|
|
|
# disable only when needed
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2019-05-02 05:03:40 -04:00
|
|
|
# configure version
|
2019-05-03 11:46:01 -04:00
|
|
|
set(sdrangel_VERSION_MAJOR "4")
|
2020-10-28 03:58:16 -04:00
|
|
|
set(sdrangel_VERSION_MINOR "21")
|
2020-11-06 01:04:46 -05:00
|
|
|
set(sdrangel_VERSION_PATCH "2")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(sdrangel_VERSION_SUFFIX "")
|
|
|
|
|
2019-05-04 08:26:19 -04:00
|
|
|
# SDRAngel cmake options
|
|
|
|
option(DEBUG_OUTPUT "Print debug messages" OFF)
|
|
|
|
option(SANITIZE_ADDRESS "Activate memory address sanitization" OFF)
|
|
|
|
option(RX_SAMPLE_24BIT "Internal 24 bit Rx DSP" ON)
|
|
|
|
option(BUILD_SERVER "Build Server" ON)
|
|
|
|
option(BUILD_GUI "Build GUI" ON)
|
|
|
|
option(BUNDLE "Enable distribution bundle" OFF)
|
|
|
|
option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF)
|
|
|
|
option(FORCE_SSE41 "Compile with SSE4.1 instruction only" OFF)
|
|
|
|
option(ENABLE_AIRSPY "Enable AirSpy support" ON)
|
|
|
|
option(ENABLE_AIRSPYHF "Enable AirSpyHF support" ON)
|
|
|
|
option(ENABLE_BLADERF "Enable bladeRF support" ON)
|
|
|
|
option(ENABLE_FUNCUBE "Enable FUNcube support" ON)
|
|
|
|
option(ENABLE_HACKRF "Enable HackRF support" ON)
|
|
|
|
option(ENABLE_IIO "Enable liniio support like PlutoSDR" ON)
|
|
|
|
option(ENABLE_LIMESUITE "Enable limesuite support" ON)
|
|
|
|
option(ENABLE_MIRISDR "Enable LibMiri for old SDRPlay" ON)
|
|
|
|
option(ENABLE_PERSEUS "Enable perseus support" ON)
|
|
|
|
option(ENABLE_RTLSDR "Enable rtl-sdr support" ON)
|
|
|
|
option(ENABLE_SOAPYSDR "Enable SoapySDR support" ON)
|
|
|
|
option(ENABLE_XTRX "Enable XTRX support" ON)
|
2019-05-08 05:27:57 -04:00
|
|
|
option(ENABLE_PACK_MIRSDRAPI "Enable inclusion of the mirsdr-api library - for personal use only" OFF)
|
2020-10-02 17:45:28 -04:00
|
|
|
option(ENABLE_USRP "Enable USRP support" ON)
|
2019-05-23 10:01:06 -04:00
|
|
|
# on windows always build external libraries
|
|
|
|
if(WIN32)
|
2019-06-26 11:50:45 -04:00
|
|
|
set(ENABLE_EXTERNAL_LIBRARIES ON CACHE BOOL "Build external libraries" FORCE)
|
2019-06-24 12:25:53 -04:00
|
|
|
# to run fixup_bundle()
|
2019-06-26 11:50:45 -04:00
|
|
|
set(BUNDLE ON CACHE BOOL "Enable distribution bundle" FORCE)
|
2019-05-23 10:01:06 -04:00
|
|
|
endif()
|
2019-05-04 08:26:19 -04:00
|
|
|
|
2019-05-03 11:46:01 -04:00
|
|
|
# Set additional project information
|
|
|
|
set(COMPANY "f4exb")
|
|
|
|
add_definitions("-DCOMPANY=\"${COMPANY}\"")
|
|
|
|
set(APPLICATION_NAME "SDRangel")
|
|
|
|
add_definitions("-DAPPLICATION_NAME=\"${APPLICATION_NAME}\"")
|
2019-05-04 07:46:03 -04:00
|
|
|
set(APPLICATION_MAINTAINER="Edouard Griffiths, F4EXB <f4exb06@gmail.com>")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(COPYRIGHT "Copyright (c) 2019 Edouard Griffiths. All rights reserved.")
|
|
|
|
add_definitions("-DCOPYRIGHT=\"${COPYRIGHT}\"")
|
|
|
|
set(IDENTIFIER "com.${COMPANY}.${APPLICATION_NAME}")
|
|
|
|
add_definitions("-DIDENTIFIER=\"${IDENTIFIER}\"")
|
2019-05-02 05:03:40 -04:00
|
|
|
|
2020-11-03 07:52:12 -05:00
|
|
|
add_compile_definitions(_USE_MATH_DEFINES)
|
|
|
|
if(WIN32)
|
|
|
|
add_compile_definitions(NOMINMAX)
|
|
|
|
endif()
|
|
|
|
|
2019-05-02 05:03:40 -04:00
|
|
|
find_package(Git)
|
2019-05-03 11:46:01 -04:00
|
|
|
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/")
|
2019-05-22 03:52:36 -04:00
|
|
|
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags
|
2019-05-03 11:46:01 -04:00
|
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
|
|
RESULT_VARIABLE res
|
|
|
|
OUTPUT_VARIABLE out
|
|
|
|
ERROR_QUIET
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if(NOT res)
|
2019-06-09 16:21:49 -04:00
|
|
|
string(REGEX REPLACE "^v([0-9]+)\.([0-9]+)\.([0-9]+)" "" git_commit ${out})
|
|
|
|
set(sdrangel_VERSION_SUFFIX "${git_commit}")
|
2019-05-02 05:03:40 -04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-05-03 11:46:01 -04:00
|
|
|
set(sdrangel_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}")
|
|
|
|
message(STATUS "${APPLICATION_NAME} Version: ${sdrangel_VERSION}")
|
|
|
|
add_definitions("-DSDRANGEL_LIB_VERSION=\"${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}\"")
|
|
|
|
add_definitions("-DSDRANGEL_VERSION=\"${sdrangel_VERSION}\"")
|
|
|
|
|
2019-07-22 17:14:23 -04:00
|
|
|
# configure CPACK information
|
2019-05-04 08:26:19 -04:00
|
|
|
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SDR Rx/Tx software for Airspy, Airspy HF+, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube")
|
|
|
|
set(CPACK_PACKAGE_VENDOR "${COMPANY}")
|
|
|
|
set(CPACK_PACKAGE_CONTACT "https://github.com/f4exb/sdrangel")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/Readme.md")
|
2020-02-28 10:12:41 -05:00
|
|
|
set(CPACK_PACKAGE_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${sdrangel_VERSION_MAJOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${sdrangel_VERSION_MINOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${sdrangel_VERSION_PATCH})
|
|
|
|
set(CPACK_SOURCE_STRIP_FILES true)
|
|
|
|
set(CPACK_STRIP_FILES true)
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
|
|
|
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/Readme.md")
|
|
|
|
set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/.git/;.gitignore;menu.yml;.travis.yml;.appveyor.yml;default.nix;.envrc;TODOs.org;/.scripts/")
|
|
|
|
set(CPACK_SOURCE_GENERATOR "ZIP;TGZ")
|
2016-02-24 05:51:36 -05:00
|
|
|
|
2019-05-01 13:16:37 -04:00
|
|
|
# if we don't set build_type
|
2019-05-24 02:32:40 -04:00
|
|
|
if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "")
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
2019-05-01 13:16:37 -04:00
|
|
|
endif()
|
2019-05-18 05:20:50 -04:00
|
|
|
message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}")
|
2019-05-01 13:16:37 -04:00
|
|
|
|
|
|
|
# as default disable qDebug()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(NOT DEBUG_OUTPUT)
|
2019-05-03 11:46:01 -04:00
|
|
|
add_definitions("-DQT_NO_DEBUG_OUTPUT")
|
2019-05-01 05:54:58 -04:00
|
|
|
endif()
|
2014-11-05 07:34:33 -05:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if(ENABLE_EXTERNAL_LIBRARIES STREQUAL "AUTO")
|
|
|
|
set(AUTO_EXTERNAL_LIBRARIES ON CACHE INTERNAL "")
|
2020-07-20 00:11:27 -04:00
|
|
|
endif()
|
2020-04-30 08:19:19 -04:00
|
|
|
|
2019-05-01 13:16:37 -04:00
|
|
|
# declare build structures
|
2019-05-24 02:32:40 -04:00
|
|
|
# !! change sdrbase/plugins/pluginmanager.cpp too !!
|
|
|
|
set(SDRANGEL_BINARY_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
|
|
|
|
set(SDRANGEL_BINARY_LIB_DIR "${CMAKE_BINARY_DIR}/lib")
|
2019-05-02 10:04:43 -04:00
|
|
|
if(WIN32)
|
2019-05-24 02:32:40 -04:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SDRANGEL_BINARY_BIN_DIR}")
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
2020-07-20 00:11:27 -04:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
|
2019-05-02 10:04:43 -04:00
|
|
|
else()
|
2019-05-07 13:36:47 -04:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
2019-05-02 10:04:43 -04:00
|
|
|
endif()
|
2019-05-24 02:32:40 -04:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${SDRANGEL_BINARY_LIB_DIR}")
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${SDRANGEL_BINARY_LIB_DIR}")
|
|
|
|
if(WIN32)
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
2020-07-20 00:11:27 -04:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
|
2019-05-24 02:32:40 -04:00
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
2020-07-20 00:11:27 -04:00
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
|
2019-05-24 02:32:40 -04:00
|
|
|
set(BUILD_PLUGINS_RUNTIME_DIR "${SDRANGEL_BINARY_BIN_DIR}/plugins")
|
|
|
|
set(BUILD_PLUGINSSRV_RUNTIME_DIR "${SDRANGEL_BINARY_BIN_DIR}/pluginssrv")
|
|
|
|
endif()
|
2019-05-08 05:27:57 -04:00
|
|
|
set(BUILD_PLUGINS_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins")
|
|
|
|
set(BUILD_PLUGINSSRV_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pluginssrv")
|
2019-05-03 11:46:01 -04:00
|
|
|
# use only lib when create .app/.dmg
|
|
|
|
if(APPLE AND BUNDLE AND BUILD_GUI)
|
2019-05-07 13:36:47 -04:00
|
|
|
set(INSTALL_BIN_DIR ".")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(INSTALL_LIB_DIR "lib")
|
2019-05-06 08:09:28 -04:00
|
|
|
set(INSTALL_DOC_DIR "doc")
|
2019-06-24 12:25:53 -04:00
|
|
|
elseif(WIN32)
|
|
|
|
# used to create package
|
|
|
|
set(INSTALL_BIN_DIR ".")
|
|
|
|
set(INSTALL_LIB_DIR ".")
|
|
|
|
set(INSTALL_DOC_DIR ".")
|
2019-05-03 11:46:01 -04:00
|
|
|
else()
|
2019-05-07 13:36:47 -04:00
|
|
|
set(INSTALL_BIN_DIR "bin")
|
2019-05-03 11:46:01 -04:00
|
|
|
set(INSTALL_LIB_DIR "lib/${CMAKE_PROJECT_NAME}")
|
2019-05-06 08:09:28 -04:00
|
|
|
set(INSTALL_DOC_DIR "share/${CMAKE_PROJECT_NAME}")
|
2019-05-03 11:46:01 -04:00
|
|
|
endif()
|
2019-05-07 13:36:47 -04:00
|
|
|
set(INSTALL_PLUGINS_DIR "${INSTALL_LIB_DIR}/plugins")
|
|
|
|
set(INSTALL_PLUGINSSRV_DIR "${INSTALL_LIB_DIR}/pluginssrv")
|
2019-05-23 10:01:06 -04:00
|
|
|
set(EXTERNAL_BUILD_LIBRARIES "${CMAKE_BINARY_DIR}/external")
|
2019-05-01 13:16:37 -04:00
|
|
|
|
2019-05-27 10:51:15 -04:00
|
|
|
# custom libraries
|
|
|
|
set(CUSTOM_APPLE_INCLUDE "${CMAKE_SOURCE_DIR}/custom/apple" CACHE INTERNAL "")
|
|
|
|
set(CUSTOM_WINDOWS_INCLUDE "${CMAKE_SOURCE_DIR}/custom/windows" CACHE INTERNAL "")
|
|
|
|
|
2019-05-04 08:26:19 -04:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
set(LINUX TRUE)
|
|
|
|
# populate distribution name
|
2019-05-08 05:27:57 -04:00
|
|
|
# LSB_CODENAME will hold trusty for example
|
2019-05-04 08:26:19 -04:00
|
|
|
find_program(LSB_RELEASE_EXECUTABLE lsb_release)
|
|
|
|
if(LSB_RELEASE_EXECUTABLE)
|
|
|
|
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -cs
|
|
|
|
OUTPUT_VARIABLE LSB_CODENAME
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
endif()
|
2019-05-07 13:36:47 -04:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/cmake/cpack/${CMAKE_PROJECT_NAME}.desktop.in"
|
2019-05-06 08:09:28 -04:00
|
|
|
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.desktop" @ONLY)
|
2019-05-04 08:26:19 -04:00
|
|
|
elseif(APPLE)
|
2019-05-23 10:01:06 -04:00
|
|
|
if("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
|
|
|
|
message(STATUS "Build for macOS target: local version")
|
|
|
|
else()
|
|
|
|
message(STATUS "Build for macOS target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
endif()
|
2019-05-08 05:27:57 -04:00
|
|
|
|
2019-05-11 05:31:39 -04:00
|
|
|
# prepend path to find_*()
|
|
|
|
set(CMAKE_FIND_ROOT_PATH "/opt/local")
|
|
|
|
|
2019-05-03 11:46:01 -04:00
|
|
|
set(CMAKE_MACOSX_RPATH ON)
|
2019-05-08 05:27:57 -04:00
|
|
|
message(STATUS "RPATH support: ${CMAKE_MACOSX_RPATH}")
|
|
|
|
|
2019-05-07 13:36:47 -04:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/cmake/cpack/MacOSXBundleInfo.plist.in"
|
2019-05-06 08:09:28 -04:00
|
|
|
"${CMAKE_BINARY_DIR}/Info.plist" @ONLY)
|
2019-05-04 08:26:19 -04:00
|
|
|
elseif (WIN32)
|
2019-06-25 13:08:02 -04:00
|
|
|
# check compiler version
|
2020-11-01 07:03:13 -05:00
|
|
|
if(MSVC_VERSION GREATER 1920 AND MSVC_VERSION LESS 1929)
|
|
|
|
set(VS2019 ON)
|
|
|
|
elseif(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1919)
|
2019-06-25 13:08:02 -04:00
|
|
|
set(VS2017 ON)
|
|
|
|
elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910)
|
|
|
|
set(VS2015 ON)
|
|
|
|
endif()
|
|
|
|
|
2020-11-01 07:03:13 -05:00
|
|
|
if(NOT VS2015 AND NOT VS2017 AND NOT VS2019)
|
|
|
|
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler")
|
2019-05-24 02:32:40 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# compile with full multicore
|
2020-11-01 07:03:13 -05:00
|
|
|
if(MSVC)
|
|
|
|
add_compile_definitions(/MP)
|
2019-06-25 13:08:02 -04:00
|
|
|
endif()
|
2019-05-24 02:32:40 -04:00
|
|
|
|
|
|
|
# in alternative we can use ExternalProject
|
2019-05-03 11:46:01 -04:00
|
|
|
set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/windows")
|
2019-05-23 10:01:06 -04:00
|
|
|
set(FFTW3F_FOUND ON CACHE INTERNAL "")
|
|
|
|
set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/include" CACHE INTERNAL "")
|
2019-05-24 02:32:40 -04:00
|
|
|
set(FFTW3F_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/fftw-3/libfftw3f-3.lib" CACHE INTERNAL "")
|
2019-05-23 10:01:06 -04:00
|
|
|
set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/libusb/include" CACHE INTERNAL "")
|
2019-05-24 02:32:40 -04:00
|
|
|
set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll/libusb-1.0.lib" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
if(VS2019)
|
|
|
|
set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv4" CACHE INTERNAL "")
|
|
|
|
else()
|
|
|
|
set(OpenCV_DIR "${EXTERNAL_LIBRARY_FOLDER}/opencv" CACHE INTERNAL "")
|
|
|
|
endif()
|
2019-05-23 10:01:06 -04:00
|
|
|
set(PKG_CONFIG_EXECUTABLE "${EXTERNAL_LIBRARY_FOLDER}/pkg-config-lite/bin/pkg-config.exe" CACHE INTERNAL "")
|
2020-09-01 11:02:33 -04:00
|
|
|
set(SOAPYSUPPORT_DIR "${EXTERNAL_LIBRARY_FOLDER}/soapysdr-support" CACHE INTERNAL "")
|
2019-05-24 02:32:40 -04:00
|
|
|
|
2020-08-29 13:12:56 -04:00
|
|
|
set(CODEC2_FOUND ON CACHE INTERNAL "")
|
|
|
|
set(CODEC2_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/codec2/include" CACHE INTERNAL "")
|
|
|
|
set(CODEC2_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/codec2/lib/codec2.lib" CACHE INTERNAL "")
|
|
|
|
set(CODEC2_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/codec2/lib" CACHE INTERNAL "")
|
|
|
|
|
2020-10-02 17:45:28 -04:00
|
|
|
set(UHD_FOUND ON CACHE INTERNAL "")
|
|
|
|
set(UHD_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/uhd/include" CACHE INTERNAL "")
|
|
|
|
set(UHD_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/uhd/lib/uhd.lib" CACHE INTERNAL "")
|
|
|
|
set(UHD_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/uhd/bin" CACHE INTERNAL "")
|
|
|
|
|
2020-10-27 12:22:10 -04:00
|
|
|
set(OPENSSL_FOUND ON CACHE INTERNAL "")
|
|
|
|
set(OPENSSL_DLL_DIR "${EXTERNAL_LIBRARY_FOLDER}/openssl" CACHE INTERNAL "")
|
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# ffmpeg
|
|
|
|
set(FFMPEG_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
2019-06-25 13:08:02 -04:00
|
|
|
set(FFMPEG_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin" CACHE INTERNAL "")
|
2019-05-24 02:32:40 -04:00
|
|
|
set(AVCODEC_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
|
|
|
set(AVCODEC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/avcodec.lib" CACHE INTERNAL "")
|
|
|
|
set(AVFORMAT_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
|
|
|
set(AVFORMAT_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/avformat.lib" CACHE INTERNAL "")
|
|
|
|
set(AVUTIL_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
|
|
|
set(AVUTIL_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/avutil.lib" CACHE INTERNAL "")
|
|
|
|
set(SWRESAMPLE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
|
|
|
set(SWRESAMPLE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/swresample.lib" CACHE INTERNAL "")
|
|
|
|
set(SWSCALE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/include" CACHE INTERNAL "")
|
|
|
|
set(SWSCALE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/lib/swscale.lib" CACHE INTERNAL "")
|
|
|
|
|
2019-07-05 23:10:58 -04:00
|
|
|
# LimeSuite FX3 support
|
|
|
|
set(FX3SDK_DIR "${EXTERNAL_LIBRARY_FOLDER}/FX3SDK" CACHE INTERNAL "")
|
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# used on fixup_bundle phase
|
|
|
|
set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS
|
|
|
|
"${EXTERNAL_LIBRARY_FOLDER}/fftw-3"
|
|
|
|
"${EXTERNAL_LIBRARY_FOLDER}/libusb/MS64/dll"
|
|
|
|
"${EXTERNAL_LIBRARY_FOLDER}/ffmpeg/bin"
|
|
|
|
)
|
2019-05-02 10:56:07 -04:00
|
|
|
endif()
|
2019-05-01 13:16:37 -04:00
|
|
|
|
2019-05-09 08:40:27 -04:00
|
|
|
# TODO: check if(DEFINED) and fix macports -D
|
|
|
|
# fix install path
|
|
|
|
set(CMAKE_INSTALL_RPATH
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" CACHE
|
|
|
|
PATH "Library Install RPath" FORCE)
|
2019-05-31 04:52:41 -04:00
|
|
|
# Allow RPATH to files outside the build tree
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
2019-05-09 08:40:27 -04:00
|
|
|
# force full path
|
|
|
|
set(CMAKE_INSTALL_NAME_DIR
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" CACHE
|
|
|
|
PATH "Library Install Name Destination Directory" FORCE)
|
|
|
|
|
2019-05-02 15:34:25 -04:00
|
|
|
# enable 24 bit receiving path
|
|
|
|
if (RX_SAMPLE_24BIT)
|
|
|
|
message(STATUS "Compiling for 24 bit Rx DSP chain")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSDR_RX_SAMPLE_24BIT")
|
|
|
|
else()
|
|
|
|
message(STATUS "Compiling for 16 bit Rx DSP chain")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (SANITIZE_ADDRESS)
|
|
|
|
message(STATUS "Activate address sanitization")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (C_CLANG OR C_GCC)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wvla -Woverloaded-virtual -ffast-math -ftree-vectorize ${EXTRA_FLAGS}")
|
|
|
|
elseif (C_MSVC)
|
2020-02-28 07:12:42 -05:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -MP ${EXTRA_FLAGS}")
|
2019-05-02 15:34:25 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (C_CLANG)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ferror-limit=1")
|
|
|
|
elseif (C_GCC)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmax-errors=1")
|
|
|
|
endif()
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# set compiler
|
|
|
|
include(FindCompiler)
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# find cpu flags (and set compiler)
|
|
|
|
include(FindCPUflags)
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# Instruct CMake to run moc automatically when needed
|
2014-05-18 11:52:39 -04:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# Create code from a list of Qt designer ui files
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
|
|
|
# https://cmake.org/cmake/help/v3.0/manual/cmake-qt.7.html#autorcc
|
|
|
|
set(CMAKE_AUTORCC TRUE)
|
|
|
|
|
|
|
|
# As moc files are generated in the binary dir,
|
|
|
|
# tell CMake to always look for includes there:
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
# Qt requirements
|
2019-05-03 11:46:01 -04:00
|
|
|
set(_required_qt_version "5.6.0")
|
2019-05-01 05:54:58 -04:00
|
|
|
find_package(Qt5 COMPONENTS Core REQUIRED)
|
|
|
|
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
2019-06-07 03:33:33 -04:00
|
|
|
find_package(Qt5 COMPONENTS WebSockets REQUIRED)
|
2019-05-01 05:54:58 -04:00
|
|
|
find_package(Qt5 COMPONENTS Multimedia REQUIRED)
|
|
|
|
find_package(Qt5 COMPONENTS MultimediaWidgets REQUIRED)
|
2020-10-27 12:22:10 -04:00
|
|
|
find_package(Qt5 COMPONENTS SerialPort)
|
2019-05-01 05:54:58 -04:00
|
|
|
|
2020-10-27 12:22:10 -04:00
|
|
|
# for the server we don't need OpenGL/Qt Quick components
|
2019-05-01 05:54:58 -04:00
|
|
|
if (BUILD_GUI)
|
2019-05-02 02:07:05 -04:00
|
|
|
find_package(OpenGL REQUIRED)
|
2019-05-01 05:54:58 -04:00
|
|
|
find_package(Qt5 COMPONENTS OpenGL REQUIRED)
|
2020-10-27 12:22:10 -04:00
|
|
|
find_package(Qt5 COMPONENTS Quick)
|
|
|
|
find_package(Qt5 COMPONENTS QuickWidgets)
|
|
|
|
find_package(Qt5 COMPONENTS Positioning)
|
2019-04-15 04:54:27 -04:00
|
|
|
endif()
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# other requirements
|
|
|
|
find_package(PkgConfig REQUIRED)
|
2017-08-12 06:07:51 -04:00
|
|
|
find_package(Boost REQUIRED)
|
2019-05-01 05:54:58 -04:00
|
|
|
find_package(FFTW3F REQUIRED)
|
2019-05-02 15:34:25 -04:00
|
|
|
find_package(LibUSB REQUIRED) # used by so many packages
|
2020-04-19 04:36:20 -04:00
|
|
|
find_package(OpenCV OPTIONAL_COMPONENTS core highgui imgproc imgcodecs videoio) # channeltx/modatv
|
2019-05-24 02:32:40 -04:00
|
|
|
|
2019-06-24 12:25:53 -04:00
|
|
|
# macOS compatibility
|
|
|
|
if(APPLE)
|
|
|
|
find_package(ICONV)
|
|
|
|
endif()
|
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# unfortunately OpenCV library from windows doesn't set the cache option
|
|
|
|
if(WIN32)
|
|
|
|
set(OpenCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIRS}" CACHE INTERNAL "")
|
|
|
|
set(OpenCV_LIBS "${OpenCV_LIBS}" CACHE INTERNAL "")
|
|
|
|
|
|
|
|
# add libs folder for fixup_bundle()
|
2019-06-24 12:25:53 -04:00
|
|
|
get_filename_component(GFN_Boost_LIBS_DIR "${Boost_LIBS}" DIRECTORY)
|
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(OpenCV_ARCH "64")
|
|
|
|
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
|
|
set(OpenCV_ARCH "86")
|
|
|
|
endif()
|
|
|
|
|
2020-11-01 07:03:13 -05:00
|
|
|
set(OpenCV_LIBS_BIN_DIR "${OpenCV_DIR}/x${OpenCV_ARCH}/${OpenCV_RUNTIME}/bin" CACHE INTERNAL "")
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
set(WINDOWS_FIXUP_BUNDLE_LIB_DIRS
|
|
|
|
"${WINDOWS_FIXUP_BUNDLE_LIB_DIRS}"
|
|
|
|
"${GFN_Boost_LIBS_DIR}"
|
2019-06-24 12:25:53 -04:00
|
|
|
"${OpenCV_LIBS_BIN_DIR}"
|
2019-05-24 02:32:40 -04:00
|
|
|
)
|
|
|
|
endif()
|
2016-10-25 18:57:46 -04:00
|
|
|
|
2019-05-02 15:34:25 -04:00
|
|
|
# include external cmake if needed
|
|
|
|
if(ENABLE_EXTERNAL_LIBRARIES)
|
|
|
|
add_subdirectory(external)
|
2019-05-23 10:01:06 -04:00
|
|
|
else()
|
|
|
|
find_package(Codec2)
|
2020-03-28 13:50:22 -04:00
|
|
|
if (NOT APPLE)
|
|
|
|
find_package(CM256cc)
|
|
|
|
endif()
|
2019-05-23 10:01:06 -04:00
|
|
|
find_package(LibMbe)
|
2019-07-21 04:15:49 -04:00
|
|
|
find_package(SerialDV REQUIRED)
|
2019-05-23 10:01:06 -04:00
|
|
|
find_package(LibDSDcc)
|
2019-05-02 15:34:25 -04:00
|
|
|
endif()
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
# Devices
|
|
|
|
if(ENABLE_AIRSPY)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibAIRSPY)
|
2014-05-18 11:52:39 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_AIRSPYHF)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibAIRSPYHF)
|
2017-09-05 02:27:15 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_BLADERF)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibBLADERF 2.0)
|
2019-04-15 15:43:48 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_HACKRF)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibHACKRF)
|
2019-04-15 15:43:48 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_LIMESUITE)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LimeSuite)
|
2020-01-24 17:05:16 -05:00
|
|
|
if (LINUX AND LIMESUITE_FOUND)
|
|
|
|
add_definitions(-DHAS_LIMERFEUSB)
|
2020-01-11 19:10:51 -05:00
|
|
|
endif()
|
2019-04-15 15:43:48 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_IIO) # PlutoSDR
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibIIO)
|
2019-04-15 15:43:48 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_MIRISDR)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibMiriSDR)
|
2019-04-15 15:43:48 -04:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
if(ENABLE_PERSEUS)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibPerseus)
|
2019-05-01 05:54:58 -04:00
|
|
|
endif()
|
|
|
|
if(ENABLE_RTLSDR)
|
2019-05-09 08:18:27 -04:00
|
|
|
find_package(LibRTLSDR)
|
2019-05-01 05:54:58 -04:00
|
|
|
endif()
|
|
|
|
if(ENABLE_SOAPYSDR)
|
2019-05-22 05:36:16 -04:00
|
|
|
find_package(SoapySDR)
|
2019-05-01 05:54:58 -04:00
|
|
|
endif()
|
|
|
|
if(ENABLE_XTRX)
|
2019-05-07 13:36:47 -04:00
|
|
|
find_package(LibXTRX)
|
2017-09-05 02:27:15 -04:00
|
|
|
endif()
|
2020-10-02 17:45:28 -04:00
|
|
|
if(ENABLE_USRP)
|
|
|
|
find_package(UHD)
|
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
|
|
|
|
if(ENABLE_FUNCUBE AND UNIX AND LIBUSB_FOUND)
|
|
|
|
add_subdirectory(fcdlib)
|
|
|
|
add_subdirectory(fcdhid)
|
2018-12-03 19:39:41 -05:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
|
|
|
|
# base libraries
|
|
|
|
add_subdirectory(sdrbase)
|
2017-11-11 05:11:44 -05:00
|
|
|
add_subdirectory(httpserver)
|
|
|
|
add_subdirectory(logging)
|
2018-02-22 12:43:28 -05:00
|
|
|
add_subdirectory(qrtplib)
|
2017-11-16 21:17:15 -05:00
|
|
|
add_subdirectory(swagger)
|
2019-05-01 05:54:58 -04:00
|
|
|
add_subdirectory(devices)
|
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# strange symbol dependency
|
|
|
|
# mainbench.obj : error LNK2001: unresolved external
|
|
|
|
# symbol "public: static float const decimation_scale<12>::scaleIn" (?scaleIn@?$decimation_scale@$0M@@@2MB)
|
|
|
|
if(NOT WIN32)
|
|
|
|
add_subdirectory(sdrbench)
|
|
|
|
endif()
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
if (BUILD_GUI)
|
|
|
|
add_subdirectory(sdrgui)
|
2019-05-20 15:07:05 -04:00
|
|
|
add_subdirectory(plugins plugins)
|
2019-05-01 05:54:58 -04:00
|
|
|
endif()
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
if (BUILD_SERVER)
|
|
|
|
add_subdirectory(sdrsrv)
|
|
|
|
set(SERVER_MODE ON)
|
|
|
|
add_definitions(-DSERVER_MODE)
|
2019-05-20 15:07:05 -04:00
|
|
|
add_subdirectory(plugins pluginssrv)
|
2019-05-01 05:54:58 -04:00
|
|
|
remove_definitions(-DSERVER_MODE)
|
|
|
|
set(SERVER_MODE OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# includes needed by the following target
|
2014-05-18 11:52:39 -04:00
|
|
|
include_directories(
|
2016-10-25 18:57:46 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/sdrbase
|
2019-05-01 05:54:58 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/exports
|
2017-10-22 13:12:43 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/sdrgui
|
2019-05-01 05:54:58 -04:00
|
|
|
${CMAKE_SOURCE_DIR}/sdrsrv
|
|
|
|
${CMAKE_SOURCE_DIR}/sdrbench
|
2017-11-11 05:11:44 -05:00
|
|
|
${CMAKE_SOURCE_DIR}/logging
|
2016-10-25 18:57:46 -04:00
|
|
|
${OPENGL_INCLUDE_DIR}
|
2014-05-18 11:52:39 -04:00
|
|
|
)
|
|
|
|
|
2019-08-02 17:59:27 -04:00
|
|
|
# Set up optional make target for developer doc
|
|
|
|
find_package(Doxygen)
|
|
|
|
if(DOXYGEN_FOUND)
|
|
|
|
option(WITH_DOC "Generate developer doc with Doxygen" ON)
|
|
|
|
message(STATUS "added optional 'make dev_docs' for developer documentation generation")
|
|
|
|
|
|
|
|
# It is not an error when 'dot' is not found, just switching off the Doxygen's HAVE_DOT option
|
|
|
|
find_package_handle_standard_args (Dot REQUIRED_VARS DOXYGEN_DOT_EXECUTABLE)
|
|
|
|
|
|
|
|
# This sets HAVE_CASE_SENSITIVE_FILESYSTEM which is 0 or 1, we need "YES" or "NO"
|
|
|
|
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
|
|
|
|
if (HAVE_CASE_SENSITIVE_FILESYSTEM)
|
|
|
|
set(CMAKE_CASE_SENSITIVE_FILESYSTEM "YES")
|
|
|
|
else()
|
|
|
|
set(CMAKE_CASE_SENSITIVE_FILESYSTEM "NO")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32 OR APPLE)
|
|
|
|
set(CMAKE_SHORT_NAMES "YES")
|
|
|
|
else()
|
|
|
|
set(CMAKE_SHORT_NAMES "NO")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(DOX_HTML_OUT ${CMAKE_CURRENT_BINARY_DIR}/dev_docs)
|
|
|
|
|
|
|
|
if (WITH_DOC)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
|
|
|
add_custom_target(dev_docs)
|
|
|
|
add_custom_command(TARGET dev_docs POST_BUILD
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating developer documentation with Doxygen" VERBATIM
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "Doxygen not found, developer documentation can not be generated")
|
|
|
|
endif()
|
|
|
|
|
2019-05-01 05:54:58 -04:00
|
|
|
############ build sdrangel benchmark ################
|
2019-05-24 02:32:40 -04:00
|
|
|
if(NOT WIN32)
|
|
|
|
set(sdrangelbench_SOURCES
|
2018-04-23 10:43:18 -04:00
|
|
|
appbench/main.cpp
|
2019-05-24 02:32:40 -04:00
|
|
|
)
|
2018-04-23 10:43:18 -04:00
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
add_executable(sdrangelbench
|
2018-04-23 10:43:18 -04:00
|
|
|
${sdrangelbench_SOURCES}
|
2019-05-24 02:32:40 -04:00
|
|
|
)
|
2018-04-23 10:43:18 -04:00
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
target_link_libraries(sdrangelbench
|
2019-05-01 05:54:58 -04:00
|
|
|
Qt5::Multimedia
|
2018-04-23 10:43:18 -04:00
|
|
|
sdrbench
|
|
|
|
logging
|
2019-05-24 02:32:40 -04:00
|
|
|
)
|
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
############ build sdrangel gui ################
|
2018-12-03 19:39:41 -05:00
|
|
|
if (BUILD_GUI)
|
2019-05-01 05:54:58 -04:00
|
|
|
set(sdrangel_SOURCES
|
|
|
|
app/main.cpp
|
|
|
|
sdrgui/resources/sdrangel.rc
|
|
|
|
)
|
|
|
|
|
2019-05-06 08:09:28 -04:00
|
|
|
add_executable(${CMAKE_PROJECT_NAME}
|
2019-05-03 11:46:01 -04:00
|
|
|
${sdrangel_SOURCES}
|
2019-05-01 05:54:58 -04:00
|
|
|
)
|
|
|
|
|
2019-05-06 08:09:28 -04:00
|
|
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
2019-05-03 11:46:01 -04:00
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
Qt5::Widgets
|
|
|
|
Qt5::Multimedia
|
|
|
|
sdrbase
|
|
|
|
sdrgui
|
|
|
|
logging
|
2019-05-01 05:54:58 -04:00
|
|
|
)
|
2019-07-05 17:00:12 -04:00
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
|
|
|
|
endif()
|
2018-12-03 19:39:41 -05:00
|
|
|
endif()
|
2019-05-01 05:54:58 -04:00
|
|
|
|
|
|
|
############ build sdrangel server ################
|
2018-12-03 19:39:41 -05:00
|
|
|
if (BUILD_SERVER)
|
2019-05-06 08:09:28 -04:00
|
|
|
set(sdrangelsrv_SOURCES
|
|
|
|
appsrv/main.cpp
|
2019-05-01 05:54:58 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(sdrangelsrv
|
|
|
|
${sdrangelsrv_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(sdrangelsrv
|
|
|
|
Qt5::Multimedia
|
|
|
|
sdrbase
|
|
|
|
sdrsrv
|
|
|
|
logging
|
|
|
|
)
|
2018-12-03 19:39:41 -05:00
|
|
|
endif()
|
2016-02-17 13:42:26 -05:00
|
|
|
|
2019-05-06 08:09:28 -04:00
|
|
|
############ install ##################
|
2019-05-24 02:32:40 -04:00
|
|
|
if(NOT WIN32)
|
|
|
|
install(TARGETS sdrangelbench DESTINATION ${INSTALL_BIN_DIR})
|
|
|
|
endif()
|
2019-05-06 08:09:28 -04:00
|
|
|
if (BUILD_GUI)
|
2019-05-08 05:27:57 -04:00
|
|
|
install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${INSTALL_BIN_DIR})
|
2019-05-06 08:09:28 -04:00
|
|
|
endif()
|
|
|
|
if (BUILD_SERVER)
|
|
|
|
install(TARGETS sdrangelsrv DESTINATION ${INSTALL_BIN_DIR})
|
|
|
|
endif()
|
2019-05-03 11:46:01 -04:00
|
|
|
|
2019-06-01 13:28:36 -04:00
|
|
|
# install external libraries dependencies (Linux)
|
|
|
|
if (LINUX AND ENABLE_EXTERNAL_LIBRARIES)
|
|
|
|
install(DIRECTORY ${EXTERNAL_BUILD_LIBRARIES}/lib/ DESTINATION ${INSTALL_LIB_DIR})
|
|
|
|
endif()
|
2020-10-27 12:22:10 -04:00
|
|
|
if(WIN32)
|
|
|
|
include(DeployQt)
|
|
|
|
windeployqt(${CMAKE_PROJECT_NAME} ${SDRANGEL_BINARY_BIN_DIR} ${PROJECT_SOURCE_DIR}/sdrgui/resources)
|
|
|
|
endif()
|
2019-06-01 13:28:36 -04:00
|
|
|
|
2019-05-06 08:09:28 -04:00
|
|
|
# install documentation
|
|
|
|
# TODO maybe install readme for every plugins
|
2019-06-24 12:25:53 -04:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/Readme.md DESTINATION ${INSTALL_DOC_DIR})
|
2019-05-22 11:16:06 -04:00
|
|
|
|
2019-06-24 12:25:53 -04:00
|
|
|
if(APPLE OR WIN32)
|
2019-05-06 08:09:28 -04:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/CHANGELOG DESTINATION ${INSTALL_DOC_DIR})
|
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${INSTALL_DOC_DIR})
|
|
|
|
endif()
|
2019-05-03 11:46:01 -04:00
|
|
|
|
2019-05-06 08:09:28 -04:00
|
|
|
#install files and directories (linux specific)
|
|
|
|
if (LINUX)
|
2019-05-07 13:36:47 -04:00
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.desktop DESTINATION share/applications)
|
2019-10-11 06:32:16 -04:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/cmake/cpack/${CMAKE_PROJECT_NAME}_icon.svg DESTINATION share/icons/hicolor/scalable/apps)
|
2019-05-06 08:09:28 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
############ uninstall target ################
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
|
|
|
|
add_custom_target(uninstall
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)
|
|
|
|
|
|
|
|
############ packaging ################
|
2019-05-08 05:27:57 -04:00
|
|
|
add_subdirectory(cmake/cpack)
|