From 9a849a9bbbf2e285f13c052f1f7cd9bfc3bccca4 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 12 Oct 2019 05:39:41 +0200 Subject: [PATCH] MacOS compatibility with serialDV --- external/CMakeLists.txt | 61 ++++++++++++++++++++--------------------- sdrgui/mainwindow.cpp | 2 ++ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 3fc002387..b8a040ade 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -209,37 +209,36 @@ elseif(APPLE) set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}") endif() -if(WIN32 OR LINUX) - ExternalProject_Add(serialdv - GIT_REPOSITORY https://github.com/f4exb/serialDV.git - GIT_TAG ${SERIALDV_TAG} - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/serialdv" - CMAKE_ARGS -DBUILD_TOOL=OFF ${DEFAULT_OUTPUT_DIRECTORIES} - INSTALL_COMMAND "" - TEST_COMMAND "" - ) - ExternalProject_Get_Property(serialdv source_dir binary_dir) - set(DSDCC_DEPENDS ${DSDCC_DEPENDS} serialdv) - set(LIBSERIALDV_FOUND ON CACHE INTERNAL "") - set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "") - if(WIN32) - set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "") - makeCopyDir("${source_dir}" "${source_dir}/dsp" serialdv) - install(FILES "${SDRANGEL_BINARY_BIN_DIR}/serialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") - elseif(LINUX) - set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/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) - 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() +# Works on MacOS with a dummy serialDV +ExternalProject_Add(serialdv + GIT_REPOSITORY https://github.com/f4exb/serialDV.git + GIT_TAG ${SERIALDV_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/serialdv" + CMAKE_ARGS -DBUILD_TOOL=OFF ${DEFAULT_OUTPUT_DIRECTORIES} + INSTALL_COMMAND "" + TEST_COMMAND "" +) +ExternalProject_Get_Property(serialdv source_dir binary_dir) +set(DSDCC_DEPENDS ${DSDCC_DEPENDS} serialdv) +set(LIBSERIALDV_FOUND ON CACHE INTERNAL "") +set(LIBSERIALDV_INCLUDE_DIR "${source_dir}" CACHE INTERNAL "") +if(WIN32) + set(LIBSERIALDV_LIBRARY "${SDRANGEL_BINARY_LIB_DIR}/serialdv.lib" CACHE INTERNAL "") + makeCopyDir("${source_dir}" "${source_dir}/dsp" serialdv) + install(FILES "${SDRANGEL_BINARY_BIN_DIR}/serialdv${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") +elseif(LINUX) + set(LIBSERIALDV_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/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) +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() ExternalProject_Add(dsdcc diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index e355621d6..657e7e310 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1671,8 +1671,10 @@ void MainWindow::on_action_DeviceUserArguments_triggered() void MainWindow::on_action_AMBE_triggered() { qDebug("MainWindow::on_action_AMBE_triggered"); +#ifndef __APPLE__ AMBEDevicesDialog ambeDevicesDialog(m_dspEngine->getAMBEEngine(), this); ambeDevicesDialog.exec(); +#endif } void MainWindow::sampleSourceChanged()