summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorHarry Mallon <harry@codexdigital.com>2016-05-25 12:43:31 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-25 13:51:04 (GMT)
commit3acc29fca9395c7e76f0884d182da6da2e022b81 (patch)
tree254f0db5c5af833698cd6b845862cf652c37d91e /Source
parent6052e4b3bfe62a8d29ca679affb101c7aec0d219 (diff)
downloadCMake-3acc29fca9395c7e76f0884d182da6da2e022b81.zip
CMake-3acc29fca9395c7e76f0884d182da6da2e022b81.tar.gz
CMake-3acc29fca9395c7e76f0884d182da6da2e022b81.tar.bz2
CPack/DragNDrop: Optionally disable `/Applications` symlink
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9576eff..f4379c1 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -305,6 +305,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
? 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
if (!cpack_license_file.empty() &&
cpack_license_file.find("CPack.GenericLicense.txt") !=
@@ -323,11 +326,13 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
staging << src_dir;
// Add a symlink to /Applications so users can drag-and-drop the bundle
- // into it
- std::ostringstream application_link;
- application_link << staging.str() << "/Applications";
- cmSystemTools::CreateSymlink("/Applications",
- application_link.str().c_str());
+ // into it unless this behaviour was disabled
+ if (!cpack_dmg_disable_applications_symlink) {
+ std::ostringstream application_link;
+ application_link << staging.str() << "/Applications";
+ cmSystemTools::CreateSymlink("/Applications",
+ application_link.str().c_str());
+ }
// Optionally add a custom volume icon ...
if (!cpack_package_icon.empty()) {