diff options
author | Brad King <brad.king@kitware.com> | 2017-01-20 16:54:34 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-01-20 16:54:34 (GMT) |
commit | 395f01ef728b3c41b2cab020aff381814244ebe1 (patch) | |
tree | c4479b8ab3f4c49a8800875ab07587cc40781150 /Source | |
parent | 910ef6d0a3eab5d483759ee23f10e91f1c4da8c2 (diff) | |
parent | 3fc4a2b71a25ba4045a8b80e66ecffba54bd0d54 (diff) | |
download | CMake-395f01ef728b3c41b2cab020aff381814244ebe1.zip CMake-395f01ef728b3c41b2cab020aff381814244ebe1.tar.gz CMake-395f01ef728b3c41b2cab020aff381814244ebe1.tar.bz2 |
Merge topic 'cpack-ifw-new-installer-options'
3fc4a2b7 QtIFW: Added new options to QtIFW cpack generator for modifying wizard style
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 119 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 25 |
2 files changed, 141 insertions, 3 deletions
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 |