myriadrf / LimeSuite

Driver and GUI for LMS7002M-based SDR platforms
https://myriadrf.org/projects/lime-suite/
Apache License 2.0
465 stars 182 forks source link

Update CMakeList for modern macOS versions #388

Closed arvedviehweger closed 4 months ago

arvedviehweger commented 6 months ago

Hello!

I recently upgraded to a new MacBook Pro. Since I planned on using my LimeSDR in combination with the new laptop I had to compile LimeSuite from source since homebrew no longer offers prebuilt versions.

Everything compiled fine but running certain executables (for example LimeUtil) resulted in errors like this:

dyld[22779]: Library not loaded: @rpath/libLimeSuite.23.11-1.dylib
  Referenced from: <49EAFDEF-E479-36A4-8FEC-3E2A8E368C49> /usr/local/bin/LimeUtil
  Reason: no LC_RPATH's found
zsh: abort      LimeUtil

Updating the main CMakeLists file with the content of this pull request fixes the issue and everything runs fine again. It appears to be an issue with recent macOS versions as I could reproduce it on macOS 13 (Intel CPU) and macOS 14 (M3 Pro CPU). In both cases it is now working fine.

Bildschirmfoto 2023-12-29 um 19 01 47

arvedviehweger commented 4 months ago

Have a look at my lastest commit. This seems to be the more elegant way of fixing it.

Output from otool: @rpath/libLimeSuite.23.11-1.dylib (compatibility version 23.11.0, current version 23.11.0) /opt/homebrew/opt/libusb/lib/libusb-1.0.0.dylib (compatibility version 4.0.0, current version 4.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1600.157.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.61.1)

I can also confirm that running the binaries from the build directory (with the lib uninstalled from the system) run just fine now.