Skip to content

Commit

Permalink
feat: reorg QCefView.framework folder to support codesign (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
le0zh authored Jan 3, 2023
1 parent 56192ab commit 5075e76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ if(OS_MACOS)

# create plugins directory
COMMAND mkdir -p
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/"

# copy the CefViewCore binaries to resource directory
COMMAND cp -a
"$<TARGET_BUNDLE_DIR:CefViewWing>/../"
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/"

# sign the cef framework
COMMAND codesign
--force
--sign -
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/Chromium Embedded Framework.framework"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/Chromium Embedded Framework.framework"
)
endif() # OS_MACOS

Expand Down
7 changes: 5 additions & 2 deletions src/mac/details/QCefContextPrivate_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"];
Expand Down

0 comments on commit 5075e76

Please sign in to comment.