diff options
Diffstat (limited to 'Source/CPack')
60 files changed, 207 insertions, 179 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index ee46d86..fa8982f 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWGenerator.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWInstaller.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmTimestamp.h" diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index d656063..688db4b 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -3,10 +3,10 @@ #ifndef cmCPackIFWGenerator_h #define cmCPackIFWGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWInstaller.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index d8bafee..57b47f1 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -2,16 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWInstaller.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <sstream> #include <stddef.h> #include <utility> -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmXMLParser.h" @@ -288,7 +288,7 @@ public: hasFiles = false; hasErrors = false; - basePath = cmSystemTools::GetFilenamePath(installer->Resources[r].data()); + basePath = cmSystemTools::GetFilenamePath(installer->Resources[r]); ParseFile(installer->Resources[r].data()); @@ -360,8 +360,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() cmSystemTools::GetFilenameName(InstallerApplicationIcon); std::string path = Directory + "/config/" + name; name = cmSystemTools::GetFilenameWithoutExtension(name); - cmsys::SystemTools::CopyFileIfDifferent(InstallerApplicationIcon.data(), - path.data()); + cmsys::SystemTools::CopyFileIfDifferent(InstallerApplicationIcon, path); xout.Element("InstallerApplicationIcon", name); } @@ -369,8 +368,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!InstallerWindowIcon.empty()) { std::string name = cmSystemTools::GetFilenameName(InstallerWindowIcon); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(InstallerWindowIcon.data(), - path.data()); + cmsys::SystemTools::CopyFileIfDifferent(InstallerWindowIcon, path); xout.Element("InstallerWindowIcon", name); } @@ -378,7 +376,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!Logo.empty()) { std::string name = cmSystemTools::GetFilenameName(Logo); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Logo.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Logo, path); xout.Element("Logo", name); } @@ -386,7 +384,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!Banner.empty()) { std::string name = cmSystemTools::GetFilenameName(Banner); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Banner.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Banner, path); xout.Element("Banner", name); } @@ -394,7 +392,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!Watermark.empty()) { std::string name = cmSystemTools::GetFilenameName(Watermark); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Watermark.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Watermark, path); xout.Element("Watermark", name); } @@ -402,7 +400,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!Background.empty()) { std::string name = cmSystemTools::GetFilenameName(Background); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Background.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Background, path); xout.Element("Background", name); } @@ -480,7 +478,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (!IsVersionLess("2.0") && !ControlScript.empty()) { std::string name = cmSystemTools::GetFilenameName(ControlScript); std::string path = Directory + "/config/" + name; - cmsys::SystemTools::CopyFileIfDifferent(ControlScript.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(ControlScript, path); xout.Element("ControlScript", name); } @@ -492,8 +490,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile() if (parser.ParseResource(i)) { std::string name = cmSystemTools::GetFilenameName(Resources[i]); std::string path = Directory + "/resources/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Resources[i].data(), - path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Resources[i], path); resources.push_back(name); } else { cmCPackLogger(cmCPackLog::LOG_WARNING, "Can't copy resources from \"" diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index 4ec3e70..64239cf 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWInstaller_h #define cmCPackIFWInstaller_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index e23b1b9..99e8b9e 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -2,17 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWPackage.h" -#include "CPack/cmCPackComponentGroup.h" -#include "CPack/cmCPackGenerator.h" -#include "CPack/cmCPackLog.h" +#include "cmCPackComponentGroup.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmCPackIFWInstaller.h" +#include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmTimestamp.h" #include "cmXMLWriter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <sstream> #include <stddef.h> @@ -590,7 +590,7 @@ void cmCPackIFWPackage::GeneratePackageFile() if (!Script.empty()) { std::string name = cmSystemTools::GetFilenameName(Script); std::string path = Directory + "/meta/" + name; - cmsys::SystemTools::CopyFileIfDifferent(Script.data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(Script, path); xout.Element("Script", name); } @@ -599,8 +599,7 @@ void cmCPackIFWPackage::GeneratePackageFile() for (size_t i = 0; i < userInterfaces.size(); i++) { std::string name = cmSystemTools::GetFilenameName(userInterfaces[i]); std::string path = Directory + "/meta/" + name; - cmsys::SystemTools::CopyFileIfDifferent(userInterfaces[i].data(), - path.data()); + cmsys::SystemTools::CopyFileIfDifferent(userInterfaces[i], path); userInterfaces[i] = name; } if (!userInterfaces.empty()) { @@ -616,8 +615,7 @@ void cmCPackIFWPackage::GeneratePackageFile() for (size_t i = 0; i < translations.size(); i++) { std::string name = cmSystemTools::GetFilenameName(translations[i]); std::string path = Directory + "/meta/" + name; - cmsys::SystemTools::CopyFileIfDifferent(translations[i].data(), - path.data()); + cmsys::SystemTools::CopyFileIfDifferent(translations[i], path); translations[i] = name; } if (!translations.empty()) { @@ -675,7 +673,7 @@ void cmCPackIFWPackage::GeneratePackageFile() for (size_t i = 1; i < licenses.size(); i += 2) { std::string name = cmSystemTools::GetFilenameName(licenses[i]); std::string path = Directory + "/meta/" + name; - cmsys::SystemTools::CopyFileIfDifferent(licenses[i].data(), path.data()); + cmsys::SystemTools::CopyFileIfDifferent(licenses[i], path); licenses[i] = name; } if (!licenses.empty()) { diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index bd1d6c5..025a03e 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWPackage_h #define cmCPackIFWPackage_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <set> #include <string> diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx index cc204e8..8ce375e 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.cxx +++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWRepository.h" -#include "CPack/cmCPackGenerator.h" +#include "cmCPackGenerator.h" #include "cmCPackIFWGenerator.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmXMLParser.h" #include "cmXMLWriter.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <stddef.h> #ifdef cmCPackLogger diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h index 36f46da..c09a158 100644 --- a/Source/CPack/IFW/cmCPackIFWRepository.h +++ b/Source/CPack/IFW/cmCPackIFWRepository.h @@ -3,7 +3,7 @@ #ifndef cmCPackIFWRepository_h #define cmCPackIFWRepository_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <string> #include <vector> diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index b159e64..b48bf12 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -1,8 +1,8 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmsys/FStream.hxx> -#include <cmsys/Process.h> -#include <cmsys/SystemTools.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/Process.h" +#include "cmsys/SystemTools.hxx" #include <iostream> #include <stddef.h> #include <string> @@ -20,7 +20,6 @@ int main(int argc, char* argv[]) { // if ( cmsys::SystemTools::FileExists( - std::string cwd = cmsys::SystemTools::GetCurrentWorkingDirectory(); cmsys::ofstream ofs("/tmp/output.txt"); CFStringRef fileName; @@ -86,8 +85,6 @@ int main(int argc, char* argv[]) int length; while (cmsysProcess_WaitForData(cp, &data, &length, 0)) { // Translate NULL characters in the output into valid text. - // Visual Studio 7 puts these characters in the output of its - // build process. for (int i = 0; i < length; ++i) { if (data[i] == '\0') { data[i] = ' '; diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 2bccf2e..2df23fd 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -2,14 +2,14 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackWIXGenerator.h" -#include <CPack/cmCPackComponentGroup.h> -#include <CPack/cmCPackLog.h> +#include "cmCPackComponentGroup.h" +#include "cmCPackLog.h" +#include "cmCryptoHash.h" +#include "cmGeneratedFileStream.h" +#include "cmInstalledFile.h" +#include "cmSystemTools.h" +#include "cmUuid.h" #include <algorithm> -#include <cmCryptoHash.h> -#include <cmGeneratedFileStream.h> -#include <cmInstalledFile.h> -#include <cmSystemTools.h> -#include <cmUuid.h> #include "cmWIXDirectoriesSourceWriter.h" #include "cmWIXFeaturesSourceWriter.h" @@ -17,10 +17,10 @@ #include "cmWIXRichTextFormatWriter.h" #include "cmWIXSourceWriter.h" -#include <cmsys/Directory.hxx> -#include <cmsys/Encoding.hxx> -#include <cmsys/FStream.hxx> -#include <cmsys/SystemTools.hxx> +#include "cmsys/Directory.hxx" +#include "cmsys/Encoding.hxx" +#include "cmsys/FStream.hxx" +#include "cmsys/SystemTools.hxx" #include <rpc.h> // for GUID generation @@ -437,8 +437,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() directoryDefinitions.AddAttribute("Name", "SourceDir"); size_t installRootSize = - directoryDefinitions.BeginInstallationPrefixDirectory( - GetProgramFilesFolderId(), installRoot); + directoryDefinitions.BeginInstallationPrefixDirectory(GetRootFolderId(), + installRoot); std::string fileDefinitionsFilename = this->CPackTopLevel + "/files.wxs"; @@ -570,16 +570,26 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() return this->Patch->CheckForUnappliedFragments(); } -std::string cmCPackWIXGenerator::GetProgramFilesFolderId() const +std::string cmCPackWIXGenerator::GetRootFolderId() const { if (cmSystemTools::IsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) { return ""; } + + std::string result = "ProgramFiles<64>Folder"; + + const char* rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID"); + if (rootFolderId) { + result = rootFolderId; + } + if (GetArchitecture() == "x86") { - return "ProgramFilesFolder"; + cmSystemTools::ReplaceString(result, "<64>", ""); } else { - return "ProgramFiles64Folder"; + cmSystemTools::ReplaceString(result, "<64>", "64"); } + + return result; } bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate() diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index fc0994c..353d6c0 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackWIXGenerator_h #define cmCPackWIXGenerator_h -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" #include "cmWIXPatch.h" #include "cmWIXShortcut.h" @@ -65,7 +65,7 @@ private: bool CreateWiXSourceFiles(); - std::string GetProgramFilesFolderId() const; + std::string GetRootFolderId() const; bool GenerateMainSourceFileFromTemplate(); diff --git a/Source/CPack/WiX/cmWIXAccessControlList.cxx b/Source/CPack/WiX/cmWIXAccessControlList.cxx index 9f9b39c..744a932 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.cxx +++ b/Source/CPack/WiX/cmWIXAccessControlList.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXAccessControlList.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cmSystemTools.h> +#include "cmSystemTools.h" cmWIXAccessControlList::cmWIXAccessControlList( cmCPackLog* logger, cmInstalledFile const& installedFile, diff --git a/Source/CPack/WiX/cmWIXAccessControlList.h b/Source/CPack/WiX/cmWIXAccessControlList.h index 0a25ee5..2a23f2f 100644 --- a/Source/CPack/WiX/cmWIXAccessControlList.h +++ b/Source/CPack/WiX/cmWIXAccessControlList.h @@ -5,8 +5,8 @@ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackLog.h> -#include <cmInstalledFile.h> +#include "cmCPackLog.h" +#include "cmInstalledFile.h" class cmWIXAccessControlList { diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h index 062efe3..8233331 100644 --- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h @@ -5,7 +5,7 @@ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" #include <string> diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h index 368b250..e751ca7 100644 --- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h @@ -6,7 +6,7 @@ #include "cmWIXPatch.h" #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" /** \class cmWIXFeaturesSourceWriter * \brief Helper class to generate features.wxs diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index a471d26..7aa1212 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -4,14 +4,12 @@ #include "cmWIXAccessControlList.h" -#include <cmInstalledFile.h> +#include "cmInstalledFile.h" -#include <cmSystemTools.h> -#include <cmUuid.h> +#include "cmSystemTools.h" +#include "cmUuid.h" -#include <sys/types.h> -// include sys/stat.h after sys/types.h -#include <sys/stat.h> +#include "cm_sys_stat.h" cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger, std::string const& filename, diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index d7a642d..dc9c636 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -8,7 +8,7 @@ #include "cmWIXPatch.h" #include "cmWIXShortcut.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" /** \class cmWIXFilesSourceWriter * \brief Helper class to generate files.wxs diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index 7c48653..3a7dbfd 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXPatch.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" cmWIXPatch::cmWIXPatch(cmCPackLog* logger) : Logger(logger) diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx index 47f98d1..7f2ae19 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.cxx +++ b/Source/CPack/WiX/cmWIXPatchParser.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXPatchParser.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cm_expat.h> +#include "cm_expat.h" cmWIXPatchNode::Type cmWIXPatchText::type() { diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h index a2f0a3c..c0c96cd 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.h +++ b/Source/CPack/WiX/cmWIXPatchParser.h @@ -3,9 +3,9 @@ #ifndef cmCPackWIXPatchParser_h #define cmCPackWIXPatchParser_h -#include <CPack/cmCPackLog.h> +#include "cmCPackLog.h" -#include <cmXMLParser.h> +#include "cmXMLParser.h" #include <list> #include <map> diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx index d819347..2c99a22 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXRichTextFormatWriter.h" -#include <cmVersion.h> +#include "cmVersion.h" cmWIXRichTextFormatWriter::cmWIXRichTextFormatWriter( std::string const& filename) diff --git a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h index a3c8394..30df878 100644 --- a/Source/CPack/WiX/cmWIXRichTextFormatWriter.h +++ b/Source/CPack/WiX/cmWIXRichTextFormatWriter.h @@ -3,9 +3,9 @@ #ifndef cmWIXRichTextFormatWriter_h #define cmWIXRichTextFormatWriter_h -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <string> /** \class cmWIXRichtTextFormatWriter diff --git a/Source/CPack/WiX/cmWIXShortcut.h b/Source/CPack/WiX/cmWIXShortcut.h index cba3b34..23ddc6a 100644 --- a/Source/CPack/WiX/cmWIXShortcut.h +++ b/Source/CPack/WiX/cmWIXShortcut.h @@ -3,7 +3,7 @@ #ifndef cmWIXShortcut_h #define cmWIXShortcut_h -#include <cmInstalledFile.h> +#include "cmInstalledFile.h" #include <map> #include <set> diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index b434334..a86e28d 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmWIXSourceWriter.h" -#include <CPack/cmCPackGenerator.h> +#include "cmCPackGenerator.h" -#include <cmUuid.h> +#include "cmUuid.h" #include <windows.h> diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h index 45aefe5..4af1ed6 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.h +++ b/Source/CPack/WiX/cmWIXSourceWriter.h @@ -3,9 +3,9 @@ #ifndef cmWIXSourceWriter_h #define cmWIXSourceWriter_h -#include <CPack/cmCPackLog.h> +#include "cmCPackLog.h" -#include <cmsys/FStream.hxx> +#include "cmsys/FStream.hxx" #include <string> #include <vector> diff --git a/Source/CPack/cmCPack7zGenerator.h b/Source/CPack/cmCPack7zGenerator.h index a617d9b..42a4781 100644 --- a/Source/CPack/cmCPack7zGenerator.h +++ b/Source/CPack/cmCPack7zGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPack7zGenerator_h #define cmCPack7zGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 9d9cd66..cc01b0c 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -7,6 +7,7 @@ #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include "cmWorkingDirectory.h" #include <map> #include <ostream> @@ -37,9 +38,8 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( // Add the files of this component to the archive std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); localToplevel += "/" + component->Name; - std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); // Change to local toplevel - cmSystemTools::ChangeDirectory(localToplevel); + cmWorkingDirectory workdir(localToplevel); std::string filePrefix; if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) { filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME"); @@ -64,8 +64,6 @@ int cmCPackArchiveGenerator::addOneComponentToArchive( return 0; } } - // Go back to previous dir - cmSystemTools::ChangeDirectory(dir); return 1; } @@ -227,8 +225,7 @@ int cmCPackArchiveGenerator::PackageFiles() // CASE 3 : NON COMPONENT package. DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0], archive); std::vector<std::string>::const_iterator fileIt; - std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); - cmSystemTools::ChangeDirectory(toplevel); + cmWorkingDirectory workdir(toplevel); for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) { // Get the relative path to the file std::string rp = @@ -241,7 +238,6 @@ int cmCPackArchiveGenerator::PackageFiles() return 0; } } - cmSystemTools::ChangeDirectory(dir); // The destructor of cmArchiveWrite will close and finish the write return 1; } diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index df02ae8..58d67e3 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackArchiveGenerator_h #define cmCPackArchiveGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmArchiveWrite.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackBundleGenerator.h b/Source/CPack/cmCPackBundleGenerator.h index c9200c1..861fe4b 100644 --- a/Source/CPack/cmCPackBundleGenerator.h +++ b/Source/CPack/cmCPackBundleGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackBundleGenerator_h #define cmCPackBundleGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackDragNDropGenerator.h" diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index f955daf..26d69ba 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -3,7 +3,7 @@ #ifndef cmCPackComponentGroup_h #define cmCPackComponentGroup_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <string> #include <vector> @@ -78,6 +78,10 @@ public: /// contains the files that are part of this component. std::string ArchiveFile; + /// The file to pass to --component-plist when using the + /// productbuild generator. + std::string Plist; + /// The components that this component depends on. std::vector<cmCPackComponent*> Dependencies; diff --git a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx index e67811d..2119f78 100644 --- a/Source/CPack/cmCPackCygwinBinaryGenerator.cxx +++ b/Source/CPack/cmCPackCygwinBinaryGenerator.cxx @@ -9,7 +9,7 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" cmCPackCygwinBinaryGenerator::cmCPackCygwinBinaryGenerator() { diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index 92475d9..2c289f6 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -9,13 +9,13 @@ #include "cmSystemTools.h" #include "cmake.h" -#include <cmsys/SystemTools.hxx> +#include "cmsys/SystemTools.hxx" // Includes needed for implementation of RenameFile. This is not in // system tools because it is not implemented robustly enough to move // files across directories. #ifdef _WIN32 -#include <sys/stat.h> +#include "cm_sys_stat.h" #include <windows.h> #endif diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 5c50da8..af54fce 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -8,15 +8,15 @@ #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include "cm_sys_stat.h" -#include <cmsys/Glob.hxx> +#include "cmsys/Glob.hxx" #include <limits.h> #include <map> #include <ostream> #include <set> #include <stdio.h> #include <string.h> -#include <sys/stat.h> #include <utility> // NOTE: diff --git a/Source/CPack/cmCPackDebGenerator.h b/Source/CPack/cmCPackDebGenerator.h index 7db933e..e7cde11 100644 --- a/Source/CPack/cmCPackDebGenerator.h +++ b/Source/CPack/cmCPackDebGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackDebGenerator_h #define cmCPackDebGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index fd67df9..9864cf3 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -7,8 +7,8 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <iomanip> #include <map> #include <stdlib.h> @@ -390,6 +390,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, bool remount_image = !cpack_package_icon.empty() || !cpack_dmg_ds_store_setup_script.empty(); + std::string temp_image_format = "UDZO"; + // Create 1 MB dummy padding file in staging area when we need to remount // image, so we have enough space for storing changes ... if (remount_image) { @@ -401,6 +403,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } + temp_image_format = "UDRW"; } // Create a temporary read-write disk image ... @@ -413,7 +416,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, temp_image_command << " -ov"; temp_image_command << " -srcfolder \"" << staging.str() << "\""; temp_image_command << " -volname \"" << cpack_dmg_volume_name << "\""; - temp_image_command << " -format UDRW"; + temp_image_command << " -format " << temp_image_format; temp_image_command << " \"" << temp_image << "\""; if (!this->RunCommand(temp_image_command)) { @@ -632,29 +635,33 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - // convert to UDCO - std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); - temp_udco += "/temp-udco.dmg"; + if (temp_image_format != "UDZO") { + temp_image_format = "UDZO"; + // convert to UDZO to enable unflatten/flatten + std::string temp_udzo = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); + temp_udzo += "/temp-udzo.dmg"; - std::ostringstream udco_image_command; - udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); - udco_image_command << " convert \"" << temp_image << "\""; - udco_image_command << " -format UDCO"; - udco_image_command << " -ov -o \"" << temp_udco << "\""; + std::ostringstream udco_image_command; + udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); + udco_image_command << " convert \"" << temp_image << "\""; + udco_image_command << " -format UDZO"; + udco_image_command << " -ov -o \"" << temp_udzo << "\""; - if (!this->RunCommand(udco_image_command, &error)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Error converting to UDCO dmg for adding SLA." - << std::endl - << error << std::endl); - return 0; + if (!this->RunCommand(udco_image_command, &error)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error converting to UDCO dmg for adding SLA." + << std::endl + << error << std::endl); + return 0; + } + temp_image = temp_udzo; } // unflatten dmg std::ostringstream unflatten_command; unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << " unflatten "; - unflatten_command << "\"" << temp_udco << "\""; + unflatten_command << "\"" << temp_image << "\""; if (!this->RunCommand(unflatten_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -673,7 +680,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } embed_sla_command << " \"" << sla_r << "\""; embed_sla_command << " -a -o "; - embed_sla_command << "\"" << temp_udco << "\""; + embed_sla_command << "\"" << temp_image << "\""; if (!this->RunCommand(embed_sla_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error adding SLA." << std::endl @@ -686,7 +693,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::ostringstream flatten_command; flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << " flatten "; - flatten_command << "\"" << temp_udco << "\""; + flatten_command << "\"" << temp_image << "\""; if (!this->RunCommand(flatten_command, &error)) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -695,8 +702,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, << std::endl); return 0; } - - temp_image = temp_udco; } // Create the final compressed read-only disk image ... diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 876eab7..ae2cc17 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackDragNDropGenerator_h #define cmCPackDragNDropGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <sstream> #include <stddef.h> #include <string> diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 21eda79..a95ca76 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -2,10 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGenerator.h" +#include "cmsys/FStream.hxx" +#include "cmsys/Glob.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/FStream.hxx> -#include <cmsys/Glob.hxx> -#include <cmsys/RegularExpression.hxx> #include <list> #include <utility> @@ -16,6 +16,7 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmStateSnapshot.h" +#include "cmWorkingDirectory.h" #include "cmXMLSafe.h" #include "cm_auto_ptr.hxx" #include "cmake.h" @@ -383,7 +384,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( goToDir += "/" + subdir; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Change dir to: " << goToDir << std::endl); - cmSystemTools::ChangeDirectory(goToDir); + cmWorkingDirectory workdir(goToDir); for (symlinkedIt = symlinkedFiles.begin(); symlinkedIt != symlinkedFiles.end(); ++symlinkedIt) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " @@ -408,7 +409,6 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: " << curDir << std::endl); - cmSystemTools::ChangeDirectory(curDir); } } } @@ -1396,6 +1396,11 @@ cmCPackComponent* cmCPackGenerator::GetComponent( component->ArchiveFile = archiveFile; } + const char* plist = this->GetOption(macroPrefix + "_PLIST"); + if (plist && *plist) { + component->Plist = plist; + } + const char* groupName = this->GetOption(macroPrefix + "_GROUP"); if (groupName && *groupName) { component->Group = GetComponentGroup(projectName, groupName); diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 5354fca..45777fa 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackGenerator_h #define cmCPackGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include <map> #include <sstream> @@ -13,25 +13,10 @@ #include "cmCPackComponentGroup.h" #include "cmSystemTools.h" -class cmCPackGenerator; class cmCPackLog; class cmInstalledFile; class cmMakefile; -#define cmCPackTypeMacro(klass, superclass) \ - typedef superclass Superclass; \ - const char* GetNameOfClass() CM_OVERRIDE { return #klass; } \ - static cmCPackGenerator* CreateGenerator() { return new klass; } \ - class cmCPackTypeMacro_UseTrailingSemicolon - -#define cmCPackLogger(logType, msg) \ - do { \ - std::ostringstream cmCPackLog_msg; \ - cmCPackLog_msg << msg; \ - this->Logger->Log(logType, __FILE__, __LINE__, \ - cmCPackLog_msg.str().c_str()); \ - } while (false) - /** \class cmCPackGenerator * \brief A superclass of all CPack Generators * @@ -312,4 +297,18 @@ private: cmMakefile* MakefileMap; }; +#define cmCPackTypeMacro(klass, superclass) \ + typedef superclass Superclass; \ + const char* GetNameOfClass() CM_OVERRIDE { return #klass; } \ + static cmCPackGenerator* CreateGenerator() { return new klass; } \ + class cmCPackTypeMacro_UseTrailingSemicolon + +#define cmCPackLogger(logType, msg) \ + do { \ + std::ostringstream cmCPackLog_msg; \ + cmCPackLog_msg << msg; \ + this->Logger->Log(logType, __FILE__, __LINE__, \ + cmCPackLog_msg.str().c_str()); \ + } while (false) + #endif diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index b012f01..31f48c7 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackGeneratorFactory.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <ostream> #include <utility> diff --git a/Source/CPack/cmCPackGeneratorFactory.h b/Source/CPack/cmCPackGeneratorFactory.h index 4ee0bc1..7f633e4 100644 --- a/Source/CPack/cmCPackGeneratorFactory.h +++ b/Source/CPack/cmCPackGeneratorFactory.h @@ -3,7 +3,7 @@ #ifndef cmCPackGeneratorFactory_h #define cmCPackGeneratorFactory_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <string> diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 7d5c192..5c71239 100644 --- a/Source/CPack/cmCPackLog.cxx +++ b/Source/CPack/cmCPackLog.cxx @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackLog.h" -#include <cmConfigure.h> +#include "cmConfigure.h" #include <iostream> #include "cmGeneratedFileStream.h" diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index a988ccc..96c5882 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -3,7 +3,7 @@ #ifndef cmCPackLog_h #define cmCPackLog_h -#include <cmConfigure.h> // IWYU pragma: keep +#include "cmConfigure.h" // IWYU pragma: keep #include <ostream> #include <string.h> diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 1940953..beb2d01 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -8,9 +8,9 @@ #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include "cmsys/Directory.hxx" +#include "cmsys/RegularExpression.hxx" #include <algorithm> -#include <cmsys/Directory.hxx> -#include <cmsys/RegularExpression.hxx> #include <map> #include <sstream> #include <stdlib.h> diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index b4bf2d4..77be325 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackNSISGenerator_h #define cmCPackNSISGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 0d8dc48..8ea88a8 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -3,12 +3,12 @@ #include "cmCPackOSXX11Generator.h" #include <sstream> -#include <sys/stat.h> #include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" +#include "cm_sys_stat.h" cmCPackOSXX11Generator::cmCPackOSXX11Generator() { diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h index 1918e21..0eebc6d 100644 --- a/Source/CPack/cmCPackOSXX11Generator.h +++ b/Source/CPack/cmCPackOSXX11Generator.h @@ -3,7 +3,8 @@ #ifndef cmCPackOSXX11Generator_h #define cmCPackOSXX11Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h index 1e96a62..f873c59 100644 --- a/Source/CPack/cmCPackPKGGenerator.h +++ b/Source/CPack/cmCPackPKGGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackPKGGenerator_h #define cmCPackPKGGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <set> #include <sstream> #include <string> diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 8000d6e..8db7cfb 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackPackageMakerGenerator.h" +#include "cmsys/FStream.hxx" +#include "cmsys/RegularExpression.hxx" #include <assert.h> -#include <cmsys/FStream.hxx> -#include <cmsys/RegularExpression.hxx> #include <map> #include <sstream> #include <stdio.h> diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index d4c6744..6274515 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackPackageMakerGenerator_h #define cmCPackPackageMakerGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" #include "cmCPackPKGGenerator.h" diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index a5a18dc..1389eaa 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -59,12 +59,25 @@ int cmCPackProductBuildGenerator::PackageFiles() } } - // Copy or create all of the resource files we need. std::string resDir = packageDirFileName + "/Contents"; + + if (this->IsSet("CPACK_PRODUCTBUILD_RESOURCES_DIR")) { + std::string userResDir = + this->GetOption("CPACK_PRODUCTBUILD_RESOURCES_DIR"); + + if (!cmSystemTools::CopyADirectory(userResDir, resDir)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" + << std::endl); + return 0; + } + } + + // Copy or create all of the resource files we need. if (!this->CopyCreateResourceFile("License", resDir) || !this->CopyCreateResourceFile("ReadMe", resDir) || !this->CopyCreateResourceFile("Welcome", resDir)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying the License, ReadMe and Welcome files" << std::endl); return 0; } @@ -223,6 +236,10 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( : " --keychain \"" + keychainPath + "\"") << " \"" << packageFile << "\""; + if (component && !component->Plist.empty()) { + pkgCmd << " --component-plist \"" << component->Plist << "\""; + } + // Run ProductBuild return RunProductBuild(pkgCmd.str()); } diff --git a/Source/CPack/cmCPackProductBuildGenerator.h b/Source/CPack/cmCPackProductBuildGenerator.h index b6da470..12093a0 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.h +++ b/Source/CPack/cmCPackProductBuildGenerator.h @@ -3,7 +3,8 @@ #ifndef cmCPackProductBuildGenerator_h #define cmCPackProductBuildGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" + #include <string> #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h index 4d48bd8..52cfc13 100644 --- a/Source/CPack/cmCPackRPMGenerator.h +++ b/Source/CPack/cmCPackRPMGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackRPMGenerator_h #define cmCPackRPMGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 682394e..c541614 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -2,19 +2,16 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackSTGZGenerator.h" -#include <cmsys/FStream.hxx> +#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 -#include <sys/stat.h> - #include "cmCPackGenerator.h" #include "cmCPackLog.h" #include "cmSystemTools.h" +#include "cm_sys_stat.h" cmCPackSTGZGenerator::cmCPackSTGZGenerator() { diff --git a/Source/CPack/cmCPackSTGZGenerator.h b/Source/CPack/cmCPackSTGZGenerator.h index 4b9c1c6..8304e80 100644 --- a/Source/CPack/cmCPackSTGZGenerator.h +++ b/Source/CPack/cmCPackSTGZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackSTGZGenerator_h #define cmCPackSTGZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackGenerator.h" #include "cmCPackTGZGenerator.h" diff --git a/Source/CPack/cmCPackTGZGenerator.h b/Source/CPack/cmCPackTGZGenerator.h index ee2e975..9426b3a 100644 --- a/Source/CPack/cmCPackTGZGenerator.h +++ b/Source/CPack/cmCPackTGZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTGZGenerator_h #define cmCPackTGZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTXZGenerator.h b/Source/CPack/cmCPackTXZGenerator.h index 876ca7d..3b96e2d 100644 --- a/Source/CPack/cmCPackTXZGenerator.h +++ b/Source/CPack/cmCPackTXZGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTXZGenerator_h #define cmCPackTXZGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTarBZip2Generator.h b/Source/CPack/cmCPackTarBZip2Generator.h index 42214fd..9b4b8f4 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.h +++ b/Source/CPack/cmCPackTarBZip2Generator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTarBZip2Generator_h #define cmCPackTarBZip2Generator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackTarCompressGenerator.h b/Source/CPack/cmCPackTarCompressGenerator.h index 1476642..381d6eb 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.h +++ b/Source/CPack/cmCPackTarCompressGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackTarCompressGenerator_h #define cmCPackTarCompressGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cmCPackZIPGenerator.h b/Source/CPack/cmCPackZIPGenerator.h index 95b6489..00c8720 100644 --- a/Source/CPack/cmCPackZIPGenerator.h +++ b/Source/CPack/cmCPackZIPGenerator.h @@ -3,7 +3,7 @@ #ifndef cmCPackZIPGenerator_h #define cmCPackZIPGenerator_h -#include <cmConfigure.h> +#include "cmConfigure.h" #include "cmCPackArchiveGenerator.h" #include "cmCPackGenerator.h" diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index af80cbf..a48c8cd 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -1,9 +1,9 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include <cmConfigure.h> +#include "cmConfigure.h" -#include <cmsys/CommandLineArguments.hxx> -#include <cmsys/Encoding.hxx> +#include "cmsys/CommandLineArguments.hxx" +#include "cmsys/Encoding.hxx" #include <iostream> #include <map> #include <sstream> @@ -13,7 +13,7 @@ #include <vector> #if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE) -#include <cmsys/ConsoleBuf.hxx> +#include "cmsys/ConsoleBuf.hxx" #endif #include "cmCPackGenerator.h" |