summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-14 16:40:23 (GMT)
committerBrad King <brad.king@kitware.com>2022-01-18 20:39:51 (GMT)
commit9e38bfa915c142edcf7d6e154fa1dc10bba400f1 (patch)
treea3ebdbd672c3fba3be1d107e93b60152254fdb96 /Source/CPack
parent542ba6ac1a50c3900457431819e5eb328f3a29ee (diff)
downloadCMake-9e38bfa915c142edcf7d6e154fa1dc10bba400f1.zip
CMake-9e38bfa915c142edcf7d6e154fa1dc10bba400f1.tar.gz
CMake-9e38bfa915c142edcf7d6e154fa1dc10bba400f1.tar.bz2
CPack/DMG: Add explicit option to use CPACK_RESOURCE_FILE_LICENSE for SLA
Since macOS 12.0, the ``hdiutil udifrez`` and ``hdiutil udifderez`` commands to embed and extract resources in a disk image are deprecated. The CPack DragNDrop Generator uses these to attach the SLA specified by the `CPACK_RESOURCE_FILE_LICENSE` option. Since that option is shared by multiple CPack generators, we cannot deprecate it. Instead, add an explicit option to control the behavior. This will give projects a way to package on future macOS versions that remove the commands. In order to provide a long-term transition away from attaching SLAs to disk images, update `cpack` to default this behavior to OFF. To retain compatibility for CMake projects, teach the CPack module to default the option to ON. Later a policy can be added to change the default. Issue: #22978
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9385a5a..0f7acfb 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -98,7 +98,9 @@ int cmCPackDragNDropGenerator::InitializeInternal()
if (this->IsSet("CPACK_DMG_SLA_DIR")) {
slaDirectory = this->GetOption("CPACK_DMG_SLA_DIR");
- if (!slaDirectory.empty() && this->IsSet("CPACK_RESOURCE_FILE_LICENSE")) {
+ if (!slaDirectory.empty() &&
+ this->IsOn("CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE") &&
+ this->IsSet("CPACK_RESOURCE_FILE_LICENSE")) {
std::string license_file =
this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
if (!license_file.empty() &&
@@ -278,8 +280,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
: "HFS+";
// Get optional arguments ...
- std::string cpack_license_file =
- *this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
+ std::string cpack_license_file;
+ if (this->IsOn("CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE")) {
+ cpack_license_file = *this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
+ }
cmValue cpack_dmg_background_image =
this->GetOption("CPACK_DMG_BACKGROUND_IMAGE");