[Cmake-commits] CMake branch, next, updated. v3.7.2-2223-g073b55f

Brad King brad.king at kitware.com
Tue Jan 17 09:36:59 EST 2017


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  073b55ff67c0057b49b94c9ee3d89f6c79db7664 (commit)
       via  3fc4a2b71a25ba4045a8b80e66ecffba54bd0d54 (commit)
      from  9764f958cca5dd910ad7b49ccb804afe69d0f30a (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=073b55ff67c0057b49b94c9ee3d89f6c79db7664
commit 073b55ff67c0057b49b94c9ee3d89f6c79db7664
Merge: 9764f95 3fc4a2b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 17 09:36:58 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 17 09:36:58 2017 -0500

    Merge topic 'cpack-ifw-new-installer-options' into next
    
    3fc4a2b7 QtIFW: Added new options to QtIFW cpack generator for modifying wizard style


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3fc4a2b71a25ba4045a8b80e66ecffba54bd0d54
commit 3fc4a2b71a25ba4045a8b80e66ecffba54bd0d54
Author:     Alexander Voitenko <game.boostify at gmail.com>
AuthorDate: Tue Jan 17 14:12:02 2017 +0300
Commit:     Alexander Voitenko <game.boostify at gmail.com>
CommitDate: Tue Jan 17 14:12:02 2017 +0300

    QtIFW: Added new options to QtIFW cpack generator for modifying wizard style

diff --git a/Help/release/dev/cpack-ifw-package-options.rst b/Help/release/dev/cpack-ifw-package-options.rst
new file mode 100644
index 0000000..1fec324
--- /dev/null
+++ b/Help/release/dev/cpack-ifw-package-options.rst
@@ -0,0 +1,7 @@
+cpack-ifw-package-options
+-------------------------
+
+* The :module:`CPackIFW` module gained new :variable:`CPACK_IFW_PACKAGE_WATERMARK`, :variable:`CPACK_IFW_PACKAGE_BANNER`,
+  :variable:`CPACK_IFW_PACKAGE_BACKGROUND`, :variable:`CPACK_IFW_PACKAGE_WIZARD_STYLE`, :variable:`CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH`,
+  :variable:`CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT` and :variable:`CPACK_IFW_PACKAGE_TITLE_COLOR`
+  variables to customize a QtIFW installer look.
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index b3ab055..ae595fb 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -76,6 +76,34 @@
 #
 #  Filename for a logo is used as QWizard::LogoPixmap.
 #
+# .. variable:: CPACK_IFW_PACKAGE_WATERMARK
+#
+#  Filename for a watermark is used as QWizard::WatermarkPixmap.
+#
+# .. variable:: CPACK_IFW_PACKAGE_BANNER
+#
+#  Filename for a banner is used as QWizard::BannerPixmap.
+#
+# .. variable:: CPACK_IFW_PACKAGE_BACKGROUND
+#
+#  Filename for an image used as QWizard::BackgroundPixmap (only used by MacStyle).
+#
+# .. variable:: CPACK_IFW_PACKAGE_WIZARD_STYLE
+#
+#  Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
+#
+# .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
+#
+#  Default width of the wizard in pixels. Setting a banner image will override this.
+#
+# .. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
+#
+#  Default height of the wizard in pixels. Setting a watermark image will override this.
+#
+# .. variable:: CPACK_IFW_PACKAGE_TITLE_COLOR
+#
+#  Color of the titles and subtitles (takes an HTML color code, such as "#88FF33").
+#
 # .. variable:: CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
 #
 #  Name of the default program group for the product in the Windows Start menu.
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 9ca7750..d8bafee 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -60,6 +60,16 @@ bool cmCPackIFWInstaller::IsVersionEqual(const char* version)
   return Generator ? Generator->IsVersionEqual(version) : false;
 }
 
+void cmCPackIFWInstaller::printSkippedOptionWarning(
+  const std::string& optionName, const std::string& optionValue)
+{
+  cmCPackLogger(
+    cmCPackLog::LOG_WARNING, "Option "
+      << optionName << " is set to \"" << optionValue
+      << "\" but will be skipped because the specified file does not exist."
+      << std::endl);
+}
+
 void cmCPackIFWInstaller::ConfigureFromOptions()
 {
   // Name;
@@ -110,7 +120,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
     if (cmSystemTools::FileExists(option)) {
       InstallerApplicationIcon = option;
     } else {
-      // TODO: implement warning
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option);
     }
   }
 
@@ -119,7 +129,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
     if (cmSystemTools::FileExists(option)) {
       InstallerWindowIcon = option;
     } else {
-      // TODO: implement warning
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option);
     }
   }
 
@@ -128,10 +138,69 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
     if (cmSystemTools::FileExists(option)) {
       Logo = option;
     } else {
-      // TODO: implement warning
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option);
+    }
+  }
+
+  // Watermark
+  if (const char* option = GetOption("CPACK_IFW_PACKAGE_WATERMARK")) {
+    if (cmSystemTools::FileExists(option)) {
+      Watermark = option;
+    } else {
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option);
     }
   }
 
