Commit 39b50975 authored by Brad King's avatar Brad King
Browse files

CPack: Fix .dmg HFS+ creation on macOS APFS hosts

When running `hdiutil create`, specify the HFS+ filesystem explicitly.
Otherwise `hdiutil` may choose a filesystem based on the host.  We do
not want to create APFS images for `.dmg` packages because they may not
mount on macOS versions prior to 10.12.
parent a9870c92
...@@ -417,6 +417,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, ...@@ -417,6 +417,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
temp_image_command << " -ov"; temp_image_command << " -ov";
temp_image_command << " -srcfolder \"" << staging.str() << "\""; temp_image_command << " -srcfolder \"" << staging.str() << "\"";
temp_image_command << " -volname \"" << cpack_dmg_volume_name << "\""; temp_image_command << " -volname \"" << cpack_dmg_volume_name << "\"";
temp_image_command << " -fs HFS+";
temp_image_command << " -format " << temp_image_format; temp_image_command << " -format " << temp_image_format;
temp_image_command << " \"" << temp_image << "\""; temp_image_command << " \"" << temp_image << "\"";
......
...@@ -144,8 +144,8 @@ int cmCPackOSXX11Generator::PackageFiles() ...@@ -144,8 +144,8 @@ int cmCPackOSXX11Generator::PackageFiles()
tmpFile += "/hdiutilOutput.log"; tmpFile += "/hdiutilOutput.log";
std::ostringstream dmgCmd; std::ostringstream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory << "\" create -ov -fs HFS+ -format UDZO -srcfolder \""
<< "\" \"" << packageFileNames[0] << "\""; << diskImageDirectory << "\" \"" << packageFileNames[0] << "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: " cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: "
<< dmgCmd.str() << std::endl); << dmgCmd.str() << std::endl);
// since we get random dashboard failures with this one // since we get random dashboard failures with this one
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment