Skip to content

Commit

Permalink
Merge pull request #746 from openstudiocoalition/744_fixup_icon
Browse files Browse the repository at this point in the history
Fix #744  Fix #745 - fixup icon and Can't see QtWebEngine pages on macOS
  • Loading branch information
jmarrec authored Sep 4, 2024
2 parents 44f381f + 665e77b commit 46ffa59
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
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
Binary file modified icons/os.icns
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/Versions/A/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess\"
SIGNING_IDENTITY \"${CPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION}\"
IDENTIFIER \"${CPACK_CODESIGNING_MACOS_IDENTIFIER}.QtWebEngineProcess\"
ENTITLEMENTS \"${QtWebEngineProcess}/Contents/Resources/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"
VALUE "LegalTrademarks", "OpenStudio (TM) is a trademark of NREL\0"
VALUE "OriginalFilename", "OpenStudioApp.exe\0"
VALUE "ProductName", "OpenStudioApplication\0"
Expand Down

0 comments on commit 46ffa59

Please sign in to comment.