Skip to content

Commit

Permalink
- Fix CI's packaging stage for MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hanatyan128 committed Dec 20, 2024
1 parent 369e2f3 commit ddc3cc7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 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
27 changes: 6 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,14 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/lib/QtWebSockets.framework"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "."
OPTIONAL)
REGEX "Headers" EXCLUDE)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/plugins/tls"
CONFIGURATIONS RelWithDebInfo Debug Release
DESTINATION "."
OPTIONAL)
DESTINATION ".")

install(
CODE [===[
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)
endif()
]===])
install(
CODE [===[
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)
endif()
]===])
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 @@ -156,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()

0 comments on commit ddc3cc7

Please sign in to comment.