summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW/cmCPackIFWGenerator.h
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2014-08-06 15:23:00 (GMT)
committerBrad King <brad.king@kitware.com>2014-08-11 13:40:28 (GMT)
commitebe8d51b11a2633857317aa1c8fe7ec0527c37eb (patch)
treec3bd0458fa91e1f32e8ed4da0879e379caf7078b /Source/CPack/IFW/cmCPackIFWGenerator.h
parent82382479f7d43158d12f75c5ee8dda53edacd8c4 (diff)
downloadCMake-ebe8d51b11a2633857317aa1c8fe7ec0527c37eb.zip
CMake-ebe8d51b11a2633857317aa1c8fe7ec0527c37eb.tar.gz
CMake-ebe8d51b11a2633857317aa1c8fe7ec0527c37eb.tar.bz2
CPackIFW: Refactor and revise this generator
Split the monolithic cmCPackIFWGenerator source into three parts: cmCPackIFWGenerator, cmCPackIFWInstaller, and cmCPackIFWPackage to isolate the implementations somewhat. Add a COMMON option to the cpack_ifw_configure_component command to make the data component common to its parent group. Change the default packaging method to ONE_PACKAGE_PER_COMPONENT. This is not incompatible because the CPack IFW generator has not yet been in a release.
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWGenerator.h')
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.h137
1 files changed, 137 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h
new file mode 100644
index 0000000..e871f7c
--- /dev/null
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.h
@@ -0,0 +1,137 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef cmCPackIFWGenerator_h
+#define cmCPackIFWGenerator_h
+
+#include <CPack/cmCPackGenerator.h>
+
+#include "cmCPackIFWPackage.h"
+#include "cmCPackIFWInstaller.h"
+
+/** \class cmCPackIFWGenerator
+ * \brief A generator for Qt Installer Framework tools
+ *
+ * http://qt-project.org/doc/qtinstallerframework/index.html
+ */
+class cmCPackIFWGenerator : public cmCPackGenerator
+{
+public:
+ cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
+
+ typedef std::map<std::string, cmCPackIFWPackage> PackagesMap;
+ typedef std::map<std::string, cmCPackComponent> ComponentsMap;
+ typedef std::map<std::string, cmCPackComponentGroup> ComponentGoupsMap;
+ typedef std::map<std::string, cmCPackIFWPackage::DependenceStruct>
+ DependenceMap;
+
+ /**
+ * Construct IFW generator
+ */
+ cmCPackIFWGenerator();
+
+ /**
+ * Destruct IFW generator
+ */
+ virtual ~cmCPackIFWGenerator();
+
+protected: // cmCPackGenerator reimplementation
+
+ /**
+ * @brief Initialize generator
+ * @return 0 on failure
+ */
+ virtual int InitializeInternal();
+ virtual int PackageFiles();
+ virtual const char* GetPackagingInstallPrefix();
+
+ /**
+ * @brief Extension of binary installer
+ * @return Executable suffix or value from default implementation
+ */
+ virtual const char* GetOutputExtension();
+
+ virtual std::string GetComponentInstallDirNameSuffix(
+ const std::string& componentName);
+
+ /**
+ * @brief Get Component
+ * @param projectName Project name
+ * @param componentName Component name
+ *
+ * This method calls the base implementation.
+ *
+ * @return Pointer to component
+ */
+ virtual cmCPackComponent* GetComponent(
+ const std::string& projectName,
+ const std::string& componentName);
+
+ /**
+ * @brief Get group of component
+ * @param projectName Project name
+ * @param groupName Component group name
+ *
+ * This method calls the base implementation.
+ *
+ * @return Pointer to component group
+ */
+ virtual cmCPackComponentGroup* GetComponentGroup(
+ const std::string& projectName,
+ const std::string& groupName);
+
+ enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
+ virtual bool SupportsAbsoluteDestination() const;
+ virtual bool SupportsComponentInstallation() const;
+
+protected: // Methods
+
+ bool IsOnePackage() const;
+
+ std::string GetRootPackageName() const;
+
+ std::string GetGroupPackageName(cmCPackComponentGroup *group) const;
+ std::string GetComponentPackageName(cmCPackComponent *component) const;
+
+ cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup *group) const;
+ cmCPackIFWPackage* GetComponentPackage(cmCPackComponent *component) const;
+
+protected: // Data
+
+ friend class cmCPackIFWPackage;
+ friend class cmCPackIFWInstaller;
+
+ // Installer
+ cmCPackIFWInstaller Installer;
+ // Collection of packages
+ PackagesMap Packages;
+ // Collection of binary packages
+ std::set<cmCPackIFWPackage*> BinaryPackages;
+ // Collection of downloaded packages
+ std::set<cmCPackIFWPackage*> DownloadedPackages;
+ // Dependent packages
+ DependenceMap DependentPackages;
+ std::map<cmCPackComponent*, cmCPackIFWPackage*> ComponentPackages;
+ std::map<cmCPackComponentGroup*, cmCPackIFWPackage*> GroupPackages;
+
+private:
+ std::string RepoGen;
+ std::string BinCreator;
+
+ std::string DownloadSite;
+
+ bool OnlineOnly;
+ bool ResolveDuplicateNames;
+ std::vector<std::string> PkgsDirsVector;
+};
+
+#endif