2019-05-23 10:01:06 -04:00
|
|
|
# Many idea are exposed at
|
|
|
|
# https://stackoverflow.com/questions/15175318/cmake-how-to-build-external-projects-and-include-their-targets
|
|
|
|
# https://crascit.com/2015/07/25/cmake-gtest/
|
|
|
|
#
|
|
|
|
# in essence, we need a way to build external libraries before use it;
|
|
|
|
# we choose add_dependencies() to the target.
|
|
|
|
# other viable solution is to use execute_process() during config
|
|
|
|
# but make the configuration dirty
|
2019-05-02 15:34:25 -04:00
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# which version/tag/checkout to use
|
2022-05-26 16:35:41 -04:00
|
|
|
set(CODEC2_TAG "v1.0.3")
|
2020-04-11 11:44:54 -04:00
|
|
|
set(CM256CC_TAG c0e92b92aca3d1d36c990b642b937c64d363c559)
|
2020-11-01 07:01:32 -05:00
|
|
|
set(MBELIB_TAG fe83b32c6a60cdd7bce8cecf3c7a0b9ec87a7667)
|
2019-10-22 19:54:02 -04:00
|
|
|
set(SERIALDV_TAG "v1.1.4")
|
2023-11-29 15:30:39 -05:00
|
|
|
set(DSDCC_TAG "v1.9.5")
|
2023-01-11 10:35:12 -05:00
|
|
|
set(LIMESUITE_TAG 70e3859a55d8d5353963a5318013c8454594769f)
|
2022-09-17 13:11:32 -04:00
|
|
|
set(BLADERF_TAG "2021.02")
|
2020-08-21 00:32:33 -04:00
|
|
|
set(LIBIIO_TAG 826563e41b5ce9890b75506f672017de8d76d52d)
|
2022-10-07 11:07:43 -04:00
|
|
|
set(AIRSPYHF_TAG "1af81c0ca18944b8c9897c3c98dc0a991815b686")
|
2019-06-02 19:30:05 -04:00
|
|
|
set(PERSEUS_TAG afefa23e3140ac79d845acb68cf0beeb86d09028)
|
2022-07-18 15:15:59 -04:00
|
|
|
set(MIRISDR_TAG "v2.0.0")
|
2023-07-30 12:12:43 -04:00
|
|
|
set(LIBSIGMF_TAG "new-namespaces")
|
2019-05-24 02:32:40 -04:00
|
|
|
|
2019-06-24 12:25:53 -04:00
|
|
|
set(PTHREADS4W_TAG "Version-2-11-0-release")
|
2023-08-26 09:25:33 -04:00
|
|
|
set(RTLSDR_TAG 1261fbb285297da08f4620b18871b6d6d9ec2a7b)
|
2019-06-24 12:25:53 -04:00
|
|
|
set(RTLSDR_UDEV OFF)
|
|
|
|
set(SOAPYSDR_TAG "soapy-sdr-0.7.1")
|
|
|
|
set(SOAPYSDR_SDRPLAY_TAG "soapy-sdrplay-0.2.0")
|
|
|
|
set(SOAPYSDR_AUDIO_TAG "soapy-audio-0.1.1")
|
|
|
|
set(SOAPYSDR_REMOTE_TAG "soapy-remote-0.5.1")
|
2022-10-07 11:07:43 -04:00
|
|
|
set(AIRSPY_TAG "37c768ce9997b32e7328eb48972a7fda0a1f8554")
|
2022-10-05 16:29:44 -04:00
|
|
|
set(HACKRF_TAG "v2022.09.1")
|
2023-04-18 04:03:05 -04:00
|
|
|
set(LIBXML2_TAG "v2.10.4")
|
2023-12-01 07:03:37 -05:00
|
|
|
set(UHD_TAG "v4.5.0.0")
|
|
|
|
if (APPLE AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64))
|
|
|
|
# UHD fails to load with 1.80+
|
|
|
|
set(BOOST_TAG "1.78.0")
|
|
|
|
set(BOOST_TAG2 "1_78_0")
|
|
|
|
else()
|
|
|
|
set(BOOST_TAG "1.83.0")
|
|
|
|
set(BOOST_TAG2 "1_83_0")
|
|
|
|
endif()
|
2019-05-24 02:32:40 -04:00
|
|
|
|
2019-05-23 10:01:06 -04:00
|
|
|
# For some external project macros
|
|
|
|
include(ExternalProject)
|
|
|
|
|
2019-05-24 02:32:40 -04:00
|
|
|
# default build destination in windows to avoid Release/Debug folder
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
|
|
|
# the build will be output on the same folder of sdrangel
|
2020-11-01 07:03:13 -05:00
|
|
|
set(COMMON_CMAKE_ARGS
|
2020-04-30 08:19:19 -04:00
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${SDRANGEL_BINARY_BIN_DIR}
|
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${SDRANGEL_BINARY_BIN_DIR}
|
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${SDRANGEL_BINARY_BIN_DIR}
|
2020-07-20 00:11:27 -04:00
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO=${SDRANGEL_BINARY_BIN_DIR}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${SDRANGEL_BINARY_LIB_DIR}
|
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${SDRANGEL_BINARY_LIB_DIR}
|
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${SDRANGEL_BINARY_LIB_DIR}
|
2020-07-20 00:11:27 -04:00
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO=${SDRANGEL_BINARY_LIB_DIR}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${SDRANGEL_BINARY_LIB_DIR}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=${SDRANGEL_BINARY_LIB_DIR}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=${SDRANGEL_BINARY_LIB_DIR}
|
2020-07-20 00:11:27 -04:00
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO=${SDRANGEL_BINARY_LIB_DIR}
|
2020-04-30 08:19:19 -04:00
|
|
|
)
|
|
|
|
elseif (LINUX)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(COMMON_CMAKE_ARGS
|
2020-04-30 08:19:19 -04:00
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/bin
|
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/bin
|
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/bin
|
2020-07-20 00:11:27 -04:00
|
|
|
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/bin
|
2022-01-25 19:00:49 -05:00
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
|
|
|
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO=${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}
|
2020-07-20 00:11:27 -04:00
|
|
|
)
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
2019-05-23 10:01:06 -04:00
|
|
|
|
2020-11-01 07:03:13 -05:00
|
|
|
if(CMAKE_MSVC_RUNTIME_LIBRARY)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
|
|
|
endif()
|
|
|
|
|
2020-11-21 22:02:39 -05:00
|
|
|
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_POLICY_DEFAULT_CMP0069:STRING=NEW)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=${CMAKE_INTERPROCEDURAL_OPTIMIZATION})
|
|
|
|
endif()
|
|
|
|
|
2020-11-20 13:47:04 -05:00
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
|
|
|
|
if (CMAKE_LINKER)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_LINKER=${CMAKE_LINKER})
|
|
|
|
endif()
|
|
|
|
if (CMAKE_AR)
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_AR=${CMAKE_AR})
|
|
|
|
endif()
|
|
|
|
|
2020-11-01 07:03:13 -05:00
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD})
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED})
|
|
|
|
list(APPEND COMMON_CMAKE_ARGS -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS})
|
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (LINUX)
|
|
|
|
# macro that create symbolic links
|
|
|
|
macro(makeLink src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E create_symlink ${src} ${dest} DEPENDS ${dest} COMMENT "mklink ${src} -> ${dest}")
|
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
# macro that copy folder
|
|
|
|
macro(makeCopy src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} PRE_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${dest} DEPENDS ${dest} COMMENT "copy ${src} -> ${dest}")
|
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
# macro that copy file
|
|
|
|
macro(makeCopyFile src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} PRE_BUILD
|
2021-10-05 09:31:01 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dest} DEPENDS ${dest} COMMENT "copy ${src} -> ${dest}")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
else ()
|
|
|
|
# macro that create symbolic links
|
|
|
|
macro(makeLink src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E create_symlink ${src} ${dest} DEPENDS ${dest} COMMENT "mklink ${src} -> ${dest}")
|
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
# macro that copy folder
|
|
|
|
macro(makeCopyDir src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${dest} DEPENDS ${dest} COMMENT "copy ${src} -> ${dest}")
|
|
|
|
endif ()
|
|
|
|
endmacro()
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
# macro that copy file
|
|
|
|
macro(makeCopy src dest target)
|
|
|
|
if (NOT EXISTS ${dest})
|
|
|
|
add_custom_command(TARGET ${target} POST_BUILD
|
2021-10-05 09:31:01 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dest} DEPENDS ${dest} COMMENT "copy ${src} -> ${dest}")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
endif (LINUX)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
|
|
|
if (VS2015)
|
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(VCREDIST_FILE "vcredist_msvc2015_x64${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# maybe add arm architecture
|
|
|
|
else ()
|
|
|
|
set(VCREDIST_FILE "vcredist_msvc2015_x86${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
endif ()
|
|
|
|
elseif (VS2017)
|
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(VCREDIST_FILE "vcredist_msvc2017_x64${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# maybe add arm architecture
|
|
|
|
else ()
|
|
|
|
set(VCREDIST_FILE "vcredist_msvc2017_x86${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
endif ()
|
|
|
|
else ()
|
|
|
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set(VCREDIST_FILE "vc_redist.x64${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# maybe add arm architecture
|
|
|
|
else ()
|
|
|
|
set(VCREDIST_FILE "vc_redist.x86${CMAKE_EXECUTABLE_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
install(FILES "${EXTERNAL_LIBRARY_FOLDER}/vcredist/${VCREDIST_FILE}" DESTINATION "${INSTALL_BIN_DIR}")
|
|
|
|
endif (WIN32)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${CMAKE_BINARY_DIR}/${INSTALL_LIB_DIR}")
|
|
|
|
|
|
|
|
# While some of the following projects are not installed (to save time & space), some have to
|
|
|
|
# be so that on MacOS, the paths embedded in the libraries to other libraries are correct (as they are set to
|
|
|
|
# install path, not build). This is required for macdeployqt to be able to find them
|
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
# Some of the following projects are currently built only for MacOS
|
|
|
|
# For WIN32, we use precompiled versions from sdrangel-windows-libraries
|
2022-10-19 05:24:39 -04:00
|
|
|
# For LINUX, we require system pacakges to be installed
|
|
|
|
if (APPLE)
|
2022-05-18 04:54:10 -04:00
|
|
|
set(USE_PRECOMPILED_LIBS FALSE)
|
|
|
|
else()
|
|
|
|
set(USE_PRECOMPILED_LIBS TRUE)
|
|
|
|
endif()
|
2022-05-17 10:06:45 -04:00
|
|
|
|
2023-09-13 16:58:51 -04:00
|
|
|
# We don't CACHE the _DEPENDS variables, as some external projects are only added when NOT _FOUND
|
|
|
|
# and not in subsequent configures when _FOUND (E.g. ffmpeg/opencv aren't added second time
|
|
|
|
# around as it slows down the build and causes some dependencies to always be rebuilt.)
|
|
|
|
# Use PARENT_SCOPE so they can be used in other CMakeFiles.
|
2022-05-27 05:36:02 -04:00
|
|
|
macro(set_global NAME VALUE)
|
|
|
|
set(${NAME} ${VALUE})
|
|
|
|
set(${NAME} ${VALUE} PARENT_SCOPE)
|
|
|
|
endmacro()
|
2022-05-26 16:33:11 -04:00
|
|
|
|
2023-07-30 10:45:11 -04:00
|
|
|
# Setting a cache variable doesn't update the variable in parent scope if already set,
|
|
|
|
# so we need to set the cache and parent_scope separately
|
|
|
|
macro(set_global_cache NAME VALUE)
|
|
|
|
set(${NAME} ${VALUE} CACHE INTERNAL "")
|
|
|
|
set(${NAME} ${VALUE} PARENT_SCOPE)
|
|
|
|
endmacro()
|
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT LIBUSB_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
# Cloning git repo doesn't include configure, so we download the bz2 which does
|
|
|
|
ExternalProject_Add(libusb
|
|
|
|
URL https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libusb"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(libusb install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(LIBUSB_DEPENDS libusb)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBUSB_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LIBUSB_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBUSB_INCLUDE_DIR "${install_dir}/include/libusb-1.0" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(LIBUSB_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libusb.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(LIBUSB_LIBRARIES "${install_dir}/lib${LIB_SUFFIX}/libusb-1.0${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBUSB_LIBRARIES "${install_dir}/lib/libusb-1.0${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT LIBUSB_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2023-07-30 11:48:42 -04:00
|
|
|
if (NOT HIDAPI_FOUND AND NOT USE_PRECOMPILED_LIBS AND ENABLE_FUNCUBE)
|
2022-05-26 16:33:11 -04:00
|
|
|
ExternalProject_Add(hidapi
|
|
|
|
GIT_REPOSITORY https://github.com/libusb/hidapi.git
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/hidapi"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(hidapi install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(HIDAPI_DEPENDS hidapi)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(HIDAPI_FOUND ON)
|
2022-05-26 16:33:11 -04:00
|
|
|
set(HIDAPI_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(HIDAPI_ROOT_DIR "${install_dir}" CACHE INTERNAL "")
|
2022-05-27 07:27:01 -04:00
|
|
|
set(HIDAPI_INCLUDE_DIRS "${install_dir}/include/hidapi" CACHE INTERNAL "")
|
2022-05-26 16:33:11 -04:00
|
|
|
if (APPLE)
|
|
|
|
set(HIDAPI_LIBRARIES "${install_dir}/lib/libhidapi${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2023-07-30 11:50:48 -04:00
|
|
|
endif ()
|
2022-05-26 16:33:11 -04:00
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT OPUS_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(opus
|
|
|
|
GIT_REPOSITORY https://github.com/xiph/opus
|
|
|
|
GIT_TAG v1.3.1
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/opus"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DOPUS_BUILD_SHARED_LIBRARY=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(opus install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(OPUS_DEPENDS opus)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(OPUS_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(OPUS_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(OPUS_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(OPUS_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(OPUS_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libopus.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(OPUS_LIBRARIES "${install_dir}/lib${LIB_SUFFIX}/libopus${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(OPUS_LIBRARIES "${install_dir}/lib/libopus${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT OPUS_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT ZLIB_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(zlib
|
2023-08-22 11:53:34 -04:00
|
|
|
URL https://zlib.net/current/zlib.tar.gz
|
2022-05-16 08:48:29 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/zlib"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(zlib install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(ZLIB_DEPENDS zlib)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(ZLIB_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(ZLIB_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(ZLIB_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(ZLIB_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libz.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(ZLIB_LIBRARIES "${install_dir}/lib${LIB_SUFFIX}/libz${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(ZLIB_LIBRARIES "${install_dir}/lib/libz${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT ZLIB_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT FAAD_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(faad
|
|
|
|
URL https://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.8.0/faad2-2.8.8.tar.gz
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/faad"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(faad source_dir binary_dir install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(FAAD_DEPENDS faad)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(FAAD_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FAAD_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(FAAD_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(FAAD_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/libfaad.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(FAAD_LIBRARY "${install_dir}/lib${LIB_SUFFIX}/libfaad${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(FAAD_LIBRARY "${install_dir}/lib/libfaad${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT FAAD_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT FFTW3F_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(fftw3f
|
|
|
|
URL http://fftw.org/fftw-3.3.10.tar.gz
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/fftw3f"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-float
|
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(fftw3f source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(FFTW3F_DEPENDS fftw3f)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(FFTW3F_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FFTW3F_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(FFTW3F_INCLUDE_DIRS "${source_dir}/api" "${binary_dir}" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(FFTW3F_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libfftw3f.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(FFTW3F_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libfftw3f${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(FFTW3F_LIBRARIES "${binary_dir}/.libs/libfftw3f.a" CACHE INTERNAL "")
|
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT FFTW3F_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
|
|
|
# Can't build Boost using ExternalProject_Add, as we want to use find_package(Boost) as it defines many variables,
|
|
|
|
# and using find_package requires Boost to have already been built
|
|
|
|
# So instead, we use FetchContent and build Boost at CMake configure time
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(boost
|
2023-12-01 07:03:37 -05:00
|
|
|
URL "https://sourceforge.net/projects/boost/files/boost/${BOOST_TAG}/boost_${BOOST_TAG2}.tar.gz/download"
|
2022-05-16 08:48:29 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
find_package(Boost QUIET)
|
2022-05-18 04:54:10 -04:00
|
|
|
if (NOT Boost_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
|
|
|
message("Downloading Boost")
|
|
|
|
FetchContent_MakeAvailable(boost)
|
|
|
|
|
|
|
|
# Add path to where Boost is built
|
|
|
|
set(CMAKE_PREFIX_PATH ${boost_BINARY_DIR})
|
|
|
|
|
|
|
|
# Check to see if already built - Don't build again
|
|
|
|
find_package(Boost QUIET)
|
|
|
|
if(NOT Boost_FOUND)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ./bootstrap.sh --prefix=${boost_BINARY_DIR}
|
|
|
|
WORKING_DIRECTORY ${boost_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ./b2
|
|
|
|
WORKING_DIRECTORY ${boost_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ./b2 install
|
|
|
|
WORKING_DIRECTORY ${boost_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
message("Boost built in ${boost_BINARY_DIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Cache binary dir so we know it was built in subsequent builds
|
|
|
|
set(boost_BINARY_DIR ${boost_BINARY_DIR} CACHE INTERNAL "")
|
|
|
|
|
|
|
|
# Check it was built and import the variables
|
|
|
|
find_package(Boost REQUIRED)
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${boost_BINARY_DIR}/lib")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if (DEFINED boost_BINARY_DIR)
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${boost_BINARY_DIR}/lib")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2023-07-27 12:08:29 -04:00
|
|
|
if (NOT FFMPEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
|
|
|
# Libs only used by ffmpeg
|
|
|
|
|
|
|
|
# They are installed so ffmpeg can use pkg-config to find them
|
|
|
|
|
|
|
|
if (NOT X264_FOUND OR X264_EXTERNAL)
|
|
|
|
# x264's configure script forces a full rebuild each time, so set UPDATE_DISCONNECTED
|
|
|
|
# so it's only downloaded
|
|
|
|
ExternalProject_Add(x264
|
|
|
|
GIT_REPOSITORY https://code.videolan.org/videolan/x264.git
|
|
|
|
UPDATE_DISCONNECTED TRUE
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/x264"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-shared
|
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(x264 install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(X264_DEPENDS x264)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(X264_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(X264_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(X264_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
endif (NOT X264_FOUND OR X264_EXTERNAL)
|
|
|
|
|
|
|
|
if (NOT X265_FOUND OR X265_EXTERNAL)
|
|
|
|
ExternalProject_Add(x265
|
|
|
|
GIT_REPOSITORY https://bitbucket.org/multicoreware/x265_git.git
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/x265"
|
|
|
|
SOURCE_SUBDIR "source"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(x265 install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(X265_DEPENDS x265)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(X265_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(X265_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(X265_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
endif (NOT X265_FOUND OR X265_EXTERNAL)
|
|
|
|
|
|
|
|
if (NOT FDK_AAC_FOUND OR FDK_AAC_EXTERNAL)
|
|
|
|
ExternalProject_Add(fdk_aac
|
|
|
|
GIT_REPOSITORY https://github.com/mstorsjo/fdk-aac.git
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/fdk-aac"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(fdk_aac install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(FDK_AAC_DEPENDS fdk_aac)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FDK_AAC_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(FDK_AAC_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FDK_AAC_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
endif (NOT FDK_AAC_FOUND OR FDK_AAC_EXTERNAL)
|
|
|
|
|
|
|
|
# https://www.mpg123.de/download.shtml
|
|
|
|
if (NOT MPG123_FOUND OR MPG123_EXTERNAL)
|
|
|
|
ExternalProject_Add(mpg123
|
|
|
|
URL https://downloads.sourceforge.net/project/mpg123/mpg123/1.29.3/mpg123-1.29.3.tar.bz2
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/mpg123"
|
|
|
|
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-shared
|
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(mpg123 install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(MPG123_DEPENDS mpg123)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MPG123_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(MPG123_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MPG123_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
endif (NOT MPG123_FOUND OR MPG123_EXTERNAL)
|
|
|
|
|
|
|
|
if (NOT LAME_FOUND OR LAME_EXTERNAL)
|
|
|
|
ExternalProject_Add(lame
|
2022-05-17 09:11:10 -04:00
|
|
|
SVN_REPOSITORY http://svn.code.sf.net/p/lame/svn/trunk/lame
|
2022-05-16 08:48:29 -04:00
|
|
|
UPDATE_DISCONNECTED TRUE
|
|
|
|
DEPENDS ${MPG123_DEPENDS}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/lame"
|
2023-12-20 03:18:43 -05:00
|
|
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${MPG123_PKG_CONFIG_DIR} <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-shared --disable-frontend
|
2022-05-16 08:48:29 -04:00
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(lame install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(LAME_DEPENDS lame)
|
2022-05-16 08:48:29 -04:00
|
|
|
# ffmpeg doesn't try to use pkg-config for lame, as it doesn't include a .pc file
|
|
|
|
#set(LAME_PKG_CONFIG_DIR "${install_dir}/lib/pkgconfig")
|
|
|
|
set(LAME_EXTRA_CFLAGS "-I${install_dir}/include")
|
2023-12-01 07:03:37 -05:00
|
|
|
if (APPLE AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL arm64))
|
|
|
|
set(LAME_EXTRA_LDFLAGS "-L${install_dir}/lib -Wl,-ld_classic")
|
|
|
|
else()
|
|
|
|
set(LAME_EXTRA_LDFLAGS "-L${install_dir}/lib")
|
|
|
|
endif()
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LAME_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LAME_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
endif (NOT LAME_FOUND OR LAME_EXTERNAL)
|
|
|
|
|
|
|
|
# We have to install this so OpenCV can find it
|
|
|
|
# OpenCV doesn't currently build with ffmpeg 5, so use 4
|
2023-10-30 06:12:07 -04:00
|
|
|
set(FFMPEG_EXTRA_LDFLAGS ${LAME_EXTRA_LDFLAGS})
|
|
|
|
set(FFMPEG_EXTRA_CFLAGS ${LAME_EXTRA_CFLAGS})
|
|
|
|
if (APPLE AND (XCODE_VERSION VERSION_GREATER_EQUAL 15.0.0))
|
|
|
|
set(FFMPEG_EXTRA_LDFLAGS "${FFMPEG_EXTRA_LDFLAGS} -Wl,-ld_classic")
|
|
|
|
endif()
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(ffmpeg
|
|
|
|
GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg.git
|
|
|
|
GIT_TAG n4.4.2
|
|
|
|
DEPENDS ${X264_DEPENDS} ${X265_DEPENDS} ${OPUS_DEPENDS} ${FDK_AAC_DEPENDS} ${LAME_DEPENDS}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/ffmpeg"
|
2023-10-30 06:12:07 -04:00
|
|
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${X264_PKG_CONFIG_DIR}:${X265_PKG_CONFIG_DIR}:${OPUS_PKG_CONFIG_DIR}:${FDK_AAC_PKG_CONFIG_DIR} <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --enable-shared --enable-gpl --enable-nonfree --enable-libx264 --enable-libx265 --enable-libopus --enable-libfdk-aac --enable-libmp3lame --extra-ldflags=${FFMPEG_EXTRA_LDFLAGS} --extra-cflags=${FFMPEG_EXTRA_CFLAGS}
|
2022-05-16 08:48:29 -04:00
|
|
|
BUILD_COMMAND ${MAKE}
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(ffmpeg install_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(FFMPEG_DEPENDS ffmpeg)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FFMPEG_INSTALL_DIR "${install_dir}")
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(FFMPEG_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(FFMPEG_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(FFMPEG_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(AVCODEC_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(AVFORMAT_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(AVUTIL_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(SWRESAMPLE_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(SWSCALE_INCLUDE_DIRS "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
set(AVCODEC_LIBRARIES "${install_dir}/lib/libavcodec${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(AVFORMAT_LIBRARIES "${install_dir}/lib/libavformat${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(AVUTIL_LIBRARIES "${install_dir}/lib/libavutil${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(SWRESAMPLE_LIBRARIES "${install_dir}/lib/libswresample${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(SWSCALE_LIBRARIES "${install_dir}/lib/libswscale${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
if (APPLE)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
endif (NOT FFMPEG_FOUND AND NOT USE_PRECOMPILED_LIBS)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2023-07-30 11:48:42 -04:00
|
|
|
# OpenCV only used by Mod ATV curently
|
|
|
|
if (NOT OpenCV_FOUND AND NOT USE_PRECOMPILED_LIBS AND ENABLE_CHANNELTX_MODATV)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(opencv
|
|
|
|
GIT_REPOSITORY https://github.com/opencv/opencv.git
|
|
|
|
GIT_TAG 4.5.5
|
|
|
|
DEPENDS "${FFMPEG_DEPENDS}"
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/opencv"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DWITH_FFMPEG=ON -DCMAKE_PREFIX_PATH=${FFMPEG_INSTALL_DIR}
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(opencv source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(OpenCV_DEPENDS opencv)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(OpenCV_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(OpenCV_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(OpenCV_INCLUDE_DIRS
|
|
|
|
"${source_dir}/modules/calib3d/include"
|
|
|
|
"${source_dir}/modules/core/include"
|
|
|
|
"${source_dir}/modules/dnn/include"
|
|
|
|
"${source_dir}/modules/features2d/include"
|
|
|
|
"${source_dir}/modules/flann/include"
|
|
|
|
"${source_dir}/modules/gapi/include"
|
|
|
|
"${source_dir}/modules/highgui/include"
|
|
|
|
"${source_dir}/modules/imgcodecs/include"
|
|
|
|
"${source_dir}/modules/imgproc/include"
|
|
|
|
"${source_dir}/modules/java/include"
|
|
|
|
"${source_dir}/modules/java/include"
|
|
|
|
"${source_dir}/modules/js/include"
|
|
|
|
"${source_dir}/modules/ml/include"
|
|
|
|
"${source_dir}/modules/obj/include"
|
|
|
|
"${source_dir}/modules/objdetect/include"
|
|
|
|
"${source_dir}/modules/photo/include"
|
|
|
|
"${source_dir}/modules/python/include"
|
|
|
|
"${source_dir}/modules/stitching/include"
|
|
|
|
"${source_dir}/modules/ts/include"
|
|
|
|
"${source_dir}/modules/video/include"
|
|
|
|
"${source_dir}/modules/videoio/include"
|
|
|
|
"${source_dir}/modules/world/include"
|
|
|
|
"${binary_dir}"
|
|
|
|
CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(OpenCV_LIBS "${SDRANGEL_BINARY_LIB_DIR}/libopencv.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(OpenCV_LIBS "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libopencv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(OpenCV_LIBS "${binary_dir}/lib/libopencv_core${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_core${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_highgui${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_video${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_videoio${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_imgproc${CMAKE_SHARED_LIBRARY_SUFFIX};${binary_dir}/lib/libopencv_imgcodecs${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/lib")
|
|
|
|
endif ()
|
2023-07-30 11:50:48 -04:00
|
|
|
endif (NOT OpenCV_FOUND AND NOT USE_PRECOMPILED_LIBS AND ENABLE_CHANNELTX_MODATV)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2022-05-18 04:54:10 -04:00
|
|
|
if ((NOT CODEC2_FOUND OR CODEC2_EXTERNAL) AND NOT USE_PRECOMPILED_LIBS)
|
2020-04-30 08:19:19 -04:00
|
|
|
# needs speexdsp
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(CODEC2_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/codec2.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
endif ()
|
2023-07-27 10:07:03 -04:00
|
|
|
# Repo temp set to codec2-dev to use v1.0.3 tag
|
|
|
|
# Should revert to codec2 when we eventually update to latest (v1.2.0+) release
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(codec2
|
2023-07-27 10:07:03 -04:00
|
|
|
GIT_REPOSITORY https://github.com/drowe67/codec2-dev.git
|
2020-04-30 08:19:19 -04:00
|
|
|
GIT_TAG ${CODEC2_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/codec2"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${CODEC2_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(codec2 source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(CODEC2_DEPENDS codec2)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(CODEC2_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(CODEC2_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(CODEC2_INCLUDE_DIR "${source_dir}/src" "${binary_dir}" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
set(CODEC2_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/codec2.lib" CACHE INTERNAL "")
|
|
|
|
makeCopy("${source_dir}/src" "${source_dir}/src/codec2" codec2)
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(CODEC2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
makeLink("${source_dir}/src" "${source_dir}/src/codec2" codec2)
|
2022-05-16 08:48:29 -04:00
|
|
|
elseif (APPLE)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(CODEC2_LIBRARIES "${binary_dir}/src/libcodec2${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# some source include "codec2/comp.h" and some without codec2
|
|
|
|
makeLink("${source_dir}/src" "${source_dir}/src/codec2" codec2)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/src")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
2022-05-18 04:54:10 -04:00
|
|
|
endif ((NOT CODEC2_FOUND OR CODEC2_EXTERNAL) AND NOT USE_PRECOMPILED_LIBS)
|
2019-05-02 15:34:25 -04:00
|
|
|
|
2022-05-16 08:48:29 -04:00
|
|
|
if (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)
|
2020-04-30 08:19:19 -04:00
|
|
|
# needs boost
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(CM256CC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/cm256cc.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(CM256CC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
endif ()
|
|
|
|
string(REPLACE ";" "|" CMAKE_PREFIX_PATH_SEP "${CMAKE_PREFIX_PATH}")
|
2020-03-28 13:50:22 -04:00
|
|
|
ExternalProject_Add(cm256cc
|
2020-04-30 08:19:19 -04:00
|
|
|
GIT_REPOSITORY https://github.com/f4exb/cm256cc.git
|
|
|
|
GIT_TAG ${CM256CC_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/cm256cc"
|
2020-11-01 07:03:13 -05:00
|
|
|
LIST_SEPARATOR |
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DBUILD_TOOLS=OFF
|
2020-11-01 07:03:13 -05:00
|
|
|
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_SEP}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DENABLE_DISTRIBUTION=ON
|
2022-05-16 11:24:46 -04:00
|
|
|
-DBoost_INCLUDE_DIR=${Boost_INCLUDE_DIR}
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${CM256CC_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2020-03-28 13:50:22 -04:00
|
|
|
ExternalProject_Get_Property(cm256cc source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(CM256CC_DEPENDS cm256cc)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(CM256CC_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(CM256CC_EXTERNAL ON CACHE INTERNAL "")
|
2020-03-28 13:50:22 -04:00
|
|
|
# we need cm256cc/library.h
|
|
|
|
set(CM256CC_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/cm256cc/src" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
2020-03-28 13:50:22 -04:00
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/cm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
2020-04-30 08:19:19 -04:00
|
|
|
elseif (APPLE) # kept in case of relaxation of APPLE exclusion
|
2020-03-28 13:50:22 -04:00
|
|
|
set(CM256CC_LIBRARIES "${binary_dir}/libcm256cc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
2020-04-30 08:19:19 -04:00
|
|
|
FILES_MATCHING PATTERN "libcm256cc*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2020-03-28 13:50:22 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
2022-05-16 08:48:29 -04:00
|
|
|
endif (NOT CM256CC_FOUND OR CM256CC_EXTERNAL)
|
2019-05-23 10:01:06 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EXTERNAL))
|
|
|
|
set(USE_MBELIB OFF)
|
2020-11-01 07:01:32 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBMBE_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libmbe.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBMBE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-11-01 07:01:32 -05:00
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(mbelib
|
2020-11-01 07:01:32 -05:00
|
|
|
GIT_REPOSITORY https://github.com/kasper93/mbelib.git
|
2020-04-30 08:19:19 -04:00
|
|
|
GIT_TAG ${MBELIB_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/mbelib"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS -DDISABLE_TEST=ON ${COMMON_CMAKE_ARGS}
|
2020-11-01 07:01:32 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBMBE_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(mbelib source_dir binary_dir)
|
|
|
|
set(USE_MBELIB ON)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(DSDCC_DEPENDS mbelib)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBMBE_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBMBE_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBMBE_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
2020-11-01 07:01:32 -05:00
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
2020-04-30 08:19:19 -04:00
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBMBE_LIBRARIES "${binary_dir}/libmbe${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libmbe*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}")
|
|
|
|
endif ()
|
|
|
|
endif ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND (NOT LIBMBE_FOUND OR LIBMBE_EXTERNAL))
|
2019-05-23 10:01:06 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL)
|
|
|
|
# Works on MacOS with a dummy serialDV
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(serialdv
|
|
|
|
GIT_REPOSITORY https://github.com/f4exb/serialDV.git
|
|
|
|
GIT_TAG ${SERIALDV_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/serialdv"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS -DBUILD_TOOL=OFF ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${LIBSERIALDV_LIBRARY}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(serialdv source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBSERIALDV_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBSERIALDV_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
makeCopyDir("${source_dir}" "${source_dir}/dsp" serialdv)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/serialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (LINUX)
|
|
|
|
# because sdrbase/dsp/dvserialworker.h use dsp/dvcontroller.h
|
|
|
|
# so we need a link
|
|
|
|
makeLink("${source_dir}" "${source_dir}/dsp" serialdv)
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBSERIALDV_LIBRARY "${binary_dir}/libserialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# because sdrbase/dsp/dvserialworker.h use dsp/dvcontroller.h
|
|
|
|
# so we need a link
|
|
|
|
makeLink("${source_dir}" "${source_dir}/dsp" serialdv)
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libserialdv*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}")
|
|
|
|
endif ()
|
|
|
|
endif (NOT LIBSERIALDV_FOUND OR LIBSERIALDV_EXTERNAL)
|
2019-05-23 10:01:06 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND)
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBDSDCC_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dsdcc.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBDSDCC_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(dsdcc
|
|
|
|
GIT_REPOSITORY https://github.com/f4exb/dsdcc.git
|
|
|
|
GIT_TAG ${DSDCC_TAG}
|
|
|
|
DEPENDS ${DSDCC_DEPENDS}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/dsdcc"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DBUILD_TOOL=OFF -DUSE_MBELIB=${USE_MBELIB}
|
|
|
|
-DLIBMBE_INCLUDE_DIR=${LIBMBE_INCLUDE_DIR}
|
|
|
|
-DLIBMBE_LIBRARY=${LIBMBE_LIBRARIES}
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBDSDCC_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(dsdcc source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBDSDCC_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBDSDCC_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBDSDCC_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/dsdcc/src" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/dsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBDSDCC_LIBRARIES "${binary_dir}/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libdsdcc*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/")
|
|
|
|
endif ()
|
|
|
|
endif ((NOT LIBDSDCC_FOUND OR LIBDSDCC_EXTERNAL) AND LIBMBE_FOUND)
|
2019-05-23 10:01:06 -04:00
|
|
|
|
2023-07-30 12:12:43 -04:00
|
|
|
if (LINUX AND (NOT LIBSIGMF_FOUND OR LIBSIGMF_EXTERNAL))
|
2023-07-31 06:05:31 -04:00
|
|
|
set(LIBSIGMF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/liblibsigmf${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2023-07-30 12:12:43 -04:00
|
|
|
ExternalProject_Add(libsigmf
|
|
|
|
GIT_REPOSITORY https://github.com/f4exb/libsigmf.git
|
|
|
|
GIT_TAG ${LIBSIGMF_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libsigmf"
|
2023-07-30 14:28:44 -04:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
2023-11-29 15:30:39 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBSIGMF_LIBRARIES}"
|
2023-07-30 12:12:43 -04:00
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2023-07-30 13:20:40 -04:00
|
|
|
ExternalProject_Get_Property(libsigmf install_dir)
|
2023-07-30 16:50:25 -04:00
|
|
|
set_global(LIBSIGMF_DEPENDS libsigmf)
|
2023-07-30 12:12:43 -04:00
|
|
|
set_global_cache(LIBSIGMF_FOUND ON)
|
|
|
|
set(LIBSIGMF_EXTERNAL ON CACHE INTERNAL "")
|
2023-07-30 18:07:46 -04:00
|
|
|
set(LIBSIGMF_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")
|
2023-07-30 12:12:43 -04:00
|
|
|
endif (LINUX AND (NOT LIBSIGMF_FOUND OR LIBSIGMF_EXTERNAL))
|
|
|
|
|
2021-02-26 15:25:48 -05:00
|
|
|
# For APT demodulator
|
2023-07-30 11:48:42 -04:00
|
|
|
if(ENABLE_CHANNELRX_DEMODAPT)
|
|
|
|
if (WIN32)
|
|
|
|
set(APT_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/apt.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(APT_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libapt${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
ExternalProject_Add(apt
|
|
|
|
GIT_REPOSITORY https://github.com/srcejon/aptdec.git
|
|
|
|
GIT_TAG libaptdec
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/apt"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${APT_LIBRARIES}"
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(apt source_dir binary_dir)
|
|
|
|
set(APT_DEPENDS apt CACHE INTERNAL "")
|
|
|
|
set_global_cache(APT_FOUND ON)
|
|
|
|
set(APT_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(APT_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/apt/src/apt/src" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/apt${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(APT_LIBRARIES "${binary_dir}/libapt${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libapt*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/")
|
|
|
|
endif ()
|
2021-02-26 15:25:48 -05:00
|
|
|
endif ()
|
|
|
|
|
2023-07-30 11:48:42 -04:00
|
|
|
# For Satellite Tracker feature and APT demod
|
|
|
|
if(ENABLE_FEATURE_SATELLITETRACKER OR ENABLE_CHANNELRX_DEMODAPT)
|
|
|
|
# No tags for this in github - but doesn't change often
|
|
|
|
# Fails to build with CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON on Windows
|
|
|
|
if (WIN32)
|
|
|
|
set(SGP4_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/sgp4s.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
|
|
|
set(SGP4_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libsgp4s${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
ExternalProject_Add(sgp4
|
|
|
|
GIT_REPOSITORY https://github.com/dnwrnr/sgp4.git
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/sgp4"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
|
|
|
|
BUILD_BYPRODUCTS "${SGP4_LIBRARIES}"
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(sgp4 source_dir binary_dir)
|
|
|
|
set(SGP4_DEPENDS sgp4 CACHE INTERNAL "")
|
|
|
|
set_global_cache(SGP4_FOUND ON)
|
|
|
|
set(SGP4_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(SGP4_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/sgp4/src/sgp4/libsgp4" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/sgp4s${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(SGP4_LIBRARIES "${binary_dir}/libsgp4/libsgp4s${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/libsgp4" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libsgp4s*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/libsgp4")
|
|
|
|
endif ()
|
2021-02-26 15:25:48 -05:00
|
|
|
endif ()
|
|
|
|
|
2023-08-13 18:52:57 -04:00
|
|
|
# VkFFT (header only library)
|
|
|
|
ExternalProject_Add(vkfft
|
|
|
|
GIT_REPOSITORY https://github.com/DTolm/VkFFT.git
|
|
|
|
GIT_TAG v1.3.1
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/vkfft"
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
BUILD_BYPRODUCTS ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(vkfft source_dir)
|
2023-08-14 05:37:27 -04:00
|
|
|
set(VKFFT_INCLUDE_DIR "${source_dir}/vkFFT" CACHE INTERNAL "")
|
2023-08-13 18:52:57 -04:00
|
|
|
|
2019-06-24 12:25:53 -04:00
|
|
|
# requirements needed by many packages on windows
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
|
|
|
ExternalProject_Add(pthreads4w
|
|
|
|
GIT_REPOSITORY https://git.code.sf.net/p/pthreads4w/code
|
|
|
|
GIT_TAG ${PTHREADS4W_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/pthreads4w"
|
|
|
|
PATCH_COMMAND ${CMAKE_COMMAND} -E touch "<SOURCE_DIR>/COPYING.LIB"
|
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
BUILD_COMMAND nmake VC
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(pthreads4w source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(PTHREADS4W_DEPENDS pthreads4w)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(PTHREADS4W_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(PTHREADS4W_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(PTHREADS4W_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
|
|
|
|
set(PTHREADS4W_LIBRARIES "${source_dir}/pthreadVC2.lib" CACHE INTERNAL "")
|
|
|
|
makeCopy("${source_dir}/pthreadVC2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/pthreadVC2${CMAKE_SHARED_LIBRARY_SUFFIX}" pthreads4w)
|
|
|
|
# needed by bladerf
|
|
|
|
makeCopy("${source_dir}/pthreadVC2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${source_dir}/dll/x64/pthreadVC2${CMAKE_SHARED_LIBRARY_SUFFIX}" pthreads4w)
|
|
|
|
install(FILES "${source_dir}/pthreadVC2${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
endif (WIN32)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2021-04-16 17:56:15 -04:00
|
|
|
# For DAB demodulator
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ZLIB_FOUND AND FAAD_FOUND AND ENABLE_CHANNELRX_DEMODDAB)
|
2021-04-16 17:56:15 -04:00
|
|
|
if (WIN32)
|
|
|
|
set(DAB_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/dab_lib.lib" CACHE INTERNAL "")
|
|
|
|
elseif (LINUX)
|
2022-01-25 19:00:49 -05:00
|
|
|
set(DAB_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libdab_lib${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2021-04-16 17:56:15 -04:00
|
|
|
endif()
|
2021-04-17 05:06:55 -04:00
|
|
|
if (WIN32)
|
2021-04-23 09:02:40 -04:00
|
|
|
ExternalProject_Add(dab
|
|
|
|
GIT_REPOSITORY https://github.com/srcejon/dab-cmdline.git
|
|
|
|
GIT_TAG msvc
|
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/dab"
|
|
|
|
SOURCE_SUBDIR "library"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DFFTW3F_INCLUDE_DIRS=${FFTW3F_INCLUDE_DIRS}
|
|
|
|
-DFFTW3F_LIBRARIES=${FFTW3F_LIBRARIES}
|
|
|
|
-DFAAD_INCLUDE_DIR=${FAAD_INCLUDE_DIR}
|
|
|
|
-DFAAD_LIBRARY=${FAAD_LIBRARY}
|
|
|
|
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
|
|
|
|
-DZLIB_LIBRARY=${ZLIB_LIBRARIES}
|
|
|
|
-DPTHREADS=${PTHREADS4W_LIBRARIES}
|
|
|
|
BUILD_BYPRODUCTS "${DAB_LIBRARIES}"
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
else(WIN32)
|
|
|
|
ExternalProject_Add(dab
|
|
|
|
GIT_REPOSITORY https://github.com/srcejon/dab-cmdline.git
|
|
|
|
GIT_TAG msvc
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${ZLIB_DEPENDS} ${FAAD_DEPENDS}
|
2021-04-23 09:02:40 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/dab"
|
|
|
|
SOURCE_SUBDIR "library"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DFFTW3F_INCLUDE_DIRS=${FFTW3F_INCLUDE_DIRS}
|
|
|
|
-DFFTW3F_LIBRARIES=${FFTW3F_LIBRARIES}
|
|
|
|
-DFAAD_INCLUDE_DIR=${FAAD_INCLUDE_DIR}
|
|
|
|
-DFAAD_LIBRARY=${FAAD_LIBRARY}
|
|
|
|
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
|
|
|
|
-DZLIB_LIBRARY=${ZLIB_LIBRARIES}
|
|
|
|
BUILD_BYPRODUCTS "${DAB_LIBRARIES}"
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
endif(WIN32)
|
2021-04-16 17:56:15 -04:00
|
|
|
ExternalProject_Get_Property(dab source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(DAB_DEPENDS dab)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(DAB_FOUND ON)
|
2021-04-16 17:56:15 -04:00
|
|
|
set(DAB_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(DAB_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/dab/src/dab" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/dab_lib${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
2021-04-19 14:11:29 -04:00
|
|
|
set(DAB_LIBRARIES "${binary_dir}/libdab_lib${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2021-04-16 17:56:15 -04:00
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libdab_lib*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/")
|
|
|
|
endif ()
|
|
|
|
else()
|
|
|
|
message(STATUS "Can't build DAB library as missing zlib or faad")
|
|
|
|
endif()
|
|
|
|
|
2023-07-30 11:48:42 -04:00
|
|
|
# Device interface libraries.
|
2019-06-01 19:05:33 -04:00
|
|
|
if (LINUX)
|
2019-06-02 17:28:37 -04:00
|
|
|
# apt install liblimesuite-dev (only on ubuntu 18.04). Can be picky on version though so let's build it.
|
|
|
|
# needs pkgconfig and libusb
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_LIMESUITE AND (NOT LIMESUITE_FOUND OR LIMESUITE_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIMESUITE_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIMESUITE_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/limesuite/src/limesuite/src" CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIMESUITE_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libLimeSuite.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(limesuite
|
|
|
|
GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git
|
|
|
|
GIT_TAG ${LIMESUITE_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite"
|
2021-02-05 16:13:11 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DLIME_SUITE_EXTVER=release
|
|
|
|
-DENABLE_GUI=OFF
|
|
|
|
-DENABLE_NOVENARF7=OFF
|
|
|
|
-DENABLE_SOAPY_LMS7=OFF
|
|
|
|
-DENABLE_OCTAVE=OFF
|
|
|
|
-DENABLE_QUICKTEST=OFF
|
|
|
|
-DENABLE_EXAMPLES=OFF
|
|
|
|
-DENABLE_LIME_UTIL=OFF
|
|
|
|
-DENABLE_SIMD_FLAGS=SSE3
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIMESUITE_LIBRARY}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(limesuite source_dir)
|
|
|
|
makeCopyFile("${source_dir}/src/limeRFE/limeRFE.h" "${source_dir}/src/lime/limeRFE.h" limesuite)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-06-02 17:28:37 -04:00
|
|
|
|
|
|
|
# apt install libbladerf-dev
|
|
|
|
# needs pkgconfig and libusb
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_BLADERF AND (NOT LIBBLADERF_FOUND OR LIBBLADERF_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBBLADERF_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBBLADERF_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBBLADERF_INCLUDE_DIRS "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf/host/libraries/libbladeRF/include" CACHE INTERNAL "")
|
|
|
|
set(LIBBLADERF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf-build/output/libbladeRF.so.2" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(bladerf
|
|
|
|
GIT_REPOSITORY https://github.com/Nuand/bladeRF.git
|
|
|
|
GIT_TAG ${BLADERF_TAG}
|
|
|
|
GIT_SUBMODULES
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/bladerf"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
SOURCE_SUBDIR host/
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBBLADERF_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2020-11-01 07:03:13 -05:00
|
|
|
install(FILES "${LIBBLADERF_LIBRARIES}" DESTINATION "${INSTALL_LIB_DIR}")
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-06-02 17:55:59 -04:00
|
|
|
|
|
|
|
# apt install libiio-dev
|
|
|
|
# needs pkgconfig, libusb, libxml2, lzma, xz, libiconv
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_IIO AND (NOT LIBIIO_FOUND OR LIBIIO_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBIIO_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBIIO_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBIIO_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libiio/src/libiio" CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBIIO_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libiio.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(libiio
|
|
|
|
GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git
|
|
|
|
GIT_TAG ${LIBIIO_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio"
|
2021-02-05 16:13:11 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DOSX_PACKAGE=OFF
|
|
|
|
-DWITH_DOC=OFF
|
|
|
|
-DWITH_MATLAB_BINDINGS_API=OFF
|
|
|
|
-DWITH_TESTS=OFF
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBIIO_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-06-02 18:35:06 -04:00
|
|
|
|
|
|
|
# apt install libairspyhf-dev (only on ubuntu 18.04)
|
|
|
|
# needs libusb and pkgconfig
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_AIRSPYHF AND (NOT LIBAIRSPYHF_FOUND OR LIBAIRSPYHF_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBAIRSPYHF_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libairspyhf.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(airspyhf
|
|
|
|
GIT_REPOSITORY https://github.com/airspy/airspyhf.git
|
|
|
|
GIT_TAG ${AIRSPYHF_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${LIBAIRSPYHF_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(airspyhf source_dir)
|
|
|
|
set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/.." CACHE INTERNAL "")
|
|
|
|
makeLink("${source_dir}/libairspyhf/src" "${source_dir}/../libairspyhf" airspyhf)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-06-02 19:30:05 -04:00
|
|
|
|
|
|
|
# needs pkgconfig, libusb, autoconf, automake and libtool
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_PERSEUS AND (NOT LIBPERSEUS_FOUND OR LIBPERSEUS_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBPERSEUS_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBPERSEUS_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBPERSEUS_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/perseus/src/perseus" CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBPERSEUS_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libperseus-sdr.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(perseus
|
|
|
|
GIT_REPOSITORY https://github.com/f4exb/libperseus-sdr.git
|
|
|
|
GIT_TAG ${PERSEUS_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/perseus"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${LIBPERSEUS_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-12-17 16:44:42 -05:00
|
|
|
|
|
|
|
# apt install librtlsdr-dev
|
|
|
|
# needs pkgconfig and libusb
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_RTLSDR AND (NOT LIBRTLSDR_FOUND OR LIBRTLSDR_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBRTLSDR_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBRTLSDR_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBRTLSDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr/src/rtlsdr/include" CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBRTLSDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/librtlsdr.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(rtlsdr
|
|
|
|
GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git
|
|
|
|
GIT_TAG ${RTLSDR_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DDETACH_KERNEL_DRIVER=ON -DINSTALL_UDEV_RULES=${RTLSDR_UDEV}
|
|
|
|
BUILD_BYPRODUCTS "${LIBRTLSDR_LIBRARIES}"
|
2022-07-19 08:35:52 -04:00
|
|
|
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> -- rtlsdr
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2019-06-01 19:05:33 -04:00
|
|
|
|
2019-06-28 22:02:19 -04:00
|
|
|
# needs pkgconfig and libusb
|
2023-07-30 11:48:42 -04:00
|
|
|
if (ENABLE_MIRISDR AND (NOT LIBMIRISDR_FOUND OR LIBMIRISDR_EXTERNAL))
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBMIRISDR_FOUND ON)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBMIRISDR_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBMIRISDR_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr/src/libmirisdr/include" CACHE INTERNAL "")
|
2022-01-25 19:00:49 -05:00
|
|
|
set(LIBMIRISDR_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libmirisdr.so" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(libmirisdr
|
|
|
|
GIT_REPOSITORY https://github.com/f4exb/libmirisdr-4.git
|
|
|
|
GIT_TAG ${MIRISDR_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libmirisdr"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
BUILD_BYPRODUCTS "${LIBMIRISDR_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2023-07-30 11:48:42 -04:00
|
|
|
endif ()
|
2020-10-02 17:45:28 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
endif (LINUX)
|
|
|
|
|
|
|
|
if (WIN32 OR APPLE)
|
|
|
|
if (ENABLE_RTLSDR)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}")
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBRTLSDR_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/rtlsdr.lib" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}/libusb-1.0")
|
|
|
|
endif ()
|
2022-07-21 16:17:43 -04:00
|
|
|
# Disable pkg-config to allow LIBUSB_INCLUDE_DIRS to be used
|
|
|
|
set(DISABLE_PKGCONFIG "-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON")
|
2023-08-25 10:04:57 -04:00
|
|
|
# If we want to use https://github.com/librtlsdr/librtlsdr instead of https://github.com/osmocom/rtl-sdr.git
|
|
|
|
# - Don't use DISABLE_PKGCONFIG
|
|
|
|
# - Use -DLIBUSB_INCLUDE_DIR instead of -DLIBUSB_INCLUDE_DIRS
|
|
|
|
# - Build target is rtl_sdr rather than rtlsdr
|
|
|
|
# - Use tag development otherwise it will not build with MSVC
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(rtlsdr
|
|
|
|
GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git
|
|
|
|
GIT_TAG ${RTLSDR_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DINSTALL_UDEV_RULES=${RTLSDR_UDEV}
|
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
2022-07-19 09:25:02 -04:00
|
|
|
-DLIBUSB_INCLUDE_DIRS=${RTLSDR_LIBUSB_INCLUDE}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
2022-07-19 10:17:09 -04:00
|
|
|
${DISABLE_PKGCONFIG}
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBRTLSDR_LIBRARIES}"
|
2022-07-19 08:35:52 -04:00
|
|
|
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> -- rtlsdr
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(rtlsdr source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBRTLSDR_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBRTLSDR_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBRTLSDR_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/rtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBRTLSDR_LIBRARIES "${binary_dir}/src/librtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/src/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "librtlsdr*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/src/")
|
|
|
|
endif ()
|
|
|
|
endif (ENABLE_RTLSDR)
|
2019-06-28 22:02:19 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_LIMESUITE)
|
|
|
|
# needs pkgconfig, libusb
|
2022-05-16 08:48:29 -04:00
|
|
|
# We have to install this, as makeCopy("${source_dir}/src/limeRFE/limeRFE.h" "${source_dir}/src/lime/limeRFE.h" limesuite)
|
|
|
|
# causes git stash to fail
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(LIMESUITE_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/LimeSuite.lib" CACHE INTERNAL "")
|
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(limesuite
|
2022-12-02 08:34:28 -05:00
|
|
|
GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git
|
|
|
|
GIT_TAG ${LIMESUITE_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite"
|
2022-05-16 08:48:29 -04:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
2020-04-30 08:19:19 -04:00
|
|
|
-DLIME_SUITE_EXTVER=release
|
|
|
|
-DENABLE_GUI=OFF
|
|
|
|
-DENABLE_NOVENARF7=OFF
|
|
|
|
-DENABLE_SOAPY_LMS7=OFF
|
|
|
|
-DENABLE_OCTAVE=OFF
|
|
|
|
-DENABLE_QUICKTEST=OFF
|
|
|
|
-DENABLE_EXAMPLES=OFF
|
2022-05-16 08:48:29 -04:00
|
|
|
-DENABLE_LIME_UTIL=ON
|
2020-04-30 08:19:19 -04:00
|
|
|
-DENABLE_SIMD_FLAGS=SSE3
|
2022-05-16 08:48:29 -04:00
|
|
|
-DENABLE_FX3=ON
|
2020-04-30 08:19:19 -04:00
|
|
|
-DFX3_SDK_PATH=${FX3SDK_DIR}
|
2022-05-16 08:48:29 -04:00
|
|
|
-DLIBUSB_1_LIBRARY=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_1_INCLUDE_DIR=${LIBUSB_INCLUDE_DIR}
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIMESUITE_LIBRARY}"
|
2020-04-30 08:19:19 -04:00
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Get_Property(limesuite source_dir binary_dir install_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIMESUITE_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIMESUITE_EXTERNAL ON CACHE INTERNAL "")
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LIMESUITE_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/LimeSuite${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
makeCopy("${source_dir}/src/limeRFE/limeRFE.h" "${source_dir}/src/lime/limeRFE.h" limesuite)
|
|
|
|
elseif (APPLE)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LIMESUITE_LIBRARY "${install_dir}/lib/libLimeSuite${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${intstall_dir}/lib/" DESTINATION "${INSTALL_LIB_DIR}"
|
2020-04-30 08:19:19 -04:00
|
|
|
FILES_MATCHING PATTERN "libLimeSuite*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib/")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
endif (ENABLE_LIMESUITE)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_SOAPYSDR)
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(SOAPYSDR_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/SoapySDR.lib" CACHE INTERNAL "")
|
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(soapysdr
|
|
|
|
GIT_REPOSITORY https://github.com/pothosware/SoapySDR.git
|
|
|
|
GIT_TAG ${SOAPYSDR_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/soapysdr"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DENABLE_PYTHON=OFF
|
|
|
|
-DENABLE_PYTHON3=OFF
|
|
|
|
-DENABLE_TESTS=OFF
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${SOAPYSDR_LIBRARY}"
|
2020-11-07 20:02:56 -05:00
|
|
|
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> -- SoapySDR
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(soapysdr source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(SOAPYSDR_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(SOAPYSDR_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(SOAPYSDR_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/SoapySDR${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
2020-11-06 08:38:31 -05:00
|
|
|
install(DIRECTORY "${SDRANGEL_BINARY_LIB_DIR}/SoapySDR" DESTINATION "${INSTALL_LIB_DIR}/lib")
|
2020-04-30 08:19:19 -04:00
|
|
|
elseif (APPLE)
|
|
|
|
set(SOAPYSDR_LIBRARY "${binary_dir}/lib/libSoapySDR${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/lib/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libSoapySDR*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/lib/")
|
|
|
|
endif ()
|
|
|
|
endif (ENABLE_SOAPYSDR)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_AIRSPY)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(AIRSPY_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR})
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBAIRSPY_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspy.lib" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
set(AIRSPY_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0)
|
|
|
|
endif ()
|
|
|
|
# needs libusb, pthreads
|
2022-05-16 08:48:29 -04:00
|
|
|
# We need to set CMAKE_INSTALL_NAME_DIR, otherwise path to libs is set to install path of /usr/local/
|
|
|
|
# but as we don't install, macdeployqt will fail to find them
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(airspy
|
|
|
|
GIT_REPOSITORY https://github.com/airspy/airspyone_host
|
|
|
|
GIT_TAG ${AIRSPY_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspy"
|
2020-11-01 07:03:13 -05:00
|
|
|
SOURCE_SUBDIR "libairspy"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_INCLUDE_DIR=${AIRSPY_LIBUSB_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
2022-05-16 08:48:29 -04:00
|
|
|
-DCMAKE_INSTALL_NAME_DIR=<BINARY_DIR>/src
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBAIRSPY_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
if (WIN32)
|
|
|
|
add_dependencies(airspy pthreads4w)
|
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Get_Property(airspy source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBAIRSPY_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBAIRSPY_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBAIRSPY_INCLUDE_DIR "${source_dir}/libairspy/src" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
makeCopyDir("${source_dir}/libairspy/src" "${source_dir}/libairspy/src/libairspy" airspy)
|
2020-11-01 07:03:13 -05:00
|
|
|
makeCopy("${binary_dir}/../airspy-tools/src/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" airspy)
|
2020-04-30 08:19:19 -04:00
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/airspy${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LIBAIRSPY_LIBRARIES "${binary_dir}/src/libairspy${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
makeLink("${source_dir}/libairspy/src" "${source_dir}/libairspy/src/libairspy" airspy)
|
|
|
|
install(DIRECTORY "${binary_dir}/libairspy/src/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libairspy*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/src")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
endif (ENABLE_AIRSPY)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_AIRSPYHF)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(AIRSPYHF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR})
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBAIRSPYHF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/airspyhf.lib" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
set(AIRSPYHF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0)
|
|
|
|
endif ()
|
|
|
|
# needs pkgconfig, libusb, pthreads
|
|
|
|
ExternalProject_Add(airspyhf
|
|
|
|
GIT_REPOSITORY https://github.com/airspy/airspyhf.git
|
|
|
|
GIT_TAG ${AIRSPYHF_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_INCLUDE_DIR=${AIRSPYHF_LIBUSB_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
2022-05-16 08:48:29 -04:00
|
|
|
-DCMAKE_INSTALL_NAME_DIR=<BINARY_DIR>/libairspyhf/src
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBAIRSPYHF_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
if (WIN32)
|
|
|
|
add_dependencies(airspyhf pthreads4w)
|
|
|
|
endif()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Get_Property(airspyhf source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBAIRSPYHF_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBAIRSPYHF_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/libairspyhf/src" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
makeCopyDir("${source_dir}/libairspyhf/src" "${source_dir}/libairspyhf/src/libairspyhf" airspyhf)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/airspyhf${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBAIRSPYHF_LIBRARIES "${binary_dir}/libairspyhf/src/libairspyhf${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
makeLink("${source_dir}/libairspyhf/src" "${source_dir}/libairspyhf/src/libairspyhf" airspyhf)
|
|
|
|
install(DIRECTORY "${binary_dir}/libairspyhf/src/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libairspyhf*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/libairspyhf/src")
|
|
|
|
endif ()
|
|
|
|
endif (ENABLE_AIRSPYHF)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_HACKRF)
|
|
|
|
# needs pkgconfig, libusb, fftw, pthreads
|
|
|
|
if (WIN32)
|
|
|
|
set(HACKRF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/libusb-1.0)
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBHACKRF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/hackrf.lib" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
else ()
|
|
|
|
set(HACKRF_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR})
|
|
|
|
endif ()
|
|
|
|
ExternalProject_Add(hackrf
|
2022-10-05 16:29:44 -04:00
|
|
|
GIT_REPOSITORY https://github.com/greatscottgadgets/hackrf.git
|
2020-04-30 08:19:19 -04:00
|
|
|
GIT_TAG ${HACKRF_TAG}
|
|
|
|
GIT_SUBMODULES ""
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/hackrf"
|
|
|
|
SOURCE_SUBDIR "host/libhackrf"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_INCLUDE_DIR=${HACKRF_LIBUSB_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
|
|
|
-DFFTW_INCLUDES=${FFTW3F_INCLUDE_DIRS}
|
|
|
|
-DFFTW_LIBRARIES=${FFTW3F_LIBRARIES}
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBHACKRF_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
if (WIN32)
|
|
|
|
add_dependencies(hackrf pthreads4w)
|
|
|
|
endif()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Get_Property(hackrf source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBHACKRF_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBHACKRF_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBHACKRF_INCLUDE_DIR "${source_dir}/host/libhackrf" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
# include "libhackrf/hackrf.h"
|
|
|
|
makeCopyDir("${source_dir}/host/libhackrf/src" "${source_dir}/host/libhackrf/libhackrf" hackrf)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/hackrf${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBHACKRF_LIBRARIES "${binary_dir}/src/libhackrf${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
# include "libhackrf/hackrf.h"
|
|
|
|
makeLink("${source_dir}/host/libhackrf/src" "${source_dir}/host/libhackrf/libhackrf" hackrf)
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/")
|
|
|
|
install(DIRECTORY "${binary_dir}/src/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libhackrf*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
endif ()
|
|
|
|
endif (ENABLE_HACKRF)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_IIO)
|
|
|
|
if (WIN32)
|
|
|
|
ExternalProject_Add(libxml2
|
|
|
|
GIT_REPOSITORY https://github.com/GNOME/libxml2.git
|
|
|
|
GIT_TAG ${LIBXML2_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libxml2"
|
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
CONFIGURE_COMMAND cd <SOURCE_DIR>/win32 && cscript configure.js compiler=msvc iconv=no
|
|
|
|
BUILD_COMMAND cd <SOURCE_DIR>/win32 && nmake -f Makefile.msvc
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
elseif (APPLE)
|
|
|
|
ExternalProject_Add(libxml2
|
|
|
|
GIT_REPOSITORY https://github.com/GNOME/libxml2.git
|
|
|
|
GIT_TAG ${LIBXML2_TAG}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libxml2"
|
2023-04-18 04:03:05 -04:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
-DBUILD_SHARED_LIBS=OFF
|
|
|
|
-DLIBXML2_WITH_ICONV=OFF
|
|
|
|
-DLIBXML2_WITH_LZMA=OFF
|
|
|
|
-DLIBXML2_WITH_PYTHON=OFF
|
|
|
|
-DLIBXML2_WITH_ZLIB=OFF
|
2020-04-30 08:19:19 -04:00
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
ExternalProject_Get_Property(libxml2 source_dir binary_dir)
|
2022-05-27 05:36:02 -04:00
|
|
|
set_global(LIBXML2_DEPENDS libxml2)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBXML2_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBXML2_EXTERNAL ON CACHE INTERNAL "")
|
2023-04-18 04:03:05 -04:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBXML2_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "")
|
|
|
|
else ()
|
|
|
|
set(LIBXML2_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libxml2/include/libxml2" CACHE INTERNAL "")
|
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBXML2_LIBRARIES "${source_dir}/win32/bin.msvc/libxml2.lib" CACHE INTERNAL "")
|
2020-11-01 07:03:13 -05:00
|
|
|
set(LIBIIO_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/libiio.lib" CACHE INTERNAL "")
|
2020-04-30 08:19:19 -04:00
|
|
|
makeCopy("${source_dir}/win32/bin.msvc/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${SDRANGEL_BINARY_BIN_DIR}/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" libxml2)
|
|
|
|
install(FILES "${source_dir}/win32/bin.msvc/libxml2${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
2023-04-18 05:44:06 -04:00
|
|
|
else ()
|
|
|
|
set(LIBXML2_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/libxml2/lib/libxml2.a" CACHE INTERNAL "")
|
2023-04-18 04:03:05 -04:00
|
|
|
endif ()
|
|
|
|
if (WIN32)
|
|
|
|
set(IIO_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR})
|
|
|
|
else ()
|
|
|
|
set(IIO_LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR}/..)
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
# needs pkgconfig, libusb, pthreads, libxml2
|
|
|
|
ExternalProject_Add(libiio
|
|
|
|
GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git
|
|
|
|
GIT_TAG ${LIBIIO_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBXML2_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio"
|
2020-11-01 07:03:13 -05:00
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
2023-04-18 04:03:05 -04:00
|
|
|
-DLIBUSB_INCLUDE_DIR=${IIO_LIBUSB_INCLUDE_DIR}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
|
|
|
-DLIBXML2_INCLUDE_DIR=${LIBXML2_INCLUDE_DIR}
|
|
|
|
-DLIBXML2_LIBRARIES=${LIBXML2_LIBRARIES}
|
|
|
|
-DCSHARP_BINDINGS=OFF
|
|
|
|
-DPYTHON_BINDINGS=OFF
|
|
|
|
-DOSX_PACKAGE=OFF
|
2021-02-05 16:13:11 -05:00
|
|
|
-DWITH_DOC=OFF
|
|
|
|
-DWITH_MATLAB_BINDINGS_API=OFF
|
|
|
|
-DWITH_TESTS=OFF
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBIIO_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
if (WIN32)
|
|
|
|
add_dependencies(libiio pthreads4w)
|
|
|
|
endif()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Get_Property(libiio source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBIIO_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBIIO_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBIIO_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(LIBIIO_LIBRARIES "${binary_dir}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/" DESTINATION "${INSTALL_LIB_DIR}"
|
|
|
|
FILES_MATCHING PATTERN "libiio*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2023-04-18 04:03:05 -04:00
|
|
|
makeCopy("${binary_dir}/iio.framework/iio" "${binary_dir}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" libiio)
|
2020-04-30 08:19:19 -04:00
|
|
|
add_custom_command(TARGET libiio POST_BUILD COMMAND install_name_tool -id "${binary_dir}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" "${binary_dir}/libiio${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}")
|
|
|
|
endif ()
|
|
|
|
endif (ENABLE_IIO)
|
2019-06-24 12:25:53 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
if (ENABLE_BLADERF)
|
|
|
|
# needs pkgconfig, libusb, pthreads
|
2020-11-01 07:03:13 -05:00
|
|
|
if (WIN32)
|
|
|
|
set(LIBBLADERF_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/bladeRF.lib" CACHE INTERNAL "")
|
2022-05-18 03:49:27 -04:00
|
|
|
set(LIBBLADERF_LIBUSB_HEADER_FILE ${LIBUSB_INCLUDE_DIR}/libusb-1.0/libusb.h)
|
|
|
|
else ()
|
|
|
|
set(LIBBLADERF_LIBUSB_HEADER_FILE ${LIBUSB_INCLUDE_DIR}/libusb.h)
|
2020-11-01 07:03:13 -05:00
|
|
|
endif ()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Add(bladerf
|
|
|
|
GIT_REPOSITORY https://github.com/Nuand/bladeRF.git
|
|
|
|
GIT_TAG ${BLADERF_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${PTHREADS4W_DEPENDS} ${LIBUSB_DEPENDS}
|
2020-04-30 08:19:19 -04:00
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/bladerf"
|
2020-11-01 07:03:13 -05:00
|
|
|
SOURCE_SUBDIR "host"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
2020-04-30 08:19:19 -04:00
|
|
|
-DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE}
|
|
|
|
-DENABLE_BACKEND_USB=ON
|
|
|
|
-DENABLE_BACKEND_LIBUSB=ON
|
2022-05-18 03:49:27 -04:00
|
|
|
-DLIBUSB_HEADER_FILE=${LIBBLADERF_LIBUSB_HEADER_FILE}
|
2020-04-30 08:19:19 -04:00
|
|
|
-Dusb_LIBRARY=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_PATH=${EXTERNAL_LIBRARY_FOLDER}/libusb
|
|
|
|
-DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES}
|
|
|
|
-DLIBPTHREADSWIN32_PATH=${PTHREADS4W_INCLUDE_DIR}
|
|
|
|
-DENABLE_FX3_BUILD=OFF
|
|
|
|
-DENABLE_HOST_BUILD=ON
|
|
|
|
-DENABLE_BACKEND_CYAPI=OFF
|
|
|
|
-DTREAT_WARNINGS_AS_ERRORS=OFF
|
2020-11-01 07:03:13 -05:00
|
|
|
BUILD_BYPRODUCTS "${LIBBLADERF_LIBRARIES}"
|
2020-04-30 08:19:19 -04:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
2022-05-16 08:48:29 -04:00
|
|
|
if (WIN32)
|
|
|
|
add_dependencies(bladerf pthreads4w)
|
|
|
|
endif()
|
2020-04-30 08:19:19 -04:00
|
|
|
ExternalProject_Get_Property(bladerf source_dir binary_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(LIBBLADERF_FOUND ON)
|
2020-04-30 08:19:19 -04:00
|
|
|
set(LIBBLADERF_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(LIBBLADERF_INCLUDE_DIRS "${source_dir}/host/libraries/libbladeRF/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/bladeRF${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(LIBBLADERF_LIBRARIES "${binary_dir}/output/libbladeRF${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
install(DIRECTORY "${binary_dir}/output/" DESTINATION "${INSTALL_LIB_DIR}"
|
2020-04-30 08:19:19 -04:00
|
|
|
FILES_MATCHING PATTERN "libbladeRF*${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
2022-05-16 08:48:29 -04:00
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/output")
|
2020-04-30 08:19:19 -04:00
|
|
|
endif ()
|
|
|
|
endif (ENABLE_BLADERF)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2023-09-23 10:54:53 -04:00
|
|
|
if (ENABLE_USRP AND Boost_FOUND AND NOT WIN32 AND ((NOT UHD_FOUND) OR (ENABLE_EXTERNAL_LIBRARIES STREQUAL "ON")))
|
2023-10-30 06:12:07 -04:00
|
|
|
if (DEFINED PYTHON_EXECUTABLE)
|
|
|
|
set(UHD_PYTHON_ARGS "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
|
|
|
|
else ()
|
|
|
|
set(UHD_PYTHON_ARGS "")
|
|
|
|
endif ()
|
2022-05-16 08:48:29 -04:00
|
|
|
ExternalProject_Add(uhd
|
|
|
|
GIT_REPOSITORY https://github.com/EttusResearch/uhd.git
|
2023-12-01 07:03:37 -05:00
|
|
|
GIT_TAG ${UHD_TAG}
|
2022-05-16 08:48:29 -04:00
|
|
|
DEPENDS ${LIBUSB_DEPENDS} ${Boost_DEPENDS}
|
|
|
|
PREFIX "${EXTERNAL_BUILD_LIBRARIES}/uhd"
|
|
|
|
SOURCE_SUBDIR "host"
|
|
|
|
CMAKE_ARGS ${COMMON_CMAKE_ARGS}
|
|
|
|
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
|
|
|
-DBoost_INCLUDE_DIR=${Boost_INCLUDE_DIR}
|
|
|
|
-DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES}
|
|
|
|
-DLIBUSB_INCLUDE_DIR=${LIBUSB_INCLUDE_DIR}
|
2023-10-30 06:12:07 -04:00
|
|
|
${UHD_PYTHON_ARGS}
|
2022-05-16 08:48:29 -04:00
|
|
|
-DCMAKE_INSTALL_NAME_DIR=<INSTALL_DIR>/lib
|
|
|
|
TEST_COMMAND ""
|
|
|
|
)
|
|
|
|
ExternalProject_Get_Property(uhd install_dir)
|
2023-07-30 10:45:11 -04:00
|
|
|
set_global_cache(UHD_FOUND ON)
|
2022-05-16 08:48:29 -04:00
|
|
|
set(UHD_EXTERNAL ON CACHE INTERNAL "")
|
|
|
|
set(UHD_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")
|
|
|
|
if (WIN32)
|
|
|
|
install(FILES "${SDRANGEL_BINARY_BIN_DIR}/uhd${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}")
|
|
|
|
elseif (APPLE)
|
|
|
|
set(UHD_LIBRARIES "${install_dir}/lib/libuhd${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "")
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib")
|
|
|
|
endif ()
|
2023-09-23 10:54:53 -04:00
|
|
|
endif (ENABLE_USRP AND Boost_FOUND AND NOT WIN32 AND ((NOT UHD_FOUND) OR (ENABLE_EXTERNAL_LIBRARIES STREQUAL "ON")))
|
2022-05-16 08:48:29 -04:00
|
|
|
|
2020-04-30 08:19:19 -04:00
|
|
|
endif (WIN32 OR APPLE)
|
2022-05-16 08:48:29 -04:00
|
|
|
|
|
|
|
# Set CACHE so variable is visible in cpack CMakeFile
|
|
|
|
set(MACOS_EXTERNAL_LIBS_FIXUP ${MACOS_EXTERNAL_LIBS_FIXUP} CACHE INTERNAL "")
|