Skip to content

Commit 960165d

Browse files
committed
build(app): let fixup_bundle resolve @rpath dylibs from Homebrew
1 parent 87c73c4 commit 960165d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎port/app/CMakeLists.txt‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,17 @@ install(DIRECTORY ${CRYPTOOL_DEV_DATA_DIR}/PSE DESTINATION ${CRYPTOOL_DATA_DEST}
125125

126126
if(APPLE)
127127
# Copies the Homebrew dylibs (wxWidgets, OpenSSL, GMP) into the bundle so it runs on other Macs.
128+
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE brew_prefix OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
129+
set(bundle_lib_dirs)
130+
foreach(prefix ${brew_prefix} /opt/homebrew /usr/local)
131+
if(EXISTS ${prefix}/lib)
132+
list(APPEND bundle_lib_dirs ${prefix}/lib)
133+
endif()
134+
endforeach()
135+
list(REMOVE_DUPLICATES bundle_lib_dirs)
128136
install(CODE "
129137
include(BundleUtilities)
130-
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/CrypTool.app\" \"\" \"\")
138+
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/CrypTool.app\" \"\" \"${bundle_lib_dirs}\")
131139
execute_process(COMMAND codesign --force --deep --sign - \"\${CMAKE_INSTALL_PREFIX}/CrypTool.app\"
132140
RESULT_VARIABLE sign_result)
133141
if(NOT sign_result EQUAL 0)

0 commit comments

Comments
 (0)