(macOS) Added a CMake variable for defining the code signing certificate identity.

This commit is contained in:
Leon Styhre 2021-05-13 19:33:07 +02:00
parent 3c00a961ea
commit 5e0b709c14
2 changed files with 11 additions and 5 deletions

View file

@ -3,6 +3,8 @@ if(APPLE)
# Set this to the operating system version you're building on, and also update
# es-app/assets/EmulationStation-DE_Info.plist accordingly.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "macOS deployment target")
# This optional variable is used for code signing the DMG installer.
set(MACOS_CODESIGN_IDENTITY "" CACHE STRING "macOS code signing certificate identity")
endif()
project(emulationstation-de)
@ -166,6 +168,9 @@ if(APPLE)
endif()
if(APPLE)
if(MACOS_CODESIGN_IDENTITY)
message("-- Code signing certificate identity: " ${MACOS_CODESIGN_IDENTITY})
endif()
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.14)
message("-- macOS version 10.13 or lower has been set, so if code signing is enabled, Hardened Runtime will not be used")
endif()

View file

@ -276,11 +276,12 @@ if(APPLE)
set(CPACK_BUNDLE_NAME "EmulationStation Desktop Edition")
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist")
# Uncomment the following lines and change to your certificate identity to enable code signing.
#set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: <identity>")
#if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_GREATER 10.13)
# set(CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER "--deep --force --options runtime")
#endif()
if(MACOS_CODESIGN_IDENTITY)
set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: ${MACOS_CODESIGN_IDENTITY}")
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_GREATER 10.13)
set(CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER "--deep --force --options runtime")
endif()
endif()
elseif(WIN32)
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}")