[Cmake-commits] CMake branch, next, updated. v3.1.0-1342-gb68c4f1
Robert Maynard
robert.maynard at kitware.com
Mon Dec 22 14:15:34 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via b68c4f1dcb517f04d208c892013a35ad562b4955 (commit)
via 76a39f7a191ec42d90157c7d093b8cc97209c912 (commit)
via dfb74f5255e8a5ef3af799b61fc0721968adbe28 (commit)
via 2dc198b221391e33b4c1f204b1d7d4e2347369c8 (commit)
via 309ffd8ef0e2da664cb459d06ca20f0838dadec3 (commit)
via a7f55ac9f1b720a3338948f6c6883b3658f9d27b (commit)
via 2c8b9f506a6b8bdb2a9f036c1c7566adf5d4c5ab (commit)
from bf4483a2825783adfd1cbe3fa9256cafe1fac7b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b68c4f1dcb517f04d208c892013a35ad562b4955
commit b68c4f1dcb517f04d208c892013a35ad562b4955
Merge: bf4483a 76a39f7
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Dec 22 14:15:33 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 22 14:15:33 2014 -0500
Merge topic 'better_custom_dmgs' into next
76a39f7a DragNDropGenerator Updated Documentation to include new variables.
dfb74f52 DragNDropGenerator now manually computes the size of the temp dmg image.
2dc198b2 DragNDropGenerator copies the background image after the dmg is created.
309ffd8e DragNDropGenerator now can run an apple script when making a package.
a7f55ac9 DragNDropGenerator now places the background image file in a hidden folder.
2c8b9f50 DragNDropGenerator background image now uses source file extension.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76a39f7a191ec42d90157c7d093b8cc97209c912
commit 76a39f7a191ec42d90157c7d093b8cc97209c912
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Thu Dec 18 14:56:37 2014 -0500
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Thu Dec 18 14:56:37 2014 -0500
DragNDropGenerator Updated Documentation to include new variables.
The DragNDropGenerator documentation now covers the new behavior of
CPACK_DMG_BACKGROUND_IMAGE and what the purpose of
CPACK_DMG_DS_STORE_SETUP_SCRIPT is.
diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake
index b7a6ba5..b4231e8 100644
--- a/Modules/CPackDMG.cmake
+++ b/Modules/CPackDMG.cmake
@@ -29,12 +29,23 @@
# the Finder (either manually or through OSA-script) using a normal folder
# from which the .DS_Store file can then be extracted.
#
+# .. variable:: CPACK_DMG_DS_STORE_SETUP_SCRIPT
+#
+# Path to a custom OSA-script file. This apple script is used to
+# the generate a .DS_Store file which specifies the Finder window
+# position/geometry and layout (such as hidden toolbars, placement of the
+# icons etc.). By specifying a custom apple script there is no need to
+# CPACK_DMG_DS_STORE, as the .DS_Store that is generated by the OSA-script
+# will be packaged.
+#
# .. variable:: CPACK_DMG_BACKGROUND_IMAGE
#
-# Path to a background image file. This file will be used as the background
-# for the Finder Window when the disk image is opened. By default no
-# background image is set. The background image is applied after applying the
-# custom .DS_Store file.
+# Path to an image file to be used as the background. This file will be copied
+# to .background/background.<ext>, where ext is the original image file
+# extension. The background image is installed into the image before
+# CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is
+# installed
+# By default no background image is set.
#
# .. variable:: CPACK_COMMAND_HDIUTIL
#
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfb74f5255e8a5ef3af799b61fc0721968adbe28
commit dfb74f5255e8a5ef3af799b61fc0721968adbe28
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Wed Oct 1 13:52:11 2014 -0400
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Thu Dec 18 14:39:05 2014 -0500
DragNDropGenerator now manually computes the size of the temp dmg image.
When creating a DragNDrop bundle with a custom layout and background you need
to make sure that the image size is large enough to store both the background
and the custom .DS_Store.
Now previously the DragNDropGenerator relied on the fact that both of these
files would exist in the staging folder so it could let hdiutil compute an
exact size. Now that we allow generation of the .DS_Store to happen after
creation of the image we need to manually specify the size of the image
to include room for the new .DS_Store and background.
The whole reason why we have to delay the background image copy, is that
if we let hdiutil package the background image it gets modified in such away
that applescript aren't able to specify it as the background image.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 4229e3d..a335946 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -15,8 +15,10 @@
#include "cmSystemTools.h"
#include "cmGeneratedFileStream.h"
-#include <cmsys/RegularExpression.hxx>
+#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
+#include <cmsys/RegularExpression.hxx>
+#include <cmsys/SystemTools.hxx>
static const char* SLAHeader =
"data 'LPic' (5000) {\n"
@@ -49,6 +51,49 @@ static const char* SLASTREnglish =
"};\n"
"\n";
+
+namespace
+{
+ //computes the size of all items in a given folder.
+ //will not traverse symlinked folders
+ unsigned long compute_folder_content_size( const std::string& path )
+ {
+ unsigned long sum = 0; //total size in bytes
+ cmsys::Directory dir;
+ dir.Load(path.c_str());
+ for (unsigned long fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum)
+ {
+ const std::string fileName(dir.GetFile(fileNum));
+ const bool is_not_dot_file = fileName != std::string(".") &&
+ fileName != std::string("..");
+ if ( is_not_dot_file )
+ {
+ std::string fullPath = path;
+ fullPath += "/";
+ fullPath += fileName;
+
+ const bool is_folder =
+ cmSystemTools::FileIsDirectory(fullPath.c_str());
+ const bool is_file =
+ !is_folder;
+ const bool is_symlink =
+ cmSystemTools::FileIsSymlink(fullPath.c_str());
+
+ if( is_folder && !is_symlink)
+ {
+ sum += cmSystemTools::FileLength(fullPath.c_str());
+ sum += compute_folder_content_size(fullPath);
+ }
+ else if( is_file )
+ {
+ sum += cmSystemTools::FileLength(fullPath.c_str());
+ }
+ }
+ }
+ return sum;
+ }
+}
+
//----------------------------------------------------------------------
cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
{
@@ -250,6 +295,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT")
? this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT") : "";
+
// only put license on dmg if is user provided
if(!cpack_license_file.empty() &&
cpack_license_file.find("CPack.GenericLicense.txt") != std::string::npos)
@@ -290,7 +336,25 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
}
- // Create a temporary read-write disk image ...
+ // Create a temporary read-write disk image. If we are adding a DS_Store,
+ // Background or running a script we need to allocate some buffer space
+ // in the image, otherwise we won't have enough room
+
+ //first compute the size of the staging_path which requires us to
+ //iterate over
+ const std::string staging_path = staging.str();
+ unsigned long dmgSize = compute_folder_content_size( staging_path );
+ if (!cpack_dmg_background_image.empty())
+ {
+ dmgSize += cmSystemTools::FileLength(cpack_dmg_background_image.c_str());
+ }
+ dmgSize += 8388608; //add 8MB for the DS_Store and buffer
+
+ //now that we have computed the size of the disk image we need to convert
+ //it to kb. The reason for this is that the hdiutil doesn't have a byte
+ //size specifier.
+ const unsigned long dmgSizeAsKB = dmgSize / 1024;
+
std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
temp_image += "/temp.dmg";
@@ -298,6 +362,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
temp_image_command << " create";
temp_image_command << " -ov";
+ temp_image_command << " -size " << dmgSizeAsKB << "k";
temp_image_command << " -srcfolder \"" << staging.str() << "\"";
temp_image_command << " -volname \""
<< cpack_dmg_volume_name << "\"";
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2dc198b221391e33b4c1f204b1d7d4e2347369c8
commit 2dc198b221391e33b4c1f204b1d7d4e2347369c8
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Mon Sep 29 08:43:47 2014 -0400
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Wed Oct 1 15:59:35 2014 -0400
DragNDropGenerator copies the background image after the dmg is created.
This is required so that the permissions on the image are correct so that
an apple script can set the background.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index dac61b4..4229e3d 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -288,71 +288,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
}
- // Optionally add a custom background image ...
- // Make sure the background file type is the same as the custom image
- // and that the file is hidden so it doesn't show up.
- if(!cpack_dmg_background_image.empty())
- {
- const std::string extension =
- cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
- cmOStringStream package_background_source;
- package_background_source << cpack_dmg_background_image;
-
- cmOStringStream package_background_destination;
- package_background_destination << staging.str()
- << "/.background/background" << extension;
-
- if(!this->CopyFile(package_background_source,
- package_background_destination))
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error copying disk volume background image. "
- "Check the value of CPACK_DMG_BACKGROUND_IMAGE."
- << std::endl);
-
- return 0;
- }
- }
-
- // Figure out if we have a .DS_Store to install or if we need to run
- // an apple-script to generate a .DS_Store
- if(!cpack_dmg_ds_store.empty())
- {
- // Optionally add a custom .DS_Store file
- // (e.g. for setting background/layout) ...
- cmOStringStream package_settings_source;
- package_settings_source << cpack_dmg_ds_store;
-
- cmOStringStream package_settings_destination;
- package_settings_destination << staging.str() << "/.DS_Store";
-
- if(!this->CopyFile(package_settings_source, package_settings_destination))
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error copying disk volume settings file. "
- "Check the value of CPACK_DMG_DS_STORE."
- << std::endl);
-
- return 0;
- }
- }
- else if(!cpack_dmg_ds_store_setup_script.empty())
- {
- //If you don't have a custom .DS_Store file
- //we can execute a custom apple script to generate the .DS_Store for
- //the application
- cmOStringStream setup_script_command;
- setup_script_command << "osascript "
- << cpack_dmg_ds_store_setup_script;
- if(!this->RunCommand(setup_script_command))
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error executing custom script on disk image."
- << std::endl);
-
- return 0;
- }
- }
// Create a temporary read-write disk image ...
@@ -378,10 +313,16 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
- // Optionally set the custom icon flag for the image ...
- if(!cpack_package_icon.empty())
+ //mount the image and set the ds_store or custom icon flag
+ const bool remount_image = !cpack_dmg_background_image.empty() ||
+ !cpack_dmg_ds_store.empty() ||
+ !cpack_dmg_ds_store_setup_script.empty() ||
+ !cpack_package_icon.empty();
+ if(remount_image)
{
- cmOStringStream temp_mount;
+ //store that we have a failure so that we always unmount the image
+ //before we exit
+ bool had_error = false;
cmOStringStream attach_command;
attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
@@ -397,25 +338,102 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
-
cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
mountpoint_regex.find(attach_output.c_str());
+
+ cmOStringStream temp_mount;
temp_mount << mountpoint_regex.match(1);
- cmOStringStream setfile_command;
- setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
- setfile_command << " -a C";
- setfile_command << " \"" << temp_mount.str() << "\"";
+ // Optionally add a custom background image ...
+ // Make sure the background file type is the same as the custom image
+ // and that the file is hidden so it doesn't show up.
+ if(!cpack_dmg_background_image.empty())
+ {
+ const std::string extension =
+ cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
+ cmOStringStream package_background_source;
+ package_background_source << cpack_dmg_background_image;
+
+ cmOStringStream package_background_destination;
+ package_background_destination << temp_mount.str()
+ << "/.background/background" << extension;
+
+ if(!this->CopyFile(package_background_source,
+ package_background_destination))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error copying disk volume background image. "
+ "Check the value of CPACK_DMG_BACKGROUND_IMAGE."
+ << std::endl);
+
+ had_error = true;
+ }
+ }
- if(!this->RunCommand(setfile_command))
+ // Figure out if we have a .DS_Store to install or if we need to run
+ // an apple-script to generate a .DS_Store
+ if(!cpack_dmg_ds_store.empty())
{
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error assigning custom icon to temporary disk image."
- << std::endl);
+ // Optionally add a custom .DS_Store file
+ // (e.g. for setting background/layout) ...
+ cmOStringStream package_settings_source;
+ package_settings_source << cpack_dmg_ds_store;
- return 0;
+ cmOStringStream package_settings_destination;
+ package_settings_destination << temp_mount.str() << "/.DS_Store";
+
+ if(!this->CopyFile(package_settings_source,
+ package_settings_destination))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error copying disk volume settings file. "
+ "Check the value of CPACK_DMG_DS_STORE."
+ << std::endl);
+
+ had_error = true;
+ }
}
+ else if(!cpack_dmg_ds_store_setup_script.empty())
+ {
+ //If you don't have a custom .DS_Store file
+ //we can execute a custom apple script to generate the .DS_Store for
+ //the application. We pass in as arguments to the apple script
+ //the location of the disk image
+ cmOStringStream setup_script_command;
+
+ setup_script_command << "osascript "
+ << cpack_dmg_ds_store_setup_script
+ << " "
+ << "\"" << cpack_dmg_volume_name << "\"";
+
+ if(!this->RunCommand(setup_script_command))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error executing custom script on disk image."
+ << std::endl);
+
+ had_error = true;
+ }
+ }
+
+ if(!cpack_package_icon.empty())
+ {
+ cmOStringStream setfile_command;
+ setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
+ setfile_command << " -a C";
+ setfile_command << " \"" << temp_mount.str() << "\"";
+ if(!this->RunCommand(setfile_command))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error assigning custom icon to temporary disk image."
+ << std::endl);
+
+ had_error = true;
+ }
+ }
+
+ //finish by detaching the package
cmOStringStream detach_command;
detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
detach_command << " detach";
@@ -427,6 +445,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
"Error detaching temporary disk image."
<< std::endl);
+ had_error = true;
+ }
+
+ if(had_error)
+ {
return 0;
}
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=309ffd8ef0e2da664cb459d06ca20f0838dadec3
commit 309ffd8ef0e2da664cb459d06ca20f0838dadec3
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Fri Sep 26 14:38:38 2014 -0400
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Wed Oct 1 15:59:01 2014 -0400
DragNDropGenerator now can run an apple script when making a package.
While the DragNDropGenerator supports custom DS_Store and backgrounds, it is
still very hard to automatically setup nice looking packages. The primary
issue is that the DS_Store embeds the name of the volume in the path
to backgrounds, which means that if a package embeds the version in its
volume name a new DS_Store must generated for each release.
Instead you now can use applescript to setup your DS_Store.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 647c408..dac61b4 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -246,6 +246,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
this->GetOption("CPACK_DMG_DS_STORE")
? this->GetOption("CPACK_DMG_DS_STORE") : "";
+ const std::string cpack_dmg_ds_store_setup_script =
+ this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT")
+ ? this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT") : "";
+
// only put license on dmg if is user provided
if(!cpack_license_file.empty() &&
cpack_license_file.find("CPack.GenericLicense.txt") != std::string::npos)
@@ -284,11 +288,38 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
}
+ // Optionally add a custom background image ...
+ // Make sure the background file type is the same as the custom image
+ // and that the file is hidden so it doesn't show up.
+ if(!cpack_dmg_background_image.empty())
+ {
+ const std::string extension =
+ cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
+ cmOStringStream package_background_source;
+ package_background_source << cpack_dmg_background_image;
- // Optionally add a custom .DS_Store file
- // (e.g. for setting background/layout) ...
+ cmOStringStream package_background_destination;
+ package_background_destination << staging.str()
+ << "/.background/background" << extension;
+
+ if(!this->CopyFile(package_background_source,
+ package_background_destination))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error copying disk volume background image. "
+ "Check the value of CPACK_DMG_BACKGROUND_IMAGE."
+ << std::endl);
+
+ return 0;
+ }
+ }
+
+ // Figure out if we have a .DS_Store to install or if we need to run
+ // an apple-script to generate a .DS_Store
if(!cpack_dmg_ds_store.empty())
{
+ // Optionally add a custom .DS_Store file
+ // (e.g. for setting background/layout) ...
cmOStringStream package_settings_source;
package_settings_source << cpack_dmg_ds_store;
@@ -305,33 +336,25 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
}
-
- // Optionally add a custom background image ...
- // Make sure the background file type is the same as the custom image
- // and that the file is hidden so it doesn't show up.
- if(!cpack_dmg_background_image.empty())
+ else if(!cpack_dmg_ds_store_setup_script.empty())
{
- const std::string extension =
- cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
- cmOStringStream package_background_source;
- package_background_source << cpack_dmg_background_image;
-
- cmOStringStream package_background_destination;
- package_background_destination << staging.str()
- << "/.background/background" << extension;
-
- if(!this->CopyFile(package_background_source,
- package_background_destination))
+ //If you don't have a custom .DS_Store file
+ //we can execute a custom apple script to generate the .DS_Store for
+ //the application
+ cmOStringStream setup_script_command;
+ setup_script_command << "osascript "
+ << cpack_dmg_ds_store_setup_script;
+ if(!this->RunCommand(setup_script_command))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error copying disk volume background image. "
- "Check the value of CPACK_DMG_BACKGROUND_IMAGE."
+ "Error executing custom script on disk image."
<< std::endl);
return 0;
}
}
+
// Create a temporary read-write disk image ...
std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
temp_image += "/temp.dmg";
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7f55ac9f1b720a3338948f6c6883b3658f9d27b
commit a7f55ac9f1b720a3338948f6c6883b3658f9d27b
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Thu Sep 18 13:59:57 2014 -0400
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Wed Oct 1 15:56:00 2014 -0400
DragNDropGenerator now places the background image file in a hidden folder.
by using a hidden folder we avoid the need to mark the file as hidden from
finder, and it makes it easier for future work to refer to the background
image file.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 969f6a3..647c408 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -308,6 +308,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally add a custom background image ...
// Make sure the background file type is the same as the custom image
+ // and that the file is hidden so it doesn't show up.
if(!cpack_dmg_background_image.empty())
{
const std::string extension =
@@ -317,7 +318,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
cmOStringStream package_background_destination;
package_background_destination << staging.str()
- << "/background" << extension;
+ << "/.background/background" << extension;
if(!this->CopyFile(package_background_source,
package_background_destination))
@@ -329,21 +330,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
-
- cmOStringStream temp_background_hiding_command;
- temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE");
- temp_background_hiding_command << " -a V \"";
- temp_background_hiding_command << package_background_destination.str();
- temp_background_hiding_command << "\"";
-
- if(!this->RunCommand(temp_background_hiding_command))
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error setting attributes on disk volume background image."
- << std::endl);
-
- return 0;
- }
}
// Create a temporary read-write disk image ...
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c8b9f506a6b8bdb2a9f036c1c7566adf5d4c5ab
commit 2c8b9f506a6b8bdb2a9f036c1c7566adf5d4c5ab
Author: Robert Maynard <robert.maynard at kitware.com>
AuthorDate: Thu Sep 18 13:59:40 2014 -0400
Commit: Robert Maynard <robert.maynard at kitware.com>
CommitDate: Thu Sep 18 14:41:04 2014 -0400
DragNDropGenerator background image now uses source file extension.
Instead of blindly copying the CPACK_DMG_BACKGROUND_IMAGE file to
background.png, we instead use the same file extension as the source image.
This is needed for proper support of multi resolution tif backgrounds.
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9f0a77e..969f6a3 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -307,13 +307,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
}
// Optionally add a custom background image ...
+ // Make sure the background file type is the same as the custom image
if(!cpack_dmg_background_image.empty())
{
+ const std::string extension =
+ cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
cmOStringStream package_background_source;
package_background_source << cpack_dmg_background_image;
cmOStringStream package_background_destination;
- package_background_destination << staging.str() << "/background.png";
+ package_background_destination << staging.str()
+ << "/background" << extension;
if(!this->CopyFile(package_background_source,
package_background_destination))
-----------------------------------------------------------------------
Summary of changes:
Modules/CPackDMG.cmake | 19 ++-
Source/CPack/cmCPackDragNDropGenerator.cxx | 235 ++++++++++++++++++++--------
2 files changed, 183 insertions(+), 71 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list