+  // Banner
+  if (const char* option = GetOption("CPACK_IFW_PACKAGE_BANNER")) {
+    if (cmSystemTools::FileExists(option)) {
+      Banner = option;
+    } else {
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option);
+    }
+  }
+
+  // Background
+  if (const char* option = GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) {
+    if (cmSystemTools::FileExists(option)) {
+      Background = option;
+    } else {
+      printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option);
+    }
+  }
+
+  // WizardStyle
+  if (const char* option = GetOption("CPACK_IFW_PACKAGE_WIZARD_STYLE")) {
+    if (WizardStyle.compare("Modern") == 0 &&
+        WizardStyle.compare("Aero") == 0 && WizardStyle.compare("Mac") == 0 &&
+        WizardStyle.compare("Classic") == 0) {
+      cmCPackLogger(
+        cmCPackLog::LOG_WARNING,
+        "Option CPACK_IFW_PACKAGE_WIZARD_STYLE has unknown value \""
+          << option << "\". Expected values are: Modern, Aero, Mac, Classic."
+          << std::endl);
+    }
+
+    WizardStyle = option;
+  }
+
+  // WizardDefaultWidth
+  if (const char* option =
+        GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
+    WizardDefaultWidth = option;
+  }
+
+  // WizardDefaultHeight
+  if (const char* option =
+        GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT")) {
+    WizardDefaultHeight = option;
+  }
+
+  // TitleColor
+  if (const char* option = GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
+    TitleColor = option;
+  }
+
   // Start menu
   if (const char* optIFW_START_MENU_DIR =
         this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
@@ -313,6 +382,50 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
     xout.Element("Logo", name);
   }
 
+  // Banner
+  if (!Banner.empty()) {
+    std::string name = cmSystemTools::GetFilenameName(Banner);
+    std::string path = Directory + "/config/" + name;
+    cmsys::SystemTools::CopyFileIfDifferent(Banner.data(), path.data());
+    xout.Element("Banner", name);
+  }
+
+  // Watermark
+  if (!Watermark.empty()) {
+    std::string name = cmSystemTools::GetFilenameName(Watermark);
+    std::string path = Directory + "/config/" + name;
+    cmsys::SystemTools::CopyFileIfDifferent(Watermark.data(), path.data());
+    xout.Element("Watermark", name);
+  }
+
+  // Background
+  if (!Background.empty()) {
+    std::string name = cmSystemTools::GetFilenameName(Background);
+    std::string path = Directory + "/config/" + name;
+    cmsys::SystemTools::CopyFileIfDifferent(Background.data(), path.data());
+    xout.Element("Background", name);
+  }
+
+  // WizardStyle
+  if (!WizardStyle.empty()) {
+    xout.Element("WizardStyle", WizardStyle);
+  }
+
+  // WizardDefaultWidth
+  if (!WizardDefaultWidth.empty()) {
+    xout.Element("WizardDefaultWidth", WizardDefaultWidth);
+  }
+
+  // WizardDefaultHeight
+  if (!WizardDefaultHeight.empty()) {
+    xout.Element("WizardDefaultHeight", WizardDefaultHeight);
+  }
+
+  // TitleColor
+  if (!TitleColor.empty()) {
+    xout.Element("TitleColor", TitleColor);
+  }
+
   // Start menu
   if (!IsVersionLess("2.0")) {
     xout.Element("StartMenuDir", StartMenuDir);
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h
index eba9bec..4ec3e70 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.h
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.h
@@ -60,6 +60,27 @@ public:
   /// Filename for a logo
   std::string Logo;
 
+  /// Filename for a watermark
+  std::string Watermark;
+
+  /// Filename for a banner
+  std::string Banner;
+
+  /// Filename for a background
+  std::string Background;
+
+  /// Wizard style name
+  std::string WizardStyle;
+
+  /// Wizard width
+  std::string WizardDefaultWidth;
+
+  /// Wizard height
+  std::string WizardDefaultHeight;
+
+  /// Title color
+  std::string TitleColor;
+
   /// Name of the default program group in the Windows Start menu
   std::string StartMenuDir;
 
@@ -110,6 +131,10 @@ public:
 
 protected:
   void WriteGeneratedByToStrim(cmXMLWriter& xout);
+
+private:
+  void printSkippedOptionWarning(const std::string& optionName,
+                                 const std::string& optionValue);
 };
 
 #endif // cmCPackIFWInstaller_h

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

Summary of changes:
 Help/release/dev/cpack-ifw-package-options.rst |    7 ++
 Modules/CPackIFW.cmake                         |   28 ++++++
 Source/CPack/IFW/cmCPackIFWInstaller.cxx       |  119 +++++++++++++++++++++++-
 Source/CPack/IFW/cmCPackIFWInstaller.h         |   25 +++++
 4 files changed, 176 insertions(+), 3 deletions(-)
 create mode 100644 Help/release/dev/cpack-ifw-package-options.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list