diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2015-04-27 14:02:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-15 15:02:49 (GMT) |
commit | 9a0ba4d24ae73cf225a07dff2cf4fc2096fb9751 (patch) | |
tree | 2d5db72270f1598daa5598a1f372f56009b3d4f5 /Source/CPack/IFW/cmCPackIFWGenerator.cxx | |
parent | f6a41a441408cb32fcc5fee1a758627cdf4f9031 (diff) | |
download | CMake-9a0ba4d24ae73cf225a07dff2cf4fc2096fb9751.zip CMake-9a0ba4d24ae73cf225a07dff2cf4fc2096fb9751.tar.gz CMake-9a0ba4d24ae73cf225a07dff2cf4fc2096fb9751.tar.bz2 |
CPackIFW: Add QtIFW 2.0 support
Add variables:
- CPACK_IFW_FRAMEWORK_VERSION
- CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
- CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
- CPACK_IFW_PACKAGE_CONTROL_SCRIPT
- CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
- CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
- CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
- CPACK_IFW_VERBOSE
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWGenerator.cxx')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 0439ff6..80ba068 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -29,6 +29,8 @@ #include <cmMakefile.h> #include <cmGeneratedFileStream.h> #include <cmXMLSafe.h> +#include <cmVersionConfig.h> +#include <cmTimestamp.h> //---------------------------------------------------------------------------- cmCPackIFWGenerator::cmCPackIFWGenerator() @@ -41,6 +43,27 @@ cmCPackIFWGenerator::~cmCPackIFWGenerator() } //---------------------------------------------------------------------------- +bool cmCPackIFWGenerator::IsVersionLess(const char *version) +{ + return cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, + FrameworkVersion.data(), version); +} + +//---------------------------------------------------------------------------- +bool cmCPackIFWGenerator::IsVersionGreater(const char *version) +{ + return cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER, + FrameworkVersion.data(), version); +} + +//---------------------------------------------------------------------------- +bool cmCPackIFWGenerator::IsVersionEqual(const char *version) +{ + return cmSystemTools::VersionCompare(cmSystemTools::OP_EQUAL, + FrameworkVersion.data(), version); +} + +//---------------------------------------------------------------------------- int cmCPackIFWGenerator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Configuration" << std::endl); @@ -59,7 +82,12 @@ int cmCPackIFWGenerator::PackageFiles() if (!Installer.Repositories.empty()) { std::string ifwCmd = RepoGen; - ifwCmd += " -c " + this->toplevel + "/config/config.xml"; + + if(IsVersionLess("2.0.0")) + { + ifwCmd += " -c " + this->toplevel + "/config/config.xml"; + } + ifwCmd += " -p " + this->toplevel + "/packages"; if(!PkgsDirsVector.empty()) @@ -216,8 +244,7 @@ const char *cmCPackIFWGenerator::GetPackagingInstallPrefix() //---------------------------------------------------------------------------- const char *cmCPackIFWGenerator::GetOutputExtension() { - const char *suffix = this->GetOption("CMAKE_EXECUTABLE_SUFFIX"); - return suffix ? suffix : cmCPackGenerator::GetOutputExtension(); + return ExecutableSuffix.c_str(); } //---------------------------------------------------------------------------- @@ -267,6 +294,17 @@ int cmCPackIFWGenerator::InitializeInternal() RepoGen = RepoGenStr; } + // Framework version + if(const char* FrameworkVersionSrt = + this->GetOption("CPACK_IFW_FRAMEWORK_VERSION")) + { + FrameworkVersion = FrameworkVersionSrt; + } + else + { + FrameworkVersion = "1.9.9"; + } + // Variables that Change Behavior // Resolve duplicate names @@ -307,6 +345,24 @@ int cmCPackIFWGenerator::InitializeInternal() return 0; } + // Executable suffix + if(const char *optExeSuffix = this->GetOption("CMAKE_EXECUTABLE_SUFFIX")) + { + ExecutableSuffix = optExeSuffix; + if(ExecutableSuffix.empty()) + { + std::string sysName(this->GetOption("CMAKE_SYSTEM_NAME")); + if(sysName == "Linux") + { + ExecutableSuffix = ".run"; + } + } + } + else + { + ExecutableSuffix = cmCPackGenerator::GetOutputExtension(); + } + return this->Superclass::InitializeInternal(); } @@ -552,3 +608,20 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage( = ComponentPackages.find(component); return pit != ComponentPackages.end() ? pit->second : 0; } + +//---------------------------------------------------------------------------- +void cmCPackIFWGenerator::WriteGeneratedByToStrim(cmGeneratedFileStream &xout) +{ + xout << "<!-- Generated by CPack " << CMake_VERSION << " IFW generator " + << "for QtIFW "; + if(IsVersionLess("2.0")) + { + xout << "less 2.0"; + } + else + { + xout << FrameworkVersion; + } + xout << " tools at " << cmTimestamp().CurrentTime("", true) << " -->" + << std::endl; +} |