diff options
Diffstat (limited to 'Source/CPack')
48 files changed, 309 insertions, 120 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 4a5eb90..a6f1585 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -12,21 +12,20 @@ #include "cmCPackIFWGenerator.h" -#include <CPack/cmCPackComponentGroup.h> -#include <CPack/cmCPackLog.h> - -#include <cmsys/Directory.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> -#include <cmsys/SystemTools.hxx> - -#include <cmGeneratedFileStream.h> -#include <cmGlobalGenerator.h> -#include <cmMakefile.h> -#include <cmSystemTools.h> -#include <cmTimestamp.h> -#include <cmVersionConfig.h> -#include <cmXMLWriter.h> +#include "CPack/cmCPackComponentGroup.h" +#include "CPack/cmCPackGenerator.h" +#include "CPack/cmCPackLog.h" +#include "cmCPackIFWInstaller.h" +#include "cmCPackIFWPackage.h" +#include "cmCPackIFWRepository.h" +#include "cmGeneratedFileStream.h" +#include "cmSystemTools.h" +#include "cmTimestamp.h" +#include "cmVersionConfig.h" +#include "cmXMLWriter.h" + +#include <sstream> +#include <utility> cmCPackIFWGenerator::cmCPackIFWGenerator() { diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index 12f2ca6..17d61bf 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -13,11 +13,19 @@ #ifndef cmCPackIFWGenerator_h #define cmCPackIFWGenerator_h -#include <CPack/cmCPackGenerator.h> +#include <cmConfigure.h> +#include "CPack/cmCPackComponentGroup.h" +#include "CPack/cmCPackGenerator.h" #include "cmCPackIFWInstaller.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" +#include "cmTypeMacro.h" + +#include <map> +#include <set> +#include <string> +#include <vector> class cmXMLWriter; diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 13a3613..5a3efc9 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -12,12 +12,16 @@ #include "cmCPackIFWInstaller.h" +#include "CPack/cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" - -#include <CPack/cmCPackLog.h> - -#include <cmGeneratedFileStream.h> -#include <cmXMLWriter.h> +#include "cmCPackIFWPackage.h" +#include "cmCPackIFWRepository.h" +#include "cmGeneratedFileStream.h" +#include "cmSystemTools.h" +#include "cmXMLWriter.h" + +#include <cmConfigure.h> +#include <utility> #ifdef cmCPackLogger #undef cmCPackLogger diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index 3170116..f72d379 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -13,10 +13,14 @@ #ifndef cmCPackIFWInstaller_h #define cmCPackIFWInstaller_h -#include <cmStandardIncludes.h> +#include <cmConfigure.h> // IWYU pragma: keep + +#include <map> +#include <string> +#include <vector> -class cmCPackIFWPackage; class cmCPackIFWGenerator; +class cmCPackIFWPackage; class cmCPackIFWRepository; class cmXMLWriter; diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 5db06e6..bc503fc 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -12,13 +12,20 @@ #include "cmCPackIFWPackage.h" +#include "CPack/cmCPackComponentGroup.h" +#include "CPack/cmCPackGenerator.h" +#include "CPack/cmCPackLog.h" #include "cmCPackIFWGenerator.h" - -#include <CPack/cmCPackLog.h> - -#include <cmGeneratedFileStream.h> -#include <cmTimestamp.h> -#include <cmXMLWriter.h> +#include "cmCPackIFWInstaller.h" +#include "cmGeneratedFileStream.h" +#include "cmSystemTools.h" +#include "cmTimestamp.h" +#include "cmXMLWriter.h" + +#include <cmConfigure.h> +#include <map> +#include <sstream> +#include <stddef.h> //----------------------------------------------------------------- Logger --- #ifdef cmCPackLogger diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index 55b07ec..579eeb8 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -13,12 +13,16 @@ #ifndef cmCPackIFWPackage_h #define cmCPackIFWPackage_h -#include <cmStandardIncludes.h> +#include <cmConfigure.h> // IWYU pragma: keep + +#include <set> +#include <string> +#include <vector> class cmCPackComponent; class cmCPackComponentGroup; -class cmCPackIFWInstaller; class cmCPackIFWGenerator; +class cmCPackIFWInstaller; class cmXMLWriter; /** \class cmCPackIFWPackage diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index fcb1c77..947e420 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -12,13 +12,15 @@ #include "cmCPackIFWRepository.h" +#include "CPack/cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" +#include "cmGeneratedFileStream.h" +#include "cmSystemTools.h" +#include "cmXMLParser.h" +#include "cmXMLWriter.h" -#include <CPack/cmCPackLog.h> - -#include <cmGeneratedFileStream.h> -#include <cmXMLParser.h> -#include <cmXMLWriter.h> +#include <cmConfigure.h> +#include <stddef.h> #ifdef cmCPackLogger #undef cmCPackLogger diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h index 5ffb775..a0c535b 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.h +++ b/Source/CPack/IFW/cmCPackIFWRepository.h @@ -13,7 +13,10 @@ #ifndef cmCPackIFWRepository_h #define cmCPackIFWRepository_h -#include <cmStandardIncludes.h> +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string> +#include <vector> class cmCPackIFWGenerator; class cmXMLWriter; diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index d7f69a1..85e0ae3 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -35,6 +35,7 @@ cmCPackWIXGenerator::cmCPackWIXGenerator() : Patch(0) + , ComponentGuidType(cmWIXSourceWriter::WIX_GENERATED_GUID) { } @@ -234,6 +235,12 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() } } + // if install folder is supposed to be set absolutely, the default + // component guid "*" cannot be used + if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { + this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID; + } + return true; } @@ -317,7 +324,9 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/cpack_variables.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_GUID"); CopyDefinition(includeFile, "CPACK_WIX_UPGRADE_GUID"); @@ -338,7 +347,9 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/properties.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); std::string prefix = "CPACK_WIX_PROPERTY_"; std::vector<std::string> options = GetOptions(); @@ -386,7 +397,9 @@ void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile() { std::string includeFilename = this->CPackTopLevel + "/product_fragment.wxi"; - cmWIXSourceWriter includeFile(this->Logger, includeFilename, true); + cmWIXSourceWriter includeFile(this->Logger, includeFilename, + this->ComponentGuidType, + cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT); this->Patch->ApplyFragment("#PRODUCT", includeFile); } @@ -413,13 +426,15 @@ void cmCPackWIXGenerator::AddDefinition(cmWIXSourceWriter& source, bool cmCPackWIXGenerator::CreateWiXSourceFiles() { + // if install folder is supposed to be set absolutely, the default + // component guid "*" cannot be used std::string directoryDefinitionsFilename = this->CPackTopLevel + "/directories.wxs"; this->WixSources.push_back(directoryDefinitionsFilename); cmWIXDirectoriesSourceWriter directoryDefinitions( - this->Logger, directoryDefinitionsFilename); + this->Logger, directoryDefinitionsFilename, this->ComponentGuidType); directoryDefinitions.BeginElement("Fragment"); std::string installRoot; @@ -439,13 +454,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() this->WixSources.push_back(fileDefinitionsFilename); - cmWIXFilesSourceWriter fileDefinitions(this->Logger, - fileDefinitionsFilename); - - // if install folder is supposed to be set absolutely, the default - // component guid "*" cannot be used - fileDefinitions.GenerateComponentGuids = - cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER")); + cmWIXFilesSourceWriter fileDefinitions(this->Logger, fileDefinitionsFilename, + this->ComponentGuidType); fileDefinitions.BeginElement("Fragment"); @@ -454,8 +464,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() this->WixSources.push_back(featureDefinitionsFilename); - cmWIXFeaturesSourceWriter featureDefinitions(this->Logger, - featureDefinitionsFilename); + cmWIXFeaturesSourceWriter featureDefinitions( + this->Logger, featureDefinitionsFilename, this->ComponentGuidType); featureDefinitions.BeginElement("Fragment"); @@ -764,7 +774,8 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType( fileDefinitions.BeginElement("Component"); fileDefinitions.AddAttribute("Id", componentId); - fileDefinitions.AddAttribute("Guid", "*"); + fileDefinitions.AddAttribute( + "Guid", fileDefinitions.CreateGuidFromComponentId(componentId)); this->Patch->ApplyFragment(componentId, fileDefinitions); diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 9d3a522..883df9a 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -162,6 +162,8 @@ private: std::string CPackTopLevel; cmWIXPatch* Patch; + + cmWIXSourceWriter::GuidType ComponentGuidType; }; #endif diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx index 97e3a51..9704195 100644 --- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx @@ -13,8 +13,8 @@ #include "cmWIXDirectoriesSourceWriter.h" cmWIXDirectoriesSourceWriter::cmWIXDirectoriesSourceWriter( - cmCPackLog* logger, std::string const& filename) - : cmWIXSourceWriter(logger, filename) + cmCPackLog* logger, std::string const& filename, GuidType componentGuidType) + : cmWIXSourceWriter(logger, filename, componentGuidType) { } diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h index 023f4b8..6ebe281 100644 --- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h @@ -25,8 +25,8 @@ class cmWIXDirectoriesSourceWriter : public cmWIXSourceWriter { public: - cmWIXDirectoriesSourceWriter(cmCPackLog* logger, - std::string const& filename); + cmWIXDirectoriesSourceWriter(cmCPackLog* logger, std::string const& filename, + GuidType componentGuidType); void EmitStartMenuFolder(std::string const& startMenuFolder); diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx index 1747b62..7794935 100644 --- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx @@ -13,8 +13,8 @@ #include "cmWIXFeaturesSourceWriter.h" cmWIXFeaturesSourceWriter::cmWIXFeaturesSourceWriter( - cmCPackLog* logger, std::string const& filename) - : cmWIXSourceWriter(logger, filename) + cmCPackLog* logger, std::string const& filename, GuidType componentGuidType) + : cmWIXSourceWriter(logger, filename, componentGuidType) { } @@ -24,7 +24,7 @@ void cmWIXFeaturesSourceWriter::CreateCMakePackageRegistryEntry( BeginElement("Component"); AddAttribute("Id", "CM_PACKAGE_REGISTRY"); AddAttribute("Directory", "TARGETDIR"); - AddAttribute("Guid", "*"); + AddAttribute("Guid", CreateGuidFromComponentId("CM_PACKAGE_REGISTRY")); std::string registryKey = std::string("Software\\Kitware\\CMake\\Packages\\") + package; diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h index ee9c17a..9974b63 100644 --- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h @@ -23,7 +23,8 @@ class cmWIXFeaturesSourceWriter : public cmWIXSourceWriter { public: - cmWIXFeaturesSourceWriter(cmCPackLog* logger, std::string const& filename); + cmWIXFeaturesSourceWriter(cmCPackLog* logger, std::string const& filename, + GuidType componentGuidType); void CreateCMakePackageRegistryEntry(std::string const& package, std::string const& upgradeGuid); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index dde9635..846edde 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -24,9 +24,9 @@ #include <sys/stat.h> cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger, - std::string const& filename) - : cmWIXSourceWriter(logger, filename) - , GenerateComponentGuids(false) + std::string const& filename, + GuidType componentGuidType) + : cmWIXSourceWriter(logger, filename, componentGuidType) { } @@ -130,13 +130,7 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile( std::string componentId = std::string("CM_C") + id; std::string fileId = std::string("CM_F") + id; - std::string guid = "*"; - if (this->GenerateComponentGuids) { - std::string md5 = cmSystemTools::ComputeStringMD5(componentId); - cmUuid uuid; - std::vector<unsigned char> ns; - guid = uuid.FromMd5(ns, md5); - } + std::string guid = CreateGuidFromComponentId(componentId); BeginElement("DirectoryRef"); AddAttribute("Id", directoryId); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index eeb84cb..c1952af 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -26,7 +26,8 @@ class cmWIXFilesSourceWriter : public cmWIXSourceWriter { public: - cmWIXFilesSourceWriter(cmCPackLog* logger, std::string const& filename); + cmWIXFilesSourceWriter(cmCPackLog* logger, std::string const& filename, + GuidType componentGuidType); void EmitShortcut(std::string const& id, cmWIXShortcut const& shortcut, std::string const& shortcutPrefix, size_t shortcutIndex); @@ -47,8 +48,6 @@ public: std::string const& id, std::string const& filePath, cmWIXPatch& patch, cmInstalledFile const* installedFile); - - bool GenerateComponentGuids; }; #endif diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index 2c0384e..a287424 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -14,19 +14,23 @@ #include <CPack/cmCPackGenerator.h> +#include <cmUuid.h> + #include <windows.h> cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger, std::string const& filename, - bool isIncludeFile) + GuidType componentGuidType, + RootElementType rootElementType) : Logger(logger) , File(filename.c_str()) , State(DEFAULT) , SourceFilename(filename) + , ComponentGuidType(componentGuidType) { WriteXMLDeclaration(); - if (isIncludeFile) { + if (rootElementType == INCLUDE_ELEMENT_ROOT) { BeginElement("Include"); } else { BeginElement("Wix"); @@ -173,6 +177,19 @@ std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) #endif } +std::string cmWIXSourceWriter::CreateGuidFromComponentId( + std::string const& componentId) +{ + std::string guid = "*"; + if (this->ComponentGuidType == CMAKE_GENERATED_GUID) { + std::string md5 = cmSystemTools::ComputeStringMD5(componentId); + cmUuid uuid; + std::vector<unsigned char> ns; + guid = uuid.FromMd5(ns, md5); + } + return guid; +} + void cmWIXSourceWriter::WriteXMLDeclaration() { File << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index 4efc026..c29ffa7 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -26,8 +26,21 @@ class cmWIXSourceWriter { public: + enum GuidType + { + WIX_GENERATED_GUID, + CMAKE_GENERATED_GUID + }; + + enum RootElementType + { + WIX_ELEMENT_ROOT, + INCLUDE_ELEMENT_ROOT + }; + cmWIXSourceWriter(cmCPackLog* logger, std::string const& filename, - bool isIncludeFile = false); + GuidType componentGuidType, + RootElementType rootElementType = WIX_ELEMENT_ROOT); ~cmWIXSourceWriter(); @@ -45,6 +58,8 @@ public: void AddAttributeUnlessEmpty(std::string const& key, std::string const& value); + std::string CreateGuidFromComponentId(std::string const& componentId); + static std::string CMakeEncodingToUtf8(std::string const& value); protected: @@ -70,6 +85,8 @@ private: std::vector<std::string> Elements; std::string SourceFilename; + + GuidType ComponentGuidType; }; #endif diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx index b01c216..39d2e54 100644 --- a/Source/CPack/cmCPack7zGenerator.cxx +++ b/Source/CPack/cmCPack7zGenerator.cxx @@ -12,6 +12,9 @@ #include "cmCPack7zGenerator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPack7zGenerator::cmCPack7zGenerator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, "7zip") { diff --git a/Source/CPack/cmCPack7zGenerator.h b/Source/CPack/cmCPack7zGenerator.h index ddbcc34..94add69 100644 --- a/Source/CPack/cmCPack7zGenerator.h +++ b/Source/CPack/cmCPack7zGenerator.h @@ -13,7 +13,11 @@ #ifndef cmCPack7zGenerator_h #define cmCPack7zGenerator_h +#include <cmConfigure.h> + #include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPack7zGenerator * \brief A generator for 7z files diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 377fee1..ddf2ccb 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -12,17 +12,16 @@ #include "cmCPackArchiveGenerator.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" -#include "cmake.h" -#include <errno.h> -#include <cm_libarchive.h> -#include <cmsys/Directory.hxx> -#include <cmsys/SystemTools.hxx> +#include <map> +#include <ostream> +#include <utility> +#include <vector> cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, std::string const& format) diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index a018ebd..6db6fb0 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -13,9 +13,16 @@ #ifndef cmCPackArchiveGenerator_h #define cmCPackArchiveGenerator_h -#include "cmCPackGenerator.h" +#include <cmConfigure.h> #include "cmArchiveWrite.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" + +#include <iosfwd> +#include <string> + +class cmCPackComponent; /** \class cmCPackArchiveGenerator * \brief A generator base for libarchive generation. diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index 78b81b3..8e9218e 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -15,7 +15,8 @@ #include <cmConfigure.h> -#include "cmStandardIncludes.h" +#include <string> +#include <vector> class cmCPackComponentGroup; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index b909598..2e18265 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -13,16 +13,21 @@ #include "cmCPackDebGenerator.h" #include "cmArchiveWrite.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmMakefile.h" #include "cmSystemTools.h" #include <cmsys/Glob.hxx> -#include <cmsys/SystemTools.hxx> - -#include <limits.h> // USHRT_MAX +#include <limits.h> +#include <map> +#include <ostream> +#include <set> +#include <stdio.h> +#include <string.h> #include <sys/stat.h> +#include <utility> // NOTE: // A debian package .deb is simply an 'ar' archive. The only subtle difference @@ -743,14 +748,6 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix( * SUCH DAMAGE. */ -#include <sys/types.h> -// include sys/stat.h after sys/types.h -#include <sys/stat.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - #define ARMAG "!<arch>\n" /* ar "magic number" */ #define SARMAG 8 /* strlen(ARMAG); */ diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index bcdc509..c76bf99 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -13,7 +13,13 @@ #ifndef cmCPackDebGenerator_h #define cmCPackDebGenerator_h +#include <cmConfigure.h> + #include "cmCPackGenerator.h" +#include "cmTypeMacro.h" + +#include <string> +#include <vector> /** \class cmCPackDebGenerator * \brief A generator for Debian packages diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 96c218c..d6b58f2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -17,14 +17,17 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmState.h" #include "cmXMLSafe.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" #include <algorithm> #include <cmsys/FStream.hxx> #include <cmsys/Glob.hxx> -#include <cmsys/SystemTools.hxx> +#include <cmsys/RegularExpression.hxx> #include <list> +#include <utility> #if defined(__HAIKU__) #include <FindDirectory.h> diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 23e4bb7..f89f349 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -13,15 +13,21 @@ #ifndef cmCPackGenerator_h #define cmCPackGenerator_h -#include "cmObject.h" +#include <cmConfigure.h> +#include "cmCPackComponentGroup.h" +#include "cmObject.h" #include "cmSystemTools.h" +#include "cmTypeMacro.h" + #include <map> +#include <sstream> +#include <string> #include <vector> -#include "cmCPackComponentGroup.h" // cmCPackComponent and friends -// Forward declarations are insufficient since we use them in -// std::map data members below... +class cmCPackLog; +class cmInstalledFile; +class cmMakefile; #define cmCPackTypeMacro(klass, superclass) \ cmTypeMacro(klass, superclass); \ @@ -46,10 +52,6 @@ #endif #define cout no_cout_use_cmCPack_Log -class cmMakefile; -class cmCPackLog; -class cmInstalledFile; - /** \class cmCPackGenerator * \brief A superclass of all CPack Generators * diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 0f0268f..fb84739 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -49,6 +49,9 @@ #include "cmAlgorithms.h" #include "cmCPackLog.h" +#include <ostream> +#include <utility> + cmCPackGeneratorFactory::cmCPackGeneratorFactory() { if (cmCPackTGZGenerator::CanGenerate()) { diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h index f0ed57a..4c07ea3 100644 --- a/Source/CPack/cmCPackGeneratorFactory.h +++ b/Source/CPack/cmCPackGeneratorFactory.h @@ -13,10 +13,17 @@ #ifndef cmCPackGeneratorFactory_h #define cmCPackGeneratorFactory_h +#include <cmConfigure.h> + #include "cmObject.h" +#include "cmTypeMacro.h" + +#include <map> +#include <string> +#include <vector> -class cmCPackLog; class cmCPackGenerator; +class cmCPackLog; /** \class cmCPackGeneratorFactory * \brief A container for CPack generators diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 339323e..8439de1 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -15,6 +15,8 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include <iostream> + cmCPackLog::cmCPackLog() { this->Verbose = false; diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 77f0f0b..c1bf82c 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -13,7 +13,14 @@ #ifndef cmCPackLog_h #define cmCPackLog_h +#include <cmConfigure.h> + #include "cmObject.h" +#include "cmTypeMacro.h" + +#include <ostream> +#include <string.h> +#include <string> #define cmCPack_Log(ctSelf, logType, msg) \ do { \ diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index d8ff907..2db94f1 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -13,16 +13,19 @@ #include "cmCPackNSISGenerator.h" #include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" +#include <algorithm> #include <cmsys/Directory.hxx> -#include <cmsys/Glob.hxx> #include <cmsys/RegularExpression.hxx> -#include <cmsys/SystemTools.hxx> +#include <map> +#include <sstream> +#include <stdlib.h> +#include <string.h> +#include <utility> /* NSIS uses different command line syntax on Windows and others */ #ifdef _WIN32 diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index 4923cf0..ae03e6b 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -13,9 +13,18 @@ #ifndef cmCPackNSISGenerator_h #define cmCPackNSISGenerator_h +#include <cmConfigure.h> + #include "cmCPackGenerator.h" +#include "cmTypeMacro.h" +#include <iosfwd> #include <set> +#include <string> +#include <vector> + +class cmCPackComponent; +class cmCPackComponentGroup; /** \class cmCPackNSISGenerator * \brief A generator for NSIS files diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 5d81a49..0f2e9b9 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -11,9 +11,17 @@ ============================================================================*/ #include "cmCPackRPMGenerator.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmSystemTools.h" +#include <algorithm> +#include <map> +#include <ostream> +#include <utility> +#include <vector> + cmCPackRPMGenerator::cmCPackRPMGenerator() { } diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 4baef08..10c5572 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -13,7 +13,12 @@ #ifndef cmCPackRPMGenerator_h #define cmCPackRPMGenerator_h +#include <cmConfigure.h> + #include "cmCPackGenerator.h" +#include "cmTypeMacro.h" + +#include <string> /** \class cmCPackRPMGenerator * \brief A generator for RPM packages diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 4d07a7e..4c33a08 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -12,13 +12,15 @@ #include "cmCPackSTGZGenerator.h" +#include "cmCPackGenerator.h" #include "cmCPackLog.h" -#include "cmGlobalGenerator.h" -#include "cmMakefile.h" #include "cmSystemTools.h" -#include "cmake.h" #include <cmsys/FStream.hxx> +#include <sstream> +#include <stdio.h> +#include <string> +#include <vector> #include <sys/types.h> // include sys/stat.h after sys/types.h diff --git a/Source/CPack/cmCPackSTGZGenerator.h b/Source/CPack/cmCPackSTGZGenerator.h index 94cc8aa..2a68f2c 100644 --- a/Source/CPack/cmCPackSTGZGenerator.h +++ b/Source/CPack/cmCPackSTGZGenerator.h @@ -13,7 +13,13 @@ #ifndef cmCPackSTGZGenerator_h #define cmCPackSTGZGenerator_h +#include <cmConfigure.h> + +#include "cmCPackGenerator.h" #include "cmCPackTGZGenerator.h" +#include "cmTypeMacro.h" + +#include <iosfwd> /** \class cmCPackSTGZGenerator * \brief A generator for Self extractable TGZ files diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index 7c5c245..8df53a8 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -12,6 +12,9 @@ #include "cmCPackTGZGenerator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPackTGZGenerator::cmCPackTGZGenerator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, "paxr") { diff --git a/Source/CPack/cmCPackTGZGenerator.h b/Source/CPack/cmCPackTGZGenerator.h index cb7620c..78cd109 100644 --- a/Source/CPack/cmCPackTGZGenerator.h +++ b/Source/CPack/cmCPackTGZGenerator.h @@ -13,7 +13,11 @@ #ifndef cmCPackTGZGenerator_h #define cmCPackTGZGenerator_h +#include <cmConfigure.h> + #include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPackTGZGenerator * \brief A generator for TGZ files diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx index d17a164..c708022 100644 --- a/Source/CPack/cmCPackTXZGenerator.cxx +++ b/Source/CPack/cmCPackTXZGenerator.cxx @@ -12,6 +12,9 @@ #include "cmCPackTXZGenerator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPackTXZGenerator::cmCPackTXZGenerator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr") { diff --git a/Source/CPack/cmCPackTXZGenerator.h b/Source/CPack/cmCPackTXZGenerator.h index 87c92ef..6d6db74 100644 --- a/Source/CPack/cmCPackTXZGenerator.h +++ b/Source/CPack/cmCPackTXZGenerator.h @@ -13,7 +13,11 @@ #ifndef cmCPackTXZGenerator_h #define cmCPackTXZGenerator_h +#include <cmConfigure.h> + #include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPackTXZGenerator * \brief A generator for TXZ files diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index 694d392..09bda8c 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -12,6 +12,9 @@ #include "cmCPackTarBZip2Generator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, "paxr") { diff --git a/Source/CPack/cmCPackTarBZip2Generator.h b/Source/CPack/cmCPackTarBZip2Generator.h index 6fec882..d7b7277 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.h +++ b/Source/CPack/cmCPackTarBZip2Generator.h @@ -13,7 +13,11 @@ #ifndef cmCPackTarBZip2Generator_h #define cmCPackTarBZip2Generator_h +#include <cmConfigure.h> + #include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPackTarBZip2Generator * \brief A generator for TarBZip2 files diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index aec6893..a2b0b66 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -12,6 +12,9 @@ #include "cmCPackTarCompressGenerator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, "paxr") { diff --git a/Source/CPack/cmCPackTarCompressGenerator.h b/Source/CPack/cmCPackTarCompressGenerator.h index 02926a2..9213d81 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.h +++ b/Source/CPack/cmCPackTarCompressGenerator.h @@ -13,7 +13,11 @@ #ifndef cmCPackTarCompressGenerator_h #define cmCPackTarCompressGenerator_h -#include "cmCPackTGZGenerator.h" +#include <cmConfigure.h> + +#include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPackTarCompressGenerator * \brief A generator for TarCompress files diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index 9b42e6d..f2a2547 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -12,6 +12,9 @@ #include "cmCPackZIPGenerator.h" +#include "cmArchiveWrite.h" +#include "cmCPackArchiveGenerator.h" + cmCPackZIPGenerator::cmCPackZIPGenerator() : cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, "zip") { diff --git a/Source/CPack/cmCPackZIPGenerator.h b/Source/CPack/cmCPackZIPGenerator.h index 1130826..fdb10a9 100644 --- a/Source/CPack/cmCPackZIPGenerator.h +++ b/Source/CPack/cmCPackZIPGenerator.h @@ -13,7 +13,11 @@ #ifndef cmCPackZIPGenerator_h #define cmCPackZIPGenerator_h +#include <cmConfigure.h> + #include "cmCPackArchiveGenerator.h" +#include "cmCPackGenerator.h" +#include "cmTypeMacro.h" /** \class cmCPackZIPGenerator * \brief A generator for ZIP files diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index de572c0..be524b3 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -9,22 +9,30 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cmSystemTools.h" +#include <cmConfigure.h> -// Need these for documentation support. #include "cmCPackGenerator.h" #include "cmCPackGeneratorFactory.h" +#include "cmCPackLog.h" #include "cmDocumentation.h" +#include "cmDocumentationEntry.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" +#include "cmState.h" +#include "cmSystemTools.h" +#include "cmTypeMacro.h" +#include "cm_auto_ptr.hxx" #include "cmake.h" -#include "cmake.h" - -#include "cmCPackLog.h" #include <cmsys/CommandLineArguments.hxx> #include <cmsys/Encoding.hxx> -#include <cmsys/SystemTools.hxx> +#include <iostream> +#include <map> +#include <sstream> +#include <stddef.h> +#include <string> +#include <utility> +#include <vector> static const char* cmDocumentationName[][2] = { { CM_NULLPTR, " cpack - Packaging driver provided by CMake." }, |