Skip to content

Commit

Permalink
Merge pull request #21 from OPENSPHERE-Inc/macos-fix
Browse files Browse the repository at this point in the history
CI fix for MacOS (Re-fix)
  • Loading branch information
hanatyan128 authored Dec 20, 2024
2 parents 8be8c61 + ddc3cc7 commit bc1335c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
!build-windows-installer.ps1
!src-link_usage_image.jpg
!/srtrelay
!Frameworks.cmake.in
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,15 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/lib/QtWebSockets.framework"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks"
OPTIONAL)
DESTINATION "."
REGEX "Headers" EXCLUDE)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/plugins/tls"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks"
OPTIONAL)
DESTINATION ".")

configure_file(Frameworks.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/Frameworks.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/Frameworks.cmake")
endif()

set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
Expand All @@ -141,11 +143,9 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
install(
FILES "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-x64/bin/Qt6WebSockets.dll"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION bin/64bit
OPTIONAL)
DESTINATION bin/64bit)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-x64/plugins/tls"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION bin/64bit
OPTIONAL)
DESTINATION bin/64bit)
endif()
30 changes: 30 additions & 0 deletions Frameworks.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework")
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins"
TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework" USE_SOURCE_PERMISSIONS)
execute_process(
COMMAND /usr/bin/codesign
--force
--sign "@CODESIGN_IDENTITY@"
--timestamp
-o runtime
--generate-entitlement-der
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins/QtWebSockets.framework"
)
endif()

if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls")
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins"
TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls" USE_SOURCE_PERMISSIONS)
file(GLOB_RECURSE dylib_files "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins/tls/*.dylib")
foreach(dylib_file IN LISTS dylib_files)
execute_process(
COMMAND /usr/bin/codesign
--force
--sign "@CODESIGN_IDENTITY@"
--timestamp
-o runtime
--generate-entitlement-der
"${dylib_file}"
)
endforeach()
endif()
2 changes: 1 addition & 1 deletion cmake/macos/xcode.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ set(CMAKE_COLOR_DIAGNOSTICS TRUE)
# Disable usage of RPATH in build or install configurations
set(CMAKE_SKIP_RPATH TRUE)
# Have Xcode set default RPATH entries
set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @loader_path/../Frameworks")
set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @loader_path/../../../")
2 changes: 1 addition & 1 deletion src/plugin-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool obs_module_load(void)
{
#ifdef __APPLE__
QFileInfo moduleFile(obs_get_module_binary_path(obs_current_module()));
auto libraryPath = QString("%1/../Frameworks").arg(moduleFile.dir().path());
auto libraryPath = QString("%1/../../../").arg(moduleFile.dir().path());
QCoreApplication::addLibraryPath(libraryPath);
#endif

Expand Down

0 comments on commit bc1335c

Please sign in to comment.