summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-27 13:06:36 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-07-30 22:33:07 (GMT)
commit6aa90237006f1c4556e0cd18ae0e493650e7515c (patch)
treecf469f40bb650a870699f38cafbfe65e21990230 /Source/CPack
parent1b60137b98b26866c84ca29aee62031d429f34a5 (diff)
downloadCMake-6aa90237006f1c4556e0cd18ae0e493650e7515c.zip
CMake-6aa90237006f1c4556e0cd18ae0e493650e7515c.tar.gz
CMake-6aa90237006f1c4556e0cd18ae0e493650e7515c.tar.bz2
string_view: use string_view literals in comparisons
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx5
2 files changed, 8 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 3beba64..c7b8bfe 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -7,6 +7,9 @@
#include <iomanip>
#include <map>
+#include <cm/string_view>
+#include <cmext/string_view>
+
#include <CoreFoundation/CoreFoundation.h>
#include <cm3p/kwiml/abi.h>
@@ -195,7 +198,7 @@ int cmCPackDragNDropGenerator::PackageFiles()
packageFileNames.clear();
for (auto const& package_file : package_files) {
std::string full_package_name = cmStrCat(toplevel, "/");
- if (package_file == "ALL_IN_ONE") {
+ if (package_file == "ALL_IN_ONE"_s) {
full_package_name += this->GetOption("CPACK_PACKAGE_FILE_NAME");
} else {
full_package_name += package_file;
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index f113ff4..13135f5 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -4,6 +4,8 @@
#include <vector>
+#include <cmext/string_view>
+
#include "cmCPackComponentGroup.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
@@ -399,7 +401,8 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
return false;
}
std::string ext = cmSystemTools::GetFilenameLastExtension(inFileName);
- if (ext != ".rtfd" && ext != ".rtf" && ext != ".html" && ext != ".txt") {
+ if (ext != ".rtfd"_s && ext != ".rtf"_s && ext != ".html"_s &&
+ ext != ".txt"_s) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Bad file extension specified: "