diff --git a/CMake/CodeSigning.cmake b/CMake/CodeSigning.cmake index b1ee07f24..43c4fed2d 100644 --- a/CMake/CodeSigning.cmake +++ b/CMake/CodeSigning.cmake @@ -14,6 +14,7 @@ This module defines functions to codesign, notarize and staple macOS files. [IDENTIFIER ] [PREFIX ] [OPTIONS ...] + [ENTITLEMENTS ] 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) diff --git a/icons/os.icns b/icons/os.icns index a4eec6593..fd1264ed6 100644 Binary files a/icons/os.icns and b/icons/os.icns differ diff --git a/src/openstudio_app/CMakeLists.txt b/src/openstudio_app/CMakeLists.txt index 0cdc5050e..5436c49bd 100644 --- a/src/openstudio_app/CMakeLists.txt +++ b/src/openstudio_app/CMakeLists.txt @@ -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}/$/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() diff --git a/src/openstudio_app/OpenStudioApp.rc.in b/src/openstudio_app/OpenStudioApp.rc.in index c582a9679..95d50701c 100644 --- a/src/openstudio_app/OpenStudioApp.rc.in +++ b/src/openstudio_app/OpenStudioApp.rc.in @@ -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"