Skip to content

Commit bc1335c

Browse files
authored
Merge pull request #21 from OPENSPHERE-Inc/macos-fix
CI fix for MacOS (Re-fix)
2 parents 8be8c61 + ddc3cc7 commit bc1335c

File tree

5 files changed

+41
-10
lines changed

5 files changed

+41
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@
3838
!build-windows-installer.ps1
3939
!src-link_usage_image.jpg
4040
!/srtrelay
41+
!Frameworks.cmake.in

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,15 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
126126
install(
127127
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/lib/QtWebSockets.framework"
128128
CONFIGURATIONS RelWithDebInfo Debug Release
129-
DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks"
130-
OPTIONAL)
129+
DESTINATION "."
130+
REGEX "Headers" EXCLUDE)
131131
install(
132132
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-universal/plugins/tls"
133133
CONFIGURATIONS RelWithDebInfo Debug Release
134-
DESTINATION "${CMAKE_PROJECT_NAME}.plugin/Contents/Frameworks"
135-
OPTIONAL)
134+
DESTINATION ".")
135+
136+
configure_file(Frameworks.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/Frameworks.cmake" @ONLY)
137+
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/Frameworks.cmake")
136138
endif()
137139

138140
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
@@ -141,11 +143,9 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
141143
install(
142144
FILES "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-x64/bin/Qt6WebSockets.dll"
143145
CONFIGURATIONS RelWithDebInfo Debug Release
144-
DESTINATION bin/64bit
145-
OPTIONAL)
146+
DESTINATION bin/64bit)
146147
install(
147148
DIRECTORY "${CMAKE_SOURCE_DIR}/.deps/obs-deps-qt6-${qtversion}-x64/plugins/tls"
148149
CONFIGURATIONS RelWithDebInfo Debug Release
149-
DESTINATION bin/64bit
150-
OPTIONAL)
150+
DESTINATION bin/64bit)
151151
endif()

Frameworks.cmake.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework")
2+
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins"
3+
TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/QtWebSockets.framework" USE_SOURCE_PERMISSIONS)
4+
execute_process(
5+
COMMAND /usr/bin/codesign
6+
--force
7+
--sign "@CODESIGN_IDENTITY@"
8+
--timestamp
9+
-o runtime
10+
--generate-entitlement-der
11+
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins/QtWebSockets.framework"
12+
)
13+
endif()
14+
15+
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls")
16+
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins"
17+
TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/tls" USE_SOURCE_PERMISSIONS)
18+
file(GLOB_RECURSE dylib_files "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins/tls/*.dylib")
19+
foreach(dylib_file IN LISTS dylib_files)
20+
execute_process(
21+
COMMAND /usr/bin/codesign
22+
--force
23+
--sign "@CODESIGN_IDENTITY@"
24+
--timestamp
25+
-o runtime
26+
--generate-entitlement-der
27+
"${dylib_file}"
28+
)
29+
endforeach()
30+
endif()

cmake/macos/xcode.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ set(CMAKE_COLOR_DIAGNOSTICS TRUE)
171171
# Disable usage of RPATH in build or install configurations
172172
set(CMAKE_SKIP_RPATH TRUE)
173173
# Have Xcode set default RPATH entries
174-
set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @loader_path/../Frameworks")
174+
set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @loader_path/../../../")

src/plugin-main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bool obs_module_load(void)
8282
{
8383
#ifdef __APPLE__
8484
QFileInfo moduleFile(obs_get_module_binary_path(obs_current_module()));
85-
auto libraryPath = QString("%1/../Frameworks").arg(moduleFile.dir().path());
85+
auto libraryPath = QString("%1/../../../").arg(moduleFile.dir().path());
8686
QCoreApplication::addLibraryPath(libraryPath);
8787
#endif
8888

0 commit comments

Comments
 (0)