Commit 98617f1b authored by Alex Turbov's avatar Alex Turbov

Refactor: Move CPack internal files to `Internal/CPack/` directory

Some commits ago all CPack internal `*.cmake` files have been moved
to `Internal/CPack/`. This commit also move some templates
internally used by generators to the same location to make
`Modules/` directory less noisy w/ files the end users don't
need to use/see.
parent e559a3e9
...@@ -143,4 +143,3 @@ exit 0 ...@@ -143,4 +143,3 @@ exit 0
#----------------------------------------------------------- #-----------------------------------------------------------
# Start of TAR.GZ file # Start of TAR.GZ file
#-----------------------------------------------------------; #-----------------------------------------------------------;
...@@ -262,7 +262,7 @@ function(_cpack_nuget_render_spec) ...@@ -262,7 +262,7 @@ function(_cpack_nuget_render_spec)
# NuGet will name it properly. # NuGet will name it properly.
_cpack_nuget_debug("Rendering `${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec` file...") _cpack_nuget_debug("Rendering `${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec` file...")
configure_file( configure_file(
"${CMAKE_ROOT}/Modules/CPack.NuGet.nuspec.in" "${CMAKE_ROOT}/Modules/Internal/CPack/CPack.NuGet.nuspec.in"
"${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec" "${CPACK_TEMPORARY_DIRECTORY}/CPack.NuGet.nuspec"
@ONLY @ONLY
) )
......
...@@ -604,7 +604,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const ...@@ -604,7 +604,7 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate() bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{ {
std::string wixTemplate = FindTemplate("WIX.template.in"); std::string wixTemplate = FindTemplate("Internal/CPack/WIX.template.in");
if (GetOption("CPACK_WIX_TEMPLATE") != 0) { if (GetOption("CPACK_WIX_TEMPLATE") != 0) {
wixTemplate = GetOption("CPACK_WIX_TEMPLATE"); wixTemplate = GetOption("CPACK_WIX_TEMPLATE");
} }
......
...@@ -36,7 +36,8 @@ int cmCPackNSISGenerator::PackageFiles() ...@@ -36,7 +36,8 @@ int cmCPackNSISGenerator::PackageFiles()
{ {
// TODO: Fix nsis to force out file name // TODO: Fix nsis to force out file name
std::string nsisInFileName = this->FindTemplate("NSIS.template.in"); std::string nsisInFileName =
this->FindTemplate("Internal/CPack/NSIS.template.in");
if (nsisInFileName.empty()) { if (nsisInFileName.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack error: Could not find NSIS installer template file." "CPack error: Could not find NSIS installer template file."
...@@ -44,7 +45,7 @@ int cmCPackNSISGenerator::PackageFiles() ...@@ -44,7 +45,7 @@ int cmCPackNSISGenerator::PackageFiles()
return false; return false;
} }
std::string nsisInInstallOptions = std::string nsisInInstallOptions =
this->FindTemplate("NSIS.InstallOptions.ini.in"); this->FindTemplate("Internal/CPack/NSIS.InstallOptions.ini.in");
if (nsisInInstallOptions.empty()) { if (nsisInInstallOptions.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPack error: Could not find NSIS installer options file." "CPack error: Could not find NSIS installer options file."
......
...@@ -245,7 +245,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile( ...@@ -245,7 +245,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(
const std::string& name, const std::string& dir, const std::string& name, const std::string& dir,
const char* outputFileName /* = 0 */, bool copyOnly /* = false */) const char* outputFileName /* = 0 */, bool copyOnly /* = false */)
{ {
std::string inFName = "CPack."; std::string inFName = "Internal/CPack/CPack.";
inFName += name; inFName += name;
inFName += ".in"; inFName += ".in";
std::string inFileName = this->FindTemplate(inFName.c_str()); std::string inFileName = this->FindTemplate(inFName.c_str());
......
...@@ -48,7 +48,7 @@ std::string cmCPackPKGGenerator::GetPackageName( ...@@ -48,7 +48,7 @@ std::string cmCPackPKGGenerator::GetPackageName(
void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile) void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
{ {
std::string distributionTemplate = std::string distributionTemplate =
this->FindTemplate("CPack.distribution.dist.in"); this->FindTemplate("Internal/CPack/CPack.distribution.dist.in");
if (distributionTemplate.empty()) { if (distributionTemplate.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find input file: " << distributionTemplate "Cannot find input file: " << distributionTemplate
...@@ -305,7 +305,7 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name, ...@@ -305,7 +305,7 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name,
outName = name.c_str(); outName = name.c_str();
} }
std::string inFName = "CPack."; std::string inFName = "Internal/CPack/CPack.";
inFName += name; inFName += name;
inFName += ".in"; inFName += ".in";
std::string inFileName = this->FindTemplate(inFName.c_str()); std::string inFileName = this->FindTemplate(inFName.c_str());
......
...@@ -21,7 +21,8 @@ int cmCPackSTGZGenerator::InitializeInternal() ...@@ -21,7 +21,8 @@ int cmCPackSTGZGenerator::InitializeInternal()
{ {
this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "0"); this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "0");
std::string inFile = this->FindTemplate("CPack.STGZ_Header.sh.in"); std::string inFile =
this->FindTemplate("Internal/CPack/CPack.STGZ_Header.sh.in");
if (inFile.empty()) { if (inFile.empty()) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find template file: " << inFile << std::endl); "Cannot find template file: " << inFile << std::endl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment