diff options
author | Brad King <brad.king@kitware.com> | 2022-04-11 22:02:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-14 14:14:58 (GMT) |
commit | b760828d3fa50ae621d44ac00ffa77de5593c3ed (patch) | |
tree | 2f91a473dea3de8232166d78095e20516177e0bf /Modules/CPack.cmake | |
parent | dd193fa3d357b7f1c2495348d58b85bb597844c5 (diff) | |
download | CMake-b760828d3fa50ae621d44ac00ffa77de5593c3ed.zip CMake-b760828d3fa50ae621d44ac00ffa77de5593c3ed.tar.gz CMake-b760828d3fa50ae621d44ac00ffa77de5593c3ed.tar.bz2 |
CPack/DMG: Do not use CPACK_RESOURCE_FILE_LICENSE for SLA by default
Since macOS 12.0 deprecated the tools needed to attach a SLA to a
`.dmg`, we should no longer do this by default. Add a policy to
change the default to off.
Fixes: #22978
Diffstat (limited to 'Modules/CPack.cmake')
-rw-r--r-- | Modules/CPack.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 5a22be5..40cfde4 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -817,8 +817,20 @@ _cpack_set_default(CPACK_NSIS_INSTALLER_ICON_CODE "") _cpack_set_default(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") # DragNDrop specific variables -if(CPACK_RESOURCE_FILE_LICENSE AND NOT CPACK_RESOURCE_FILE_LICENSE STREQUAL "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt") - _cpack_set_default(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON) +if(NOT DEFINED CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE + AND CPACK_RESOURCE_FILE_LICENSE AND NOT CPACK_RESOURCE_FILE_LICENSE STREQUAL "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt") + cmake_policy(GET CMP0133 _CPack_CMP0133) + if(NOT "x${_CPack_CMP0133}x" STREQUAL "xNEWx") + if(NOT "x${_CPack_CMP0133}x" STREQUAL "xOLDx" AND CMAKE_POLICY_WARNING_CMP0133) + cmake_policy(GET_WARNING CMP0133 _CMP0133_warning) + message(AUTHOR_WARNING + "${_CMP0133_warning}\n" + "For compatibility, CMake will enable the SLA in the CPack DragNDrop Generator." + ) + endif() + _cpack_set_default(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON) + endif() + unset(_CPack_CMP0133) endif() # WiX specific variables |