macos: Add RPATH to the installed binary to enable dynamic loading of

bundled libraries.
This commit is contained in:
cold-brewed
2022-08-27 10:47:55 -04:00
parent 71e37057eb
commit 4efd1d90c2

View File

@@ -309,7 +309,11 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE)
install(CODE "
include(BundleUtilities)
get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX} ABSOLUTE)
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS}\" \"${DIRS}\")")
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS}\" \"${DIRS}\")
execute_process(
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\"
\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/${INSTALL_RUNTIME_DIR}/86Box\")
")
endif()
if (UNIX AND NOT APPLE AND NOT HAIKU)