generated from obsproject/obs-plugintemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from obs-ai/roy.fix_macos_build
Fix osx build
- Loading branch information
Showing
7 changed files
with
74 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
set(CMAKE_PROJECT_NAME ${CMAKE_PROJECT_NAME}) | ||
set(CMAKE_PROJECT_VERSION ${CMAKE_PROJECT_VERSION}) | ||
set(MACOS_BUNDLEID ${MACOS_BUNDLEID}) | ||
set(UUID_PACKAGE ${UUID_PACKAGE}) | ||
set(UUID_INSTALLER ${UUID_INSTALLER}) | ||
configure_file(cmake/macos/resources/installer-macos.pkgproj.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/installer-macos.generated.pkgproj") | ||
make_directory("$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins") | ||
|
||
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]") | ||
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins" | ||
TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]" USE_SOURCE_PERMISSIONS) | ||
|
||
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$" OR CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Mm][Ii][Nn][Ss][Ii][Zz][Ee][Rr][Ee][Ll])$") | ||
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]" AND NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]") | ||
file(INSTALL DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package/Library/Application Support/obs-studio/plugins" TYPE DIRECTORY FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]" USE_SOURCE_PERMISSIONS) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
make_directory("$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/temp") | ||
|
||
execute_process( | ||
COMMAND /usr/bin/pkgbuild | ||
--identifier '@MACOS_BUNDLEID@' | ||
--version '@CMAKE_PROJECT_VERSION@' | ||
--root "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package" | ||
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/temp/@[email protected]" | ||
COMMAND_ERROR_IS_FATAL ANY | ||
) | ||
|
||
execute_process( | ||
COMMAND /usr/bin/productbuild | ||
--distribution "@CMAKE_CURRENT_BINARY_DIR@/distribution" | ||
--package-path "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/temp" | ||
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]" | ||
COMMAND_ERROR_IS_FATAL ANY) | ||
|
||
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@[email protected]") | ||
file(REMOVE_RECURSE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/temp") | ||
file(REMOVE_RECURSE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/package") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
<installer-gui-script minSpecVersion="1.0"> | ||
<options | ||
rootVolumeOnly="true" | ||
hostArchitectures="arm64,x86_64" | ||
customize="never" | ||
allow-external-scripts="no" /> | ||
<domains enable_currentUserHome="true" enable_anywhere="false" enable_localSystem="false" /> | ||
<title>@CMAKE_PROJECT_NAME@</title> | ||
<choices-outline> | ||
<line choice="obs-plugin" /> | ||
</choices-outline> | ||
<choice id="obs-plugin" title="@CMAKE_PROJECT_NAME@" description=""> | ||
<pkg-ref id="@MACOS_BUNDLEID@" /> | ||
</choice> | ||
<pkg-ref id="@MACOS_BUNDLEID@" version="@CMAKE_PROJECT_VERSION@">#@[email protected]</pkg-ref> | ||
<installation-check script="installCheck();" /> | ||
<script> | ||
function installCheck() { | ||
var macOSVersion = system.version.ProductVersion | ||
|
||
if (system.compareVersions(macOSVersion, '@CMAKE_OSX_DEPLOYMENT_TARGET@') == -1) { | ||
my.result.title = system.localizedStandardStringWithFormat( | ||
'InstallationCheckError', | ||
system.localizedString('DISTRIBUTION_TITLE') | ||
); | ||
my.result.message = ' '; | ||
my.result.type = 'Fatal'; | ||
return false; | ||
} | ||
} | ||
</script> | ||
</installer-gui-script> |