summaryrefslogtreecommitdiff
path: root/Source/CPack/cmCPackDragNDropGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/cmCPackDragNDropGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx43
1 files changed, 21 insertions, 22 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 7a3742b55..ea7100708 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -2,21 +2,23 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackDragNDropGenerator.h"
-#include "cmCPackGenerator.h"
-#include "cmCPackLog.h"
-#include "cmDuration.h"
-#include "cmGeneratedFileStream.h"
-#include "cmSystemTools.h"
-
-#include "cmsys/FStream.hxx"
-#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cstdlib>
#include <iomanip>
#include <map>
-#include <stdlib.h>
#include <CoreFoundation/CoreFoundation.h>
+#include "cmsys/FStream.hxx"
+#include "cmsys/RegularExpression.hxx"
+
+#include "cmCPackGenerator.h"
+#include "cmCPackLog.h"
+#include "cmDuration.h"
+#include "cmGeneratedFileStream.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+
#ifdef HAVE_CoreServices
// For the old LocaleStringToLangAndRegionCodes() function, to convert
// to the old Script Manager RegionCode values needed for the 'LPic' data
@@ -127,9 +129,8 @@ int cmCPackDragNDropGenerator::InitializeInternal()
return 0;
}
- std::vector<std::string> languages;
- cmSystemTools::ExpandListArgument(
- this->GetOption("CPACK_DMG_SLA_LANGUAGES"), languages);
+ std::vector<std::string> languages =
+ cmExpandedList(this->GetOption("CPACK_DMG_SLA_LANGUAGES"));
if (languages.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl);
@@ -196,9 +197,7 @@ int cmCPackDragNDropGenerator::PackageFiles()
full_package_name += std::string(GetOutputExtension());
packageFileNames.push_back(full_package_name);
- std::string src_dir = toplevel;
- src_dir += "/";
- src_dir += package_file;
+ std::string src_dir = cmStrCat(toplevel, '/', package_file);
if (0 == this->CreateDMG(src_dir, full_package_name)) {
return 0;
@@ -409,8 +408,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
}
// Create a temporary read-write disk image ...
- std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- temp_image += "/temp.dmg";
+ std::string temp_image =
+ cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/temp.dmg");
std::string create_error;
std::ostringstream temp_image_command;
@@ -522,12 +521,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
if (!cpack_license_file.empty() || !slaDirectory.empty()) {
// Use old hardcoded style if sla_dir is not set
bool oldStyle = slaDirectory.empty();
- std::string sla_r = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
- sla_r += "/sla.r";
+ std::string sla_r =
+ cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.r");
std::vector<std::string> languages;
if (!oldStyle) {
- cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages);
+ cmExpandList(cpack_dmg_languages, languages);
}
cmGeneratedFileStream ofs(sla_r);
@@ -649,8 +648,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
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::string temp_udzo = cmStrCat(
+ this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/temp-udzo.dmg");
std::ostringstream udco_image_command;
udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");