From 7b4c69ffd6df6c3b21b6c8cbf09a0be645dc3302 Mon Sep 17 00:00:00 2001 From: le0zh Date: Mon, 26 Dec 2022 17:29:54 +0800 Subject: [PATCH] feat: reorg QCefView.framework folder to support codesign --- src/CMakeLists.txt | 6 +++--- src/mac/details/QCefContextPrivate_mac.mm | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a461f2b..5486cdcd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -176,18 +176,18 @@ if(OS_MACOS) # create plugins directory COMMAND mkdir -p - "$/PlugIns/" + "$/Resources/PlugIns/" # copy the CefViewCore binaries to resource directory COMMAND cp -a "$/../" - "$/PlugIns/" + "$/Resources/PlugIns/" # sign the cef framework COMMAND codesign --force --sign - - "$/PlugIns/Chromium Embedded Framework.framework" + "$/Resources/PlugIns/Chromium Embedded Framework.framework" ) endif() # OS_MACOS diff --git a/src/mac/details/QCefContextPrivate_mac.mm b/src/mac/details/QCefContextPrivate_mac.mm index d659f192..f5eef17a 100644 --- a/src/mac/details/QCefContextPrivate_mac.mm +++ b/src/mac/details/QCefContextPrivate_mac.mm @@ -15,6 +15,7 @@ #define CEF_FRAMEWORK_NAME "Chromium Embedded Framework.framework" #define HELPER_BUNDLE_NAME "CefViewWing.app" #define HELPER_BINARY_NAME "CefViewWing" +#define PLUGINS_NAME "PlugIns" @interface PathFactory : NSObject + (NSString*) AppMainBundlePath; @@ -28,13 +29,15 @@ + (NSString*) AppMainBundlePath { } + (NSString*) CefFrameworkPath { - NSString* path = [[NSBundle bundleForClass:[PathFactory class]] builtInPlugInsPath]; + NSString* path = [[NSBundle bundleForClass:[PathFactory class]] resourcePath]; + path = [path stringByAppendingPathComponent:@PLUGINS_NAME]; path = [path stringByAppendingPathComponent:@CEF_FRAMEWORK_NAME]; return path; } + (NSString*) CefSubprocessPath { - NSString* path = [[NSBundle bundleForClass:[PathFactory class]] builtInPlugInsPath]; + NSString* path = [[NSBundle bundleForClass:[PathFactory class]] resourcePath]; + path = [path stringByAppendingPathComponent:@PLUGINS_NAME]; path = [path stringByAppendingPathComponent:@HELPER_BUNDLE_NAME]; path = [path stringByAppendingPathComponent:@"Contents"]; path = [path stringByAppendingPathComponent:@"MacOS"];