From 4582cdc104f970faf6e55b8c64171409384fe57a Mon Sep 17 00:00:00 2001 From: Chris Simons Date: Tue, 28 Apr 2020 22:04:13 -0700 Subject: [PATCH] changed method of finding libqcocoa.dylib --- dist/macos/bundle/build_installer.sh.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dist/macos/bundle/build_installer.sh.in b/dist/macos/bundle/build_installer.sh.in index e31f2a91..f2b5a89b 100755 --- a/dist/macos/bundle/build_installer.sh.in +++ b/dist/macos/bundle/build_installer.sh.in @@ -33,12 +33,10 @@ cd MacOS || exit 1 cp @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/* . || exit 1 # copy the qt platform plugin -# TODO: this is hacky and will probably break if there is more than one qt -# version installed. need a better way to find this library -B_COCOA=$(find /usr/local/Cellar/qt -type f -name libqcocoa.dylib | head -1) -if [ "x$B_COCOA" = "x" ]; then - B_COCOA=$(find /opt/local/libexec/qt5/plugins -type f -name libqcocoa.dylib | head -1) -fi +# get the .dylib location from the DYLD output of running bin/barrier +B_COCOA=$(DYLD_PRINT_LIBRARIES=1 \ + @CMAKE_RUNTIME_OUTPUT_DIRECTORY@/barrier 2>&1 \ + | grep --only-matching --max-count 1 '/.*libqcocoa.dylib$') if [ "x$B_COCOA" = "x" ]; then echo "Could not find cocoa platform plugin" exit 1