summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-06 21:00:11 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-22 13:51:06 (GMT)
commit438809d3ba074356a641f0a1665a8c3b6117648e (patch)
tree4aa8cfcdc5e0e7d87fc2d38f625ed169b0fbba1c /Source/CPack/cmCPackGenerator.cxx
parent4d661e3a92b09362d4749af24e1cac79071adcfb (diff)
downloadCMake-438809d3ba074356a641f0a1665a8c3b6117648e.zip
CMake-438809d3ba074356a641f0a1665a8c3b6117648e.tar.gz
CMake-438809d3ba074356a641f0a1665a8c3b6117648e.tar.bz2
cmCPackGenerator: Add option to FindTemplate to use alternate builtin path
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 8f72ceb..b7786d3 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -7,6 +7,8 @@
#include <memory>
#include <utility>
+#include <cmext/string_view>
+
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -1315,17 +1317,17 @@ const char* cmCPackGenerator::GetPackagingInstallPrefix()
return this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")->c_str();
}
-std::string cmCPackGenerator::FindTemplate(const char* name)
+std::string cmCPackGenerator::FindTemplate(cm::string_view name,
+ cm::optional<cm::string_view> alt)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "Look for template: " << (name ? name : "(NULL)")
- << std::endl);
+ "Look for template: " << name << std::endl);
// Search CMAKE_MODULE_PATH for a custom template.
std::string ffile = this->MakefileMap->GetModulesFile(name);
if (ffile.empty()) {
// Fall back to our internal builtin default.
ffile = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Modules/Internal/CPack/",
- name);
+ alt ? *alt : ""_s, name);
cmSystemTools::ConvertToUnixSlashes(ffile);
if (!cmSystemTools::FileExists(ffile)) {
ffile.clear();