Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #744 Fix #745 - fixup icon and Can't see QtWebEngine pages on macOS #746

Merged
merged 7 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try to fix #745 by signing QtWengineProcess with `com.apple.security.…
…cs.disable-executable-page-protection`
jmarrec committed Sep 4, 2024
commit f804c9ac4d1b7a7d06f01aae6e1bc1991ee4a78a
13 changes: 12 additions & 1 deletion CMake/CodeSigning.cmake
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ This module defines functions to codesign, notarize and staple macOS files.
[IDENTIFIER <identifier>]
[PREFIX <prefix>]
[OPTIONS <options>...]
[ENTITLEMENTS <entitlements_file>]
FILES <files>...
)

@@ -46,6 +47,8 @@ This module defines functions to codesign, notarize and staple macOS files.
``PREFIX``
What to pass to ``--prefix``. eg 'com.domain.MyApp.' with a **trailing dot**. Ignored if ``IDENTIFIER`` is passed

``ENTITLEMENTS entitlements_file``
The entitlements xml file to use

.. cmake:command:: notarize_files_macos

@@ -146,7 +149,7 @@ endfunction()
function(codesign_files_macos)
set(prefix "")
set(valueLessKeywords FORCE VERBOSE DEEP)
set(singleValueKeywords SIGNING_IDENTITY IDENTIFIER PREFIX)
set(singleValueKeywords SIGNING_IDENTITY IDENTIFIER PREFIX ENTITLEMENTS)
set(multiValueKeywords FILES OPTIONS)
cmake_parse_arguments(
PARSE_ARGV 0 # Start at one with NAME is the first param
@@ -205,6 +208,14 @@ function(codesign_files_macos)
list(APPEND cmd "--prefix" "${_PREFIX}")
endif()

if (_ENTITLEMENTS)
if (NOT EXISTS "${_ENTITLEMENTS}")
message(FATAL_ERROR "Can't sign with entitlements ${_ENTITLEMENTS}, no file exists at that path.")
endif ()

list(APPEND cmd "--entitlements" "${_ENTITLEMENTS}")
endif()

foreach(path ${_FILES})
print_cmd_if_verbose("${cmd};${path}" _VERBOSE)

8 changes: 8 additions & 0 deletions CMake/QtWebEngineProcess.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-executable-page-protection</key>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entitlement for QtWebEngineProcess

<true/>
</dict>
</plist>
8 changes: 8 additions & 0 deletions CMake/install_codesign_script_OpenStudioApp.cmake
Original file line number Diff line number Diff line change
@@ -299,6 +299,14 @@ codesign_files_macos(
FORCE VERBOSE
)

codesign_files_macos(
FILES ${CMAKE_INSTALL_PREFIX}/OpenStudioApp.app/Contents/Frameworks/QtWebEngineCore.framework/QtWebEngineCore
SIGNING_IDENTITY ${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}
PREFIX "${CPACK_CODESIGNING_MACOS_IDENTIFIER}."
ENTITLEMENTS "${CMAKE_CURRENT_LIST_DIR}/QtWebEngineProcess.entitlements"
FORCE VERBOSE
)

# Clean up to avoid multiple passes (several components) appending to a pre-existing list
unset(FILES_TO_SIGN)
unset(_FULL_PATHS)