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
Show file tree
Hide file tree
Changes from 4 commits
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
13 changes: 12 additions & 1 deletion CMake/CodeSigning.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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>...
)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
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>
Binary file modified icons/os.icns
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Generated via

iconutil -c icns os.iconset

Binary file not shown.
14 changes: 14 additions & 0 deletions src/openstudio_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,4 +547,18 @@ endif()
if(APPLE AND CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION)
include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/CodeSigning.cmake")
register_install_codesign_target(${target_name} "." "OpenStudioApp")

install(
CODE "
include(\"${CMAKE_CURRENT_FUNCTION_LIST_FILE}\")
codesign_files_macos(
FILES \"\${CMAKE_INSTALL_PREFIX}/$<TARGET_BUNDLE_DIR_NAME:${target_name}>/Contents/Frameworks/QtWebEngineCore.framework/QtWebEngineCore\"
SIGNING_IDENTITY \"${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}\"
IDENTIFIER \"${CPACK_CODESIGNING_MACOS_IDENTIFIER}.QtWebEngineCore\"
ENTITLEMENTS \"${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/QtWebEngineProcess.entitlements\"
FORCE VERBOSE
)
"
COMPONENT OpenStudioApp
)
endif()
2 changes: 1 addition & 1 deletion src/openstudio_app/OpenStudioApp.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BEGIN
VALUE "FileDescription", "OpenStudio Application for Energy Modeling\0"
VALUE "FileVersion", "${OPENSTUDIOAPPLICATION_VERSION}\0"
VALUE "InternalName", "OpenStudioApp\0"
VALUE "LegalCopyright", "Copyright (c) 2020-2022, OpenStudio Coalition and other contributors. All rights reserved..\0"
VALUE "LegalCopyright", "Copyright (c) 2020-${CURRENT_YEAR}, OpenStudio Coalition and other contributors. All rights reserved..\0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

outdated, never again!

VALUE "LegalTrademarks", "OpenStudio (TM) is a trademark of NREL\0"
VALUE "OriginalFilename", "OpenStudioApp.exe\0"
VALUE "ProductName", "OpenStudioApplication\0"
Expand Down
Loading