Merge topic 'cpack-dmg-no-app-link'
3acc29fc
CPack/DragNDrop: Optionally disable `/Applications` symlink
This commit is contained in:
commit
579185be7a
|
@ -0,0 +1,6 @@
|
||||||
|
cpack-dmg-no-app-link
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
* The :module:`CPackDMG` module learned a new option to tell the CPack
|
||||||
|
``DragNDrop`` generaor to skip the ``/Applications`` symlink.
|
||||||
|
See the :variable:`CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK` variable.
|
|
@ -46,6 +46,11 @@
|
||||||
# CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is
|
# CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is
|
||||||
# installed. By default no background image is set.
|
# installed. By default no background image is set.
|
||||||
#
|
#
|
||||||
|
# .. variable:: CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK
|
||||||
|
#
|
||||||
|
# Default behaviour is to include a symlink to ``/Applications`` in the DMG.
|
||||||
|
# Set this option to ``ON`` to avoid adding the symlink.
|
||||||
|
#
|
||||||
# .. variable:: CPACK_DMG_SLA_DIR
|
# .. variable:: CPACK_DMG_SLA_DIR
|
||||||
#
|
#
|
||||||
# Directory where license and menu files for different languages are stored.
|
# Directory where license and menu files for different languages are stored.
|
||||||
|
|
|
@ -305,6 +305,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
||||||
? this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT")
|
? this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT")
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
|
const bool cpack_dmg_disable_applications_symlink =
|
||||||
|
this->IsOn("CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK");
|
||||||
|
|
||||||
// only put license on dmg if is user provided
|
// only put license on dmg if is user provided
|
||||||
if (!cpack_license_file.empty() &&
|
if (!cpack_license_file.empty() &&
|
||||||
cpack_license_file.find("CPack.GenericLicense.txt") !=
|
cpack_license_file.find("CPack.GenericLicense.txt") !=
|
||||||
|
@ -323,11 +326,13 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
||||||
staging << src_dir;
|
staging << src_dir;
|
||||||
|
|
||||||
// Add a symlink to /Applications so users can drag-and-drop the bundle
|
// Add a symlink to /Applications so users can drag-and-drop the bundle
|
||||||
// into it
|
// into it unless this behaviour was disabled
|
||||||
std::ostringstream application_link;
|
if (!cpack_dmg_disable_applications_symlink) {
|
||||||
application_link << staging.str() << "/Applications";
|
std::ostringstream application_link;
|
||||||
cmSystemTools::CreateSymlink("/Applications",
|
application_link << staging.str() << "/Applications";
|
||||||
application_link.str().c_str());
|
cmSystemTools::CreateSymlink("/Applications",
|
||||||
|
application_link.str().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// Optionally add a custom volume icon ...
|
// Optionally add a custom volume icon ...
|
||||||
if (!cpack_package_icon.empty()) {
|
if (!cpack_package_icon.empty()) {
|
||||||
|
|
Loading…
Reference in New Issue