[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-418-g844d1e6

Nils Gladitz nilsgladitz at gmail.com
Sun Mar 2 15:46:13 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  844d1e609bd209ea93edb3b15329df707e9a2db7 (commit)
       via  642fa25da095b346d559ad39624eda79b0bd2ff8 (commit)
       via  378eb5b712bb8f131e62aa343e3ec27d446dc098 (commit)
       via  c0afb8867518e7b7ef17d5ce90f1a99051d2fd14 (commit)
      from  964dfe709213d1c3dbcea6984078f64429a6c855 (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=844d1e609bd209ea93edb3b15329df707e9a2db7
commit 844d1e609bd209ea93edb3b15329df707e9a2db7
Merge: 964dfe7 642fa25
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Mar 2 15:46:12 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Mar 2 15:46:12 2014 -0500

    Merge topic 'wix-additions' into next
    
    642fa25d CPackWIX: support installation of empty directories
    378eb5b7 CPackWIX: Allow Windows Installer property customization
    c0afb886 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=642fa25da095b346d559ad39624eda79b0bd2ff8
commit 642fa25da095b346d559ad39624eda79b0bd2ff8
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Mar 2 00:51:42 2014 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Sun Mar 2 00:51:42 2014 +0100

    CPackWIX: support installation of empty directories

diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 1ba43b3..a385e40 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -814,6 +814,16 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
   cmsys::Directory dir;
   dir.Load(topdir.c_str());
 
+  if(dir.GetNumberOfFiles() == 2)
+    {
+    std::string componentId = fileDefinitions.EmitComponentCreateFolder(
+      directoryId, GenerateGUID());
+
+    featureDefinitions.EmitComponentRef(componentId);
+
+    return;
+    }
+
   for(size_t i = 0; i < dir.GetNumberOfFiles(); ++i)
     {
     std::string fileName = dir.GetFile(static_cast<unsigned long>(i));
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index 0835f3a..3fd959e 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -109,6 +109,28 @@ void cmWIXFilesSourceWriter::EmitUninstallShortcut(
   EndElement("Shortcut");
 }
 
+std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder(
+  std::string const& directoryId, std::string const& guid)
+{
+  std::string componentId =
+    std::string("CM_C_EMPTY_") + directoryId;
+
+  BeginElement("DirectoryRef");
+  AddAttribute("Id", directoryId);
+
+  BeginElement("Component");
+  AddAttribute("Id", componentId);
+  AddAttribute("Guid", guid);
+
+  BeginElement("CreateFolder");
+
+  EndElement("CreateFolder");
+  EndElement("Component");
+  EndElement("DirectoryRef");
+
+  return componentId;
+}
+
 std::string cmWIXFilesSourceWriter::EmitComponentFile(
   std::string const& directoryId,
   std::string const& id,
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
index d22d270..13122c2 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
@@ -45,6 +45,10 @@ public:
 
   void EmitUninstallShortcut(std::string const& packageName);
 
+  std::string EmitComponentCreateFolder(
+    std::string const& directoryId,
+    std::string const& guid);
+
   std::string EmitComponentFile(
     std::string const& directoryId,
     std::string const& id,
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index 9957f6b..638e788 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -9,6 +9,11 @@ target_link_libraries(my-libapp mylib)
 
 add_executable(my-other-app myotherapp.cpp)
 
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty
+  DESTINATION extras
+  COMPONENT extras)
+
 install(TARGETS mylib
   ARCHIVE
   DESTINATION lib
@@ -72,6 +77,12 @@ cpack_add_component_group(Development
   EXPANDED
   DESCRIPTION "All of the tools you'll ever need to develop software")
 
+cpack_add_component(extras
+  DISPLAY_NAME "Extras"
+  DESCRIPTION "Extras"
+  GROUP Runtime
+  INSTALL_TYPES Full)
+
 cpack_add_component(applications
   REQUIRED
   DISPLAY_NAME "MyLib Application"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=378eb5b712bb8f131e62aa343e3ec27d446dc098
commit 378eb5b712bb8f131e62aa343e3ec27d446dc098
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sat Mar 1 23:13:35 2014 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Sat Mar 1 23:13:35 2014 +0100

    CPackWIX: Allow Windows Installer property customization

diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 39183c6..0a47e19 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -216,9 +216,24 @@
 #  allow other CMake projects to find your package with
 #  the :command:`find_package` command.
 #
+# .. variable:: CPACK_WIX_PROPERTY_<PROPERTY>
+#
+#  This variable can be used to provide a value for
+#  the Windows Installer property ``<PROPERTY>``
+#
+#  The follwing list contains some example properties that can be used to
+#  customize information under
+#  "Programs and Features" (also known as "Add or Remove Programs")
+#
+#  * ARPCOMMENTS - Comments
+#  * ARPHELPLINK - Help and support information URL
+#  * ARPURLINFOABOUT - General information URL
+#  * URLUPDATEINFO - Update information URL
+#  * ARPHELPTELEPHONE - Help and support telephone number
+#  * ARPSIZE - Size (in kilobytes) of the application
 
 #=============================================================================
-# Copyright 2013 Kitware, Inc.
+# Copyright 2014 Kitware, Inc.
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
diff --git a/Modules/WIX.template.in b/Modules/WIX.template.in
index 59a75c7..bbb7c88 100644
--- a/Modules/WIX.template.in
+++ b/Modules/WIX.template.in
@@ -40,5 +40,7 @@
         <FeatureRef Id="ProductFeature"/>
 
         <UIRef Id="$(var.CPACK_WIX_UI_REF)" />
+
+        <?include "properties.wxi"?>
     </Product>
 </Wix>
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 8e671cc..1ba43b3 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -215,6 +215,13 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
     SetOption("CPACK_WIX_UI_REF", defaultRef.c_str());
     }
 
+  const char* packageContact = GetOption("CPACK_PACKAGE_CONTACT");
+  if(packageContact != 0 &&
+     GetOption("CPACK_WIX_PROPERTY_ARPCONTACT") == 0)
+    {
+    SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact);
+    }
+
   CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
   CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", this->CandleExtensions);
 
@@ -239,6 +246,7 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
     }
 
   CreateWiXVariablesIncludeFile();
+  CreateWiXPropertiesIncludeFile();
 
   if(!CreateWiXSourceFiles())
     {
@@ -315,6 +323,35 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
   CopyDefinition(includeFile, "CPACK_WIX_UI_REF");
 }
 
+void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
+{
+  std::string includeFilename =
+    this->CPackTopLevel + "/properties.wxi";
+
+  cmWIXSourceWriter includeFile(
+    this->Logger, includeFilename, true);
+
+  std::string prefix = "CPACK_WIX_PROPERTY_";
+  std::vector<std::string> options = GetOptions();
+
+  for(size_t i = 0; i < options.size(); ++i)
+    {
+    std::string const& name = options[i];
+
+    if(name.length() > prefix.length() &&
+       name.substr(0, prefix.length()) == prefix)
+      {
+      std::string id = name.substr(prefix.length());
+      std::string value = GetOption(name.c_str());
+
+      includeFile.BeginElement("Property");
+      includeFile.AddAttribute("Id", id);
+      includeFile.AddAttribute("Value", value);
+      includeFile.EndElement("Property");
+      }
+    }
+}
+
 void cmCPackWIXGenerator::CopyDefinition(
   cmWIXSourceWriter &source, std::string const& name)
 {
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index ee66c05..4c9f8c7 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -73,6 +73,8 @@ private:
 
   void CreateWiXVariablesIncludeFile();
 
+  void CreateWiXPropertiesIncludeFile();
+
   void CopyDefinition(
     cmWIXSourceWriter &source, std::string const& name);
 
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 96491aa..e1dd4e9 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1202,6 +1202,12 @@ const char* cmCPackGenerator::GetOption(const char* op) const
 }
 
 //----------------------------------------------------------------------
+std::vector<std::string> cmCPackGenerator::GetOptions() const
+{
+  return this->MakefileMap->GetDefinitions();
+}
+
+//----------------------------------------------------------------------
 int cmCPackGenerator::PackageFiles()
 {
   return 0;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index bb33aa0..b1a7840 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -102,6 +102,7 @@ public:
   void SetOption(const char* op, const char* value);
   void SetOptionIfNotSet(const char* op, const char* value);
   const char* GetOption(const char* op) const;
+  std::vector<std::string> GetOptions() const;
   bool IsSet(const char* name) const;
   bool IsOn(const char* name) const;
 
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index d673d14..9957f6b 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -58,6 +58,9 @@ set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml")
 
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
 
+set(CPACK_WIX_PROPERTY_ARPCOMMENTS "My Custom ARPCOMMENTS")
+set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.cmake.org")
+
 include(CPack)
 
 cpack_add_install_type(Full DISPLAY_NAME "Everything")

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

Summary of changes:
 Modules/CPackWIX.cmake                      |   17 +++++++++-
 Modules/WIX.template.in                     |    2 ++
 Source/CMakeVersion.cmake                   |    2 +-
 Source/CPack/WiX/cmCPackWIXGenerator.cxx    |   47 +++++++++++++++++++++++++++
 Source/CPack/WiX/cmCPackWIXGenerator.h      |    2 ++
 Source/CPack/WiX/cmWIXFilesSourceWriter.cxx |   22 +++++++++++++
 Source/CPack/WiX/cmWIXFilesSourceWriter.h   |    4 +++
 Source/CPack/cmCPackGenerator.cxx           |    6 ++++
 Source/CPack/cmCPackGenerator.h             |    1 +
 Tests/CPackWiXGenerator/CMakeLists.txt      |   14 ++++++++
 10 files changed, 115 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list