summaryrefslogtreecommitdiff
path: root/Source/CPack/IFW/cmCPackIFWPackage.h
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2014-08-06 11:23:00 -0400
committerBrad King <brad.king@kitware.com>2014-08-11 09:40:28 -0400
commitebe8d51b11a2633857317aa1c8fe7ec0527c37eb (patch)
treec3bd0458fa91e1f32e8ed4da0879e379caf7078b /Source/CPack/IFW/cmCPackIFWPackage.h
parent82382479f7d43158d12f75c5ee8dda53edacd8c4 (diff)
downloadcmake-ebe8d51b11a2633857317aa1c8fe7ec0527c37eb.tar.gz
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/cmCPackIFWPackage.h')
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h
new file mode 100644
index 0000000000..868c15d365
--- /dev/null
+++ b/Source/CPack/IFW/cmCPackIFWPackage.h
@@ -0,0 +1,131 @@
+/*============================================================================
+ 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 cmCPackIFWPackage_h
+#define cmCPackIFWPackage_h
+
+#include "cmStandardIncludes.h"
+
+class cmCPackComponent;
+class cmCPackComponentGroup;
+class cmCPackIFWInstaller;
+class cmCPackIFWGenerator;
+
+/** \class cmCPackIFWPackage
+ * \brief A single component to be installed by CPack IFW generator
+ */
+class cmCPackIFWPackage
+{
+public: // Types
+ enum CompareTypes
+ {
+ CompareNone = 0x0,
+ CompareEqual = 0x1,
+ CompareLess = 0x2,
+ CompareLessOrEqual = 0x3,
+ CompareGreater = 0x4,
+ CompareGreaterOrEqual = 0x5
+ };
+
+ struct CompareStruct
+ {
+ CompareStruct();
+
+ unsigned int Type;
+ std::string Value;
+ };
+
+ struct DependenceStruct
+ {
+ DependenceStruct();
+ DependenceStruct(const std::string &dependence);
+
+ std::string Name;
+ CompareStruct Compare;
+
+ std::string NameWithCompare() const;
+
+ bool operator < (const DependenceStruct &other) const
+ {
+ return Name < other.Name;
+ }
+ };
+
+public: // [Con|De]structor
+
+ /**
+ * Construct package
+ */
+ cmCPackIFWPackage();
+
+public: // Configuration
+
+ /// Human-readable name of the component
+ std::string DisplayName;
+
+ /// Human-readable description of the component
+ std::string Description;
+
+ /// Version number of the component
+ std::string Version;
+
+ /// Date when this component version was released
+ std::string ReleaseDate;
+
+ /// Domain-like identification for this component
+ std::string Name;
+
+ /// File name of a script being loaded
+ std::string Script;
+
+ /// List of license agreements to be accepted by the installing user
+ std::vector<std::string> Licenses;
+
+ /// Priority of the component in the tree
+ std::string SortingPriority;
+
+ /// Set to true to preselect the component in the installer
+ std::string Default;
+
+ /// Set to true to hide the component from the installer
+ std::string Virtual;
+
+ /// Determines that the package must always be installed
+ std::string ForcedInstallation;
+
+public: // Internal implementation
+
+ const char* GetOption(const std::string& op) const;
+
+ std::string GetComponentName(cmCPackComponent *component);
+
+ void DefaultConfiguration();
+
+ int ConfigureFromOptions();
+ int ConfigureFromComponent(cmCPackComponent *component);
+ int ConfigureFromComponentGroup(cmCPackComponentGroup *group);
+
+ void GeneratePackageFile();
+
+ // Pointer to generator
+ cmCPackIFWGenerator* Generator;
+ // Pointer to installer
+ cmCPackIFWInstaller* Installer;
+ // Collection of dependencies
+ std::set<cmCPackIFWPackage*> Dependencies;
+ // Collection of unresolved dependencies
+ std::set<DependenceStruct*> AlienDependencies;
+ // Patch to package directory
+ std::string Directory;
+};
+
+#endif // cmCPackIFWPackage_h