cmake: Fix obs-ffmpeg-mux missing rpath entries for libobs in build tree

When using `install`, CMake will fix up a binary's rpath entries
automatically. As `install` is also used to copy all build artifacts
into a common runtime directory, this will lead to independent binaries
such as "obs-ffmpeg-mux" to be fixed up to run within a fully portable
app bundle.

Yet during development, the app bundle is not fully portable, so rpath
entries to e.g. libobs need to be retained. Using CMake's
`install PROGRAMS` variant will achieve just that.
master
PatTheMav 2022-03-28 16:23:40 +02:00 committed by Jim
parent ff916e5f2c
commit a6532fc176
1 changed files with 8 additions and 7 deletions

View File

@ -304,11 +304,15 @@ function(setup_obs_modules target)
if(TARGET obs-ffmpeg-mux)
add_dependencies(${target} obs-ffmpeg-mux)
install(TARGETS obs-ffmpeg-mux
RUNTIME DESTINATION $<TARGET_FILE_BASE_NAME:obs>.app/Contents/MacOS
COMPONENT obs_plugins)
install(
TARGETS obs-ffmpeg-mux
RUNTIME DESTINATION "MacOS"
COMPONENT obs_plugin_dev
EXCLUDE_FROM_ALL)
PROGRAMS $<TARGET_FILE:obs-ffmpeg-mux>
DESTINATION "MacOS"
COMPONENT obs_plugin_dev
EXCLUDE_FROM_ALL)
set(_COMMAND
"/usr/bin/codesign --force --sign \\\"${OBS_BUNDLE_CODESIGN_IDENTITY}\\\" $<$<BOOL:${OBS_CODESIGN_LINKER}>:--options linker-signed > \\\"\${CMAKE_INSTALL_PREFIX}/MacOS/$<TARGET_FILE_NAME:obs-ffmpeg-mux>\\\" > /dev/null"
@ -319,9 +323,6 @@ function(setup_obs_modules target)
COMPONENT obs_plugin_dev
EXCLUDE_FROM_ALL)
install(TARGETS obs-ffmpeg-mux
RUNTIME DESTINATION $<TARGET_FILE_BASE_NAME:obs>.app/Contents/MacOS
COMPONENT obs_plugins)
endif()
if(TARGET mac-dal-plugin)