Final work on MacOS compatibility

This commit is contained in:
Alexandre 2021-11-15 20:33:09 -06:00
parent 49cf6944f0
commit b81d0c47cf
13 changed files with 224 additions and 35 deletions

View File

@ -91,7 +91,7 @@ jobs:
- name: Prepare CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DUSE_DOTAPP_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{runner.workspace}}/build
@ -99,13 +99,13 @@ jobs:
- name: Create Archive
working-directory: ${{runner.workspace}}
run: sh $GITHUB_WORKSPACE/make_macos_package.sh ${{runner.workspace}}/build
run: sh $GITHUB_WORKSPACE/make_macos_dotapp.sh ${{runner.workspace}}/build ./SDR++.app && zip -r sdrpp_macos_intel.zip SDR++.app
- name: Save Archive
uses: actions/upload-artifact@v2
with:
name: sdrpp_macos_amd64
path: ${{runner.workspace}}/sdrpp_macos_amd64.pkg
name: sdrpp_macos_intel
path: ${{runner.workspace}}/sdrpp_macos_intel.zip
build_debian_buster:
runs-on: ubuntu-latest
@ -295,7 +295,7 @@ jobs:
run: >
mkdir sdrpp_all &&
mv sdrpp_windows_x64/sdrpp_windows_x64.zip sdrpp_all/ &&
mv sdrpp_macos_amd64/sdrpp_macos_amd64.pkg sdrpp_all/ &&
mv sdrpp_macos_intel/sdrpp_macos_intel.zip sdrpp_all/ &&
mv sdrpp_debian_buster_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_buster_amd64.deb &&
mv sdrpp_debian_bullseye_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_bullseye_amd64.deb &&
mv sdrpp_debian_sid_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_debian_sid_amd64.deb &&

3
.gitignore vendored
View File

@ -12,4 +12,5 @@ root_dev/
Folder.DotSettings.user
CMakeSettings.json
poggers_decoder
m17_decoder/libcorrect
m17_decoder/libcorrect
SDR++.app

View File

@ -49,6 +49,7 @@ option(OPT_BUILD_SCHEDULER "Build the scheduler" OFF)
# Other options
option(USE_INTERNAL_LIBCORRECT "Use an external version of libcorrect" ON)
option(USE_DOTAPP_DEFAULTS "Set the default resource and module directories to the right ones for a MacOS .app" ON)
# Core of SDR++
add_subdirectory("core")

View File

