[Cmake-commits] CMake branch, next, updated. v3.5.2-1579-gdc857f9

Brad King brad.king at kitware.com
Wed May 25 09:53:47 EDT 2016


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  dc857f961d48c6a03eb2b0cafc38b8e69629075b (commit)
       via  3acc29fca9395c7e76f0884d182da6da2e022b81 (commit)
      from  cb027b4aa9ffdcdd1fb148bb0157e54acd00dbbe (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc857f961d48c6a03eb2b0cafc38b8e69629075b
commit dc857f961d48c6a03eb2b0cafc38b8e69629075b
Merge: cb027b4 3acc29f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed May 25 09:53:46 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed May 25 09:53:46 2016 -0400

    Merge topic 'cpack-dmg-no-app-link' into next
    
    3acc29fc CPack/DragNDrop: Optionally disable `/Applications` symlink


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3acc29fca9395c7e76f0884d182da6da2e022b81
commit 3acc29fca9395c7e76f0884d182da6da2e022b81
Author:     Harry Mallon <harry at codexdigital.com>
AuthorDate: Wed May 25 13:43:31 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed May 25 09:51:04 2016 -0400

    CPack/DragNDrop: Optionally disable `/Applications` symlink

diff --git a/Help/release/dev/cpack-dmg-no-app-link.rst b/Help/release/dev/cpack-dmg-no-app-link.rst
new file mode 100644
index 0000000..46101a5
--- /dev/null
+++ b/Help/release/dev/cpack-dmg-no-app-link.rst
@@ -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.
diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake
index 1959f22..929b2f6 100644
--- a/Modules/CPackDMG.cmake
+++ b/Modules/CPackDMG.cmake
@@ -46,6 +46,11 @@
 #  CPACK_DMG_DS_STORE_SETUP_SCRIPT is executed or CPACK_DMG_DS_STORE is
 #  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
 #
 #   Directory where license and menu files for different languages are stored.
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()) {

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/cpack-dmg-no-app-link.rst |    6 ++++++
 Modules/CPackDMG.cmake                     |    5 +++++
 Source/CPack/cmCPackDragNDropGenerator.cxx |   15 ++++++++++-----
 3 files changed, 21 insertions(+), 5 deletions(-)
 create mode 100644 Help/release/dev/cpack-dmg-no-app-link.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list