@ -5,6 +5,10 @@ if (USE_INTERNAL_LIBCORRECT)
add_subdirectory("libcorrect/")
endif (USE_INTERNAL_LIBCORRECT)
if (USE_DOTAPP_DEFAULTS)
add_definitions(-DMACOS_DOTAPP)
endif (USE_DOTAPP_DEFAULTS)
# Main code
file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c")
@ -25,7 +29,6 @@ else ()
target_compile_options(sdrpp_core PRIVATE -O3 -std=c++17)
endif ()
# Set the install prefix
target_compile_definitions(sdrpp_core PUBLIC INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")

View File

@ -102,6 +102,12 @@ static void maximized_callback(GLFWwindow* window, int n) {
int sdrpp_main(int argc, char *argv[]) {
spdlog::info("SDR++ v" VERSION_STR);
#ifdef MACOS_DOTAPP
// If this is a MacOS .app, CD to the correct directory
auto execPath = std::filesystem::absolute(argv[0]);
chdir(execPath.parent_path().string().c_str());
#endif
// Load default options and parse command line
options::loadDefaults();
if (!options::parse(argc, argv)) { return -1; }
@ -239,9 +245,12 @@ int sdrpp_main(int argc, char *argv[]) {
defConfig["vfoColors"]["Radio"] = "#FFFFFF";
#ifdef _WIN32
#if defined(_WIN32)
defConfig["modulesDirectory"] = "./modules";
defConfig["resourcesDirectory"] = "./res";
#elif defined(MACOS_DOTAPP)
defConfig["modulesDirectory"] = "../Plugins";
defConfig["resourcesDirectory"] = "../Resources";
#else
defConfig["modulesDirectory"] = INSTALL_PREFIX "/lib/sdrpp/plugins";
defConfig["resourcesDirectory"] = INSTALL_PREFIX "/share/sdrpp";

View File

@ -6,9 +6,12 @@ namespace options {
CMDLineOptions opts;
void loadDefaults() {
#ifdef _WIN32
#if defined(_WIN32)
opts.root = ".";
opts.showConsole = false;
#elif defined(MACOS_DOTAPP)
std::string homedir = getenv("HOME");
opts.root = homedir + "/Library/Application Support/sdrpp";
#else
std::string homedir = getenv("HOME");
opts.root = homedir + "/.config/sdrpp";

View File

@ -14,6 +14,38 @@ mkdir $DOTAPP/Contents
mkdir $DOTAPP/Contents/MacOS
mkdir $DOTAPP/Contents/Frameworks
mkdir $DOTAPP/Contents/Resources
mkdir $DOTAPP/Contents/Plugins
# ========================= Boilerplate =========================
delete_common_rpath() {
# TODO: Also remove build/core if present
sh macos/delete_rpath.sh /usr/local/lib $1
sh macos/delete_rpath.sh glew $1
sh macos/delete_rpath.sh fftw $1
sh macos/delete_rpath.sh glfw $1
}
set_common_rpath() {
sh macos/set_library_path.sh libGLEW @rpath/libGLEW.dylib $1
sh macos/set_library_path.sh libfftw3f @rpath/libfftw3f.dylib $1
sh macos/set_library_path.sh libglfw @rpath/libglfw.dylib $1
sh macos/set_library_path.sh libvolk @rpath/libvolk.dylib $1
install_name_tool -add_rpath @loader_path/../Frameworks $1
}
update_common_rpath() {
delete_common_rpath $1
set_common_rpath $1
}
install_module() {
if [ -f $1 ]; then
BNAME=$(basename $1)
cp $1 $DOTAPP/Contents/Plugins/
update_common_rpath $DOTAPP/Contents/Plugins/$BNAME
fi
}
# ========================= CORE =========================
@ -24,37 +56,168 @@ cp $BUILD_DIR/core/libsdrpp_core.dylib $DOTAPP/Contents/Frameworks/
# Get dep paths
LIBGLEW_PATH=$(sh macos/get_library_path.sh libGLEW $DOTAPP/Contents/MacOS/sdrpp)
LIBFFTW3F_PATH=$(sh macos/get_library_path.sh libfftw3f $DOTAPP/Contents/MacOS/sdrpp)
LIBGCC_PATH=$(sh macos/get_library_path.sh libgcc $LIBFFTW3F_PATH)
LIBGLFW_PATH=$(sh macos/get_library_path.sh libglfw $DOTAPP/Contents/MacOS/sdrpp)
LIBVOLK_PATH=$(sh macos/get_library_path.sh libvolk $DOTAPP/Contents/MacOS/sdrpp)
# Modify path for sdrpp
sh macos/set_library_path.sh libGLEW @rpath/libGLEW.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libfftw3f @rpath/libfftw3f.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libglfw @rpath/libglfw.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libvolk @rpath/libvolk.dylib $DOTAPP/Contents/MacOS/sdrpp
# Copy libfftw3f in advance
cp $LIBFFTW3F_PATH $DOTAPP/Contents/Frameworks/libfftw3f.dylib
cp $LIBGCC_PATH $DOTAPP/Contents/Frameworks/libgcc.dylib
# Modify path for libsdrpp_core
sh macos/set_library_path.sh libGLEW @rpath/libGLEW.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libfftw3f @rpath/libfftw3f.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libglfw @rpath/libglfw.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libvolk @rpath/libvolk.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
# Delete old RPATH for sdrpp
sh macos/delete_rpath.sh glew $DOTAPP/Contents/MacOS/sdrpp
sh macos/delete_rpath.sh fftw $DOTAPP/Contents/MacOS/sdrpp
sh macos/delete_rpath.sh glfw $DOTAPP/Contents/MacOS/sdrpp
# Udpate old RPATH for sdrpp
update_common_rpath $DOTAPP/Contents/MacOS/sdrpp
sh macos/delete_rpath.sh build/core $DOTAPP/Contents/MacOS/sdrpp
# Delete old RPATH for libsdrpp_core
sh macos/delete_rpath.sh glew $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/delete_rpath.sh fftw $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/delete_rpath.sh glfw $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
# Udpate old RPATH for libsdrpp_core
update_common_rpath $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
# Remove libfftw3f signature
codesign --remove-signature $DOTAPP/Contents/Frameworks/libfftw3f.dylib
# Udpate old RPATH for libfftw3f and set new one (do it twice since it has two rpaths for some reason)
sh macos/delete_rpath.sh gcc $DOTAPP/Contents/Frameworks/libfftw3f.dylib
sh macos/delete_rpath.sh gcc $DOTAPP/Contents/Frameworks/libfftw3f.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/libfftw3f.dylib
sh macos/set_library_path.sh libgcc @rpath/libgcc.dylib $DOTAPP/Contents/Frameworks/libfftw3f.dylib
# Add back libfftw3f's signature
codesign -s - $DOTAPP/Contents/Frameworks/libfftw3f.dylib
# Copy deps
cp $LIBGLEW_PATH $DOTAPP/Contents/Frameworks/libGLEW.dylib
cp $LIBFFTW3F_PATH $DOTAPP/Contents/Frameworks/libfftw3f.dylib
cp $LIBGLFW_PATH $DOTAPP/Contents/Frameworks/libglfw.dylib
cp $LIBVOLK_PATH $DOTAPP/Contents/Frameworks/libvolk.dylib
# ========================= Resources =========================
cp -R root/res/* $DOTAPP/Contents/Resources/
# ========================= CORE =========================
# ========================= Icon =========================
mkdir $DOTAPP/Contents/Resources/sdrpp.iconset
sips -z 16 16 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_16x16.png
sips -z 32 32 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_16x16@2x.png
sips -z 32 32 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_32x32.png
sips -z 64 64 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_32x32@2x.png
sips -z 128 128 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_128x128.png
sips -z 256 256 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_128x128@2x.png
sips -z 256 256 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_256x256.png
sips -z 512 512 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_256x256@2x.png
sips -z 512 512 root/res/icons/sdrpp.png --out $DOTAPP/Contents/Resources/sdrpp.iconset/icon_512x512.png
iconutil -c icns $DOTAPP/Contents/Resources/sdrpp.iconset
rm -R $DOTAPP/Contents/Resources/sdrpp.iconset
# ========================= Source Modules =========================
install_module $BUILD_DIR/source_modules/airspy_source/airspy_source.dylib
LIBAIRSPY_PATH=$(sh macos/get_library_path.sh libairspy $BUILD_DIR/source_modules/airspy_source/airspy_source.dylib)
LIBUSB_PATH=$(sh macos/get_library_path.sh libusb $LIBAIRSPY_PATH)
cp $LIBAIRSPY_PATH $DOTAPP/Contents/Frameworks/libairspy.dylib
cp $LIBUSB_PATH $DOTAPP/Contents/Frameworks/libusb.dylib
sh macos/delete_rpath.sh /airspy/ $DOTAPP/Contents/Plugins/airspy_source.dylib
# sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/libairspy.dylib # NOT NEEDED????
sh macos/set_library_path.sh libairspy @rpath/libairspy.dylib $DOTAPP/Contents/Plugins/airspy_source.dylib
sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/libairspy.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/libairspy.dylib
codesign --remove-signature $DOTAPP/Contents/Frameworks/libairspy.dylib
codesign -s - $DOTAPP/Contents/Frameworks/libairspy.dylib
install_module $BUILD_DIR/source_modules/airspyhf_source/airspyhf_source.dylib
LIBAIRSPYHF_PATH=$(sh macos/get_library_path.sh libairspyhf $BUILD_DIR/source_modules/airspyhf_source/airspyhf_source.dylib)
cp $LIBAIRSPYHF_PATH $DOTAPP/Contents/Frameworks/libairspyhf.dylib
sh macos/delete_rpath.sh /airspyhf/ $DOTAPP/Contents/Plugins/airspyhf_source.dylib
# sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/libairspyhf.dylib # NOT NEEDED????
sh macos/set_library_path.sh libairspy @rpath/libairspyhf.dylib $DOTAPP/Contents/Plugins/airspyhf_source.dylib
sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/libairspyhf.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/libairspyhf.dylib
codesign --remove-signature $DOTAPP/Contents/Frameworks/libairspyhf.dylib
codesign -s - $DOTAPP/Contents/Frameworks/libairspyhf.dylib
install_module $BUILD_DIR/source_modules/bladerf_source/bladerf_source.dylib
LIBBLADERF_PATH=$(sh macos/get_library_path.sh libbladeRF $BUILD_DIR/source_modules/bladerf_source/bladerf_source.dylib)
cp $LIBBLADERF_PATH $DOTAPP/Contents/Frameworks/libbladeRF.dylib
sh macos/delete_rpath.sh libbladerf $DOTAPP/Contents/Plugins/bladerf_source.dylib
# sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/libbladeRF.dylib # NOT NEEDED????
sh macos/set_library_path.sh libbladeRF @rpath/libbladeRF.dylib $DOTAPP/Contents/Plugins/bladerf_source.dylib
sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/libbladeRF.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/libbladeRF.dylib
codesign --remove-signature $DOTAPP/Contents/Frameworks/libbladeRF.dylib
codesign -s - $DOTAPP/Contents/Frameworks/libbladeRF.dylib
install_module $BUILD_DIR/source_modules/file_source/file_source.dylib
install_module $BUILD_DIR/source_modules/hackrf_source/hackrf_source.dylib
LIBHACKRF_PATH=$(sh macos/get_library_path.sh libhackrf $BUILD_DIR/source_modules/hackrf_source/hackrf_source.dylib)
cp $LIBHACKRF_PATH $DOTAPP/Contents/Frameworks/libhackrf.dylib
sh macos/delete_rpath.sh /hackrf/ $DOTAPP/Contents/Plugins/hackrf_source.dylib
# sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/libhackrf.dylib # NOT NEEDED????
sh macos/set_library_path.sh libhackrf @rpath/libhackrf.dylib $DOTAPP/Contents/Plugins/hackrf_source.dylib
sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/libhackrf.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/libhackrf.dylib
codesign --remove-signature $DOTAPP/Contents/Frameworks/libhackrf.dylib
codesign -s - $DOTAPP/Contents/Frameworks/libhackrf.dylib
install_module $BUILD_DIR/source_modules/rtl_sdr_source/rtl_sdr_source.dylib
LIBRTLSDR_PATH=$(sh macos/get_library_path.sh librtlsdr $BUILD_DIR/source_modules/rtl_sdr_source/rtl_sdr_source.dylib)
cp $LIBRTLSDR_PATH $DOTAPP/Contents/Frameworks/librtlsdr.dylib
sh macos/delete_rpath.sh librtlsdr $DOTAPP/Contents/Plugins/rtl_sdr_source.dylib
# sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/librtlsdr.dylib # NOT NEEDED????
sh macos/set_library_path.sh librtlsdr @rpath/librtlsdr.dylib $DOTAPP/Contents/Plugins/rtl_sdr_source.dylib
sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/librtlsdr.dylib
install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/librtlsdr.dylib
codesign --remove-signature $DOTAPP/Contents/Frameworks/librtlsdr.dylib
codesign -s - $DOTAPP/Contents/Frameworks/librtlsdr.dylib
install_module $BUILD_DIR/source_modules/rtl_tcp_source/rtl_tcp_source.dylib
install_module $BUILD_DIR/source_modules/sdrplay_source/sdrplay_source.dylib
install_module $BUILD_DIR/source_modules/spyserver_source/spyserver_source.dylib
# ========================= Sink Modules =========================
install_module $BUILD_DIR/sink_modules/network_sink/network_sink.dylib
install_module $BUILD_DIR/sink_modules/portaudio_sink/audio_sink.dylib
LIBPORTAUDIO_PATH=$(sh macos/get_library_path.sh libportaudio $BUILD_DIR/sink_modules/portaudio_sink/audio_sink.dylib)
cp $LIBPORTAUDIO_PATH $DOTAPP/Contents/Frameworks/libportaudio.dylib
sh macos/delete_rpath.sh /portaudio/ $DOTAPP/Contents/Plugins/audio_sink.dylib
sh macos/set_library_path.sh libportaudio @rpath/libportaudio.dylib $DOTAPP/Contents/Plugins/audio_sink.dylib
install_module $BUILD_DIR/sink_modules/new_portaudio_sink/new_portaudio_sink.dylib
sh macos/delete_rpath.sh /portaudio/ $DOTAPP/Contents/Plugins/new_portaudio_sink.dylib
sh macos/set_library_path.sh libportaudio @rpath/libportaudio.dylib $DOTAPP/Contents/Plugins/new_portaudio_sink.dylib
# ========================= Decoder Modules =========================
install_module $BUILD_DIR/decoder_modules/m17_decoder/m17_decoder.dylib
install_module $BUILD_DIR/decoder_modules/meteor_demodulator/meteor_demodulator.dylib
install_module $BUILD_DIR/decoder_modules/radio/radio.dylib
# ========================= Misc Modules =========================
install_module $BUILD_DIR/misc_modules/discord_integration/discord_integration.dylib
install_module $BUILD_DIR/misc_modules/frequency_manager/frequency_manager.dylib
install_module $BUILD_DIR/misc_modules/recorder/recorder.dylib
install_module $BUILD_DIR/misc_modules/rigctl_server/rigctl_server.dylib
# ========================= Create PList =========================
echo '<?xml version="1.0" encoding="UTF-8"?>' >> $DOTAPP/Contents/Info.plist
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> $DOTAPP/Contents/Info.plist
echo '' >> $DOTAPP/Contents/Info.plist
echo '<plist version="1.0">' >> $DOTAPP/Contents/Info.plist
echo ' <dict>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleName</key><string>sdrpp</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleDisplayName</key><string>SDR++</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleIdentifier</key><string>org.sdrpp.sdrpp</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleVersion</key><string>1.0.5</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundlePackageType</key><string>APPL</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleSignature</key><string>sdrp</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleExecutable</key><string>sdrpp</string>' >> $DOTAPP/Contents/Info.plist
echo ' <key>CFBundleIconFile</key><string>sdrpp</string>' >> $DOTAPP/Contents/Info.plist
echo ' </dict>' >> $DOTAPP/Contents/Info.plist
echo '</plist>' >> $DOTAPP/Contents/Info.plist

View File

@ -21,6 +21,8 @@ if (MSVC)
# Lib path
target_link_directories(airspy_source PRIVATE "C:/Program Files/PothosSDR/bin/")
target_include_directories(airspyhf_source PUBLIC "C:/Program Files/PothosSDR/include/libairspy/")
target_link_libraries(airspy_source PRIVATE airspy)
else (MSVC)
find_package(PkgConfig)

View File

@ -7,7 +7,7 @@
#include <gui/style.h>
#include <config.h>
#include <options.h>
#include <libairspy/airspy.h>
#include <airspy.h>
#define CONCAT(a, b) ((std::string(a) + b).c_str())

View File

@ -21,6 +21,8 @@ if (MSVC)
# Lib path
target_link_directories(airspyhf_source PRIVATE "C:/Program Files/PothosSDR/bin/")
target_include_directories(airspyhf_source PUBLIC "C:/Program Files/PothosSDR/include/libairspyhf/")
target_link_libraries(airspyhf_source PRIVATE airspyhf)
else (MSVC)
find_package(PkgConfig)

View File

@ -7,7 +7,7 @@
#include <gui/style.h>
#include <config.h>
#include <options.h>
#include <libairspyhf/airspyhf.h>
#include <airspyhf.h>
#include <gui/widgets/stepped_slider.h>
#define CONCAT(a, b) ((std::string(a) + b).c_str())

View File

@ -23,8 +23,13 @@ if (MSVC)
target_link_libraries(bladerf_source PRIVATE bladeRF)
else (MSVC)
# Not in pkg-config
target_link_libraries(bladerf_source PRIVATE bladeRF)
find_package(PkgConfig)
pkg_check_modules(LIBBLADERF REQUIRED libbladeRF)
target_include_directories(bladerf_source PRIVATE ${LIBBLADERF_INCLUDE_DIRS})
target_link_directories(bladerf_source PRIVATE ${LIBBLADERF_LIBRARY_DIRS})
target_link_libraries(bladerf_source PRIVATE ${LIBBLADERF_LIBRARIES})
# Include it because for some reason pkgconfig doesn't look here?
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

View File

@ -130,7 +130,7 @@ const char* ifModeTxt =
const char* rspduo_antennaPortsTxt = "Tuner 1 (50Ohm)\0Tuner 1 (Hi-Z)\0Tuner 2 (50Ohm)\0";
const char* agcModesTxt = "Off\0005Hz\00050Hz\000100Hz";
const char* agcModesTxt = "Off\0005Hz\00050Hz\000100Hz\000";
class SDRPlaySourceModule : public ModuleManager::Instance {
public: