mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`, now with "east const" enforcement. Use `clang-format` version 18. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Issue: #26123
This commit is contained in:
@@ -12,10 +12,10 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
// calculate square root
|
// calculate square root
|
||||||
const double sqrt = MathFunctions::sqrt(inputValue);
|
double const sqrt = MathFunctions::sqrt(inputValue);
|
||||||
std::cout << "The square root of " << inputValue << " is " << sqrt
|
std::cout << "The square root of " << inputValue << " is " << sqrt
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,15 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
// calculate square root
|
// calculate square root
|
||||||
const double sqrt = MathFunctions::sqrt(inputValue);
|
double const sqrt = MathFunctions::sqrt(inputValue);
|
||||||
std::cout << "The square root of " << inputValue << " is " << sqrt
|
std::cout << "The square root of " << inputValue << " is " << sqrt
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
// calculate sum
|
// calculate sum
|
||||||
const double sum = MathFunctions::add(inputValue, inputValue);
|
double const sum = MathFunctions::add(inputValue, inputValue);
|
||||||
std::cout << inputValue << " + " << inputValue << " = " << sum << std::endl;
|
std::cout << inputValue << " + " << inputValue << " = " << sum << std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ Lastly, replace ``sqrt`` with the wrapper function ``mathfunctions::sqrt``.
|
|||||||
:caption: TODO 6: tutorial.cxx
|
:caption: TODO 6: tutorial.cxx
|
||||||
:name: CMakeLists.txt-option
|
:name: CMakeLists.txt-option
|
||||||
:language: cmake
|
:language: cmake
|
||||||
:start-after: const double inputValue = std::stod(argv[1]);
|
:start-after: double const inputValue = std::stod(argv[1]);
|
||||||
:end-before: std::cout
|
:end-before: std::cout
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
// TODO 4: Replace atof(argv[1]) with std::stod(argv[1])
|
// TODO 4: Replace atof(argv[1]) with std::stod(argv[1])
|
||||||
const double inputValue = atof(argv[1]);
|
double const inputValue = atof(argv[1]);
|
||||||
|
|
||||||
// calculate square root
|
// calculate square root
|
||||||
const double outputValue = sqrt(inputValue);
|
double const outputValue = sqrt(inputValue);
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
// TODO 6: Replace sqrt with mathfunctions::sqrt
|
// TODO 6: Replace sqrt with mathfunctions::sqrt
|
||||||
|
|
||||||
// calculate square root
|
// calculate square root
|
||||||
const double outputValue = sqrt(inputValue);
|
double const outputValue = sqrt(inputValue);
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream fout(argv[1], std::ios_base::out);
|
std::ofstream fout(argv[1], std::ios_base::out);
|
||||||
const bool fileOpen = fout.is_open();
|
bool const fileOpen = fout.is_open();
|
||||||
if (fileOpen) {
|
if (fileOpen) {
|
||||||
fout << "double sqrtTable[] = {" << std::endl;
|
fout << "double sqrtTable[] = {" << std::endl;
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert input to double
|
// convert input to double
|
||||||
const double inputValue = std::stod(argv[1]);
|
double const inputValue = std::stod(argv[1]);
|
||||||
|
|
||||||
const double outputValue = mathfunctions::sqrt(inputValue);
|
double const outputValue = mathfunctions::sqrt(inputValue);
|
||||||
|
|
||||||
std::cout << "The square root of " << inputValue << " is " << outputValue
|
std::cout << "The square root of " << inputValue << " is " << outputValue
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* Size of a pointer-to-data in bytes. */
|
/* Size of a pointer-to-data in bytes. */
|
||||||
#define SIZEOF_DPTR (sizeof(void*))
|
#define SIZEOF_DPTR (sizeof(void*))
|
||||||
const char info_sizeof_dptr[] = {
|
char const info_sizeof_dptr[] = {
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't',
|
'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't',
|
||||||
'r', '[', ('0' + ((SIZEOF_DPTR / 10) % 10)), ('0' + (SIZEOF_DPTR % 10)), ']',
|
'r', '[', ('0' + ((SIZEOF_DPTR / 10) % 10)), ('0' + (SIZEOF_DPTR % 10)), ']',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ static bool cmakeCompilerCUDAArch()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
const char* sep = "";
|
char const* sep = "";
|
||||||
for (int device = 0; device < count; ++device) {
|
for (int device = 0; device < count; ++device) {
|
||||||
cudaDeviceProp prop;
|
cudaDeviceProp prop;
|
||||||
if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) {
|
if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
|
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
|
||||||
static const char mpiver_str[] = { 'I', 'N',
|
static char const mpiver_str[] = { 'I', 'N',
|
||||||
'F', 'O',
|
'F', 'O',
|
||||||
':', 'M',
|
':', 'M',
|
||||||
'P', 'I',
|
'P', 'I',
|
||||||
|
|||||||
@@ -20,29 +20,29 @@ cmCPackIFWCommon::cmCPackIFWCommon()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
cmValue cmCPackIFWCommon::GetOption(const std::string& op) const
|
cmValue cmCPackIFWCommon::GetOption(std::string const& op) const
|
||||||
{
|
{
|
||||||
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
|
return this->Generator ? this->Generator->cmCPackGenerator::GetOption(op)
|
||||||
: nullptr;
|
: nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsOn(const std::string& op) const
|
bool cmCPackIFWCommon::IsOn(std::string const& op) const
|
||||||
{
|
{
|
||||||
return this->Generator && this->Generator->cmCPackGenerator::IsOn(op);
|
return this->Generator && this->Generator->cmCPackGenerator::IsOn(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsSetToOff(const std::string& op) const
|
bool cmCPackIFWCommon::IsSetToOff(std::string const& op) const
|
||||||
{
|
{
|
||||||
return this->Generator && this->Generator->cmCPackGenerator::IsSetToOff(op);
|
return this->Generator && this->Generator->cmCPackGenerator::IsSetToOff(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsSetToEmpty(const std::string& op) const
|
bool cmCPackIFWCommon::IsSetToEmpty(std::string const& op) const
|
||||||
{
|
{
|
||||||
return this->Generator &&
|
return this->Generator &&
|
||||||
this->Generator->cmCPackGenerator::IsSetToEmpty(op);
|
this->Generator->cmCPackGenerator::IsSetToEmpty(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsVersionLess(const char* version) const
|
bool cmCPackIFWCommon::IsVersionLess(char const* version) const
|
||||||
{
|
{
|
||||||
if (!this->Generator) {
|
if (!this->Generator) {
|
||||||
return false;
|
return false;
|
||||||
@@ -52,7 +52,7 @@ bool cmCPackIFWCommon::IsVersionLess(const char* version) const
|
|||||||
cmSystemTools::OP_LESS, this->Generator->FrameworkVersion, version);
|
cmSystemTools::OP_LESS, this->Generator->FrameworkVersion, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsVersionGreater(const char* version) const
|
bool cmCPackIFWCommon::IsVersionGreater(char const* version) const
|
||||||
{
|
{
|
||||||
if (!this->Generator) {
|
if (!this->Generator) {
|
||||||
return false;
|
return false;
|
||||||
@@ -62,7 +62,7 @@ bool cmCPackIFWCommon::IsVersionGreater(const char* version) const
|
|||||||
cmSystemTools::OP_GREATER, this->Generator->FrameworkVersion, version);
|
cmSystemTools::OP_GREATER, this->Generator->FrameworkVersion, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
|
bool cmCPackIFWCommon::IsVersionEqual(char const* version) const
|
||||||
{
|
{
|
||||||
if (!this->Generator) {
|
if (!this->Generator) {
|
||||||
return false;
|
return false;
|
||||||
@@ -73,7 +73,7 @@ bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackIFWCommon::ExpandListArgument(
|
void cmCPackIFWCommon::ExpandListArgument(
|
||||||
const std::string& arg, std::map<std::string, std::string>& argsOut)
|
std::string const& arg, std::map<std::string, std::string>& argsOut)
|
||||||
{
|
{
|
||||||
cmList args{ arg };
|
cmList args{ arg };
|
||||||
if (args.empty()) {
|
if (args.empty()) {
|
||||||
@@ -94,7 +94,7 @@ void cmCPackIFWCommon::ExpandListArgument(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackIFWCommon::ExpandListArgument(
|
void cmCPackIFWCommon::ExpandListArgument(
|
||||||
const std::string& arg, std::multimap<std::string, std::string>& argsOut)
|
std::string const& arg, std::multimap<std::string, std::string>& argsOut)
|
||||||
{
|
{
|
||||||
cmList args{ arg };
|
cmList args{ arg };
|
||||||
if (args.empty()) {
|
if (args.empty()) {
|
||||||
|
|||||||
@@ -28,32 +28,32 @@ public:
|
|||||||
public:
|
public:
|
||||||
// Internal implementation
|
// Internal implementation
|
||||||
|
|
||||||
cmValue GetOption(const std::string& op) const;
|
cmValue GetOption(std::string const& op) const;
|
||||||
bool IsOn(const std::string& op) const;
|
bool IsOn(std::string const& op) const;
|
||||||
bool IsSetToOff(const std::string& op) const;
|
bool IsSetToOff(std::string const& op) const;
|
||||||
bool IsSetToEmpty(const std::string& op) const;
|
bool IsSetToEmpty(std::string const& op) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare \a version with QtIFW framework version
|
* Compare \a version with QtIFW framework version
|
||||||
*/
|
*/
|
||||||
bool IsVersionLess(const char* version) const;
|
bool IsVersionLess(char const* version) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare \a version with QtIFW framework version
|
* Compare \a version with QtIFW framework version
|
||||||
*/
|
*/
|
||||||
bool IsVersionGreater(const char* version) const;
|
bool IsVersionGreater(char const* version) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare \a version with QtIFW framework version
|
* Compare \a version with QtIFW framework version
|
||||||
*/
|
*/
|
||||||
bool IsVersionEqual(const char* version) const;
|
bool IsVersionEqual(char const* version) const;
|
||||||
|
|
||||||
/** Expand the list argument containing the map of the key-value pairs.
|
/** Expand the list argument containing the map of the key-value pairs.
|
||||||
* If the number of elements is odd, then the first value is used as the
|
* If the number of elements is odd, then the first value is used as the
|
||||||
* default value with an empty key.
|
* default value with an empty key.
|
||||||
* Any values with the same keys will be permanently overwritten.
|
* Any values with the same keys will be permanently overwritten.
|
||||||
*/
|
*/
|
||||||
static void ExpandListArgument(const std::string& arg,
|
static void ExpandListArgument(std::string const& arg,
|
||||||
std::map<std::string, std::string>& argsOut);
|
std::map<std::string, std::string>& argsOut);
|
||||||
|
|
||||||
/** Expand the list argument containing the multimap of the key-value pairs.
|
/** Expand the list argument containing the multimap of the key-value pairs.
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
* default value with an empty key.
|
* default value with an empty key.
|
||||||
*/
|
*/
|
||||||
static void ExpandListArgument(
|
static void ExpandListArgument(
|
||||||
const std::string& arg, std::multimap<std::string, std::string>& argsOut);
|
std::string const& arg, std::multimap<std::string, std::string>& argsOut);
|
||||||
|
|
||||||
cmCPackIFWGenerator* Generator;
|
cmCPackIFWGenerator* Generator;
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ std::vector<std::string> cmCPackIFWGenerator::BuildRepogenCommand()
|
|||||||
return ifwCmd;
|
return ifwCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackIFWGenerator::RunRepogen(const std::string& ifwTmpFile)
|
int cmCPackIFWGenerator::RunRepogen(std::string const& ifwTmpFile)
|
||||||
{
|
{
|
||||||
if (this->Installer.RemoteRepositories.empty()) {
|
if (this->Installer.RemoteRepositories.empty()) {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -274,7 +274,7 @@ std::vector<std::string> cmCPackIFWGenerator::BuildBinaryCreatorCommand()
|
|||||||
return ifwCmd;
|
return ifwCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackIFWGenerator::RunBinaryCreator(const std::string& ifwTmpFile)
|
int cmCPackIFWGenerator::RunBinaryCreator(std::string const& ifwTmpFile)
|
||||||
{
|
{
|
||||||
std::vector<std::string> ifwCmd = this->BuildBinaryCreatorCommand();
|
std::vector<std::string> ifwCmd = this->BuildBinaryCreatorCommand();
|
||||||
cmCPackIFWLogger(VERBOSE,
|
cmCPackIFWLogger(VERBOSE,
|
||||||
@@ -303,9 +303,9 @@ int cmCPackIFWGenerator::RunBinaryCreator(const std::string& ifwTmpFile)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
|
char const* cmCPackIFWGenerator::GetPackagingInstallPrefix()
|
||||||
{
|
{
|
||||||
const char* defPrefix = this->cmCPackGenerator::GetPackagingInstallPrefix();
|
char const* defPrefix = this->cmCPackGenerator::GetPackagingInstallPrefix();
|
||||||
|
|
||||||
std::string tmpPref = defPrefix ? defPrefix : "";
|
std::string tmpPref = defPrefix ? defPrefix : "";
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ const char* cmCPackIFWGenerator::GetPackagingInstallPrefix()
|
|||||||
return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX")->c_str();
|
return this->GetOption("CPACK_IFW_PACKAGING_INSTALL_PREFIX")->c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackIFWGenerator::GetOutputExtension()
|
char const* cmCPackIFWGenerator::GetOutputExtension()
|
||||||
{
|
{
|
||||||
return this->OutputExtension.c_str();
|
return this->OutputExtension.c_str();
|
||||||
}
|
}
|
||||||
@@ -327,9 +327,9 @@ int cmCPackIFWGenerator::InitializeInternal()
|
|||||||
{
|
{
|
||||||
// Search Qt Installer Framework tools
|
// Search Qt Installer Framework tools
|
||||||
|
|
||||||
const std::string BinCreatorOpt = "CPACK_IFW_BINARYCREATOR_EXECUTABLE";
|
std::string const BinCreatorOpt = "CPACK_IFW_BINARYCREATOR_EXECUTABLE";
|
||||||
const std::string RepoGenOpt = "CPACK_IFW_REPOGEN_EXECUTABLE";
|
std::string const RepoGenOpt = "CPACK_IFW_REPOGEN_EXECUTABLE";
|
||||||
const std::string FrameworkVersionOpt = "CPACK_IFW_FRAMEWORK_VERSION";
|
std::string const FrameworkVersionOpt = "CPACK_IFW_FRAMEWORK_VERSION";
|
||||||
|
|
||||||
if (!this->IsSet(BinCreatorOpt) || !this->IsSet(RepoGenOpt) ||
|
if (!this->IsSet(BinCreatorOpt) || !this->IsSet(RepoGenOpt) ||
|
||||||
!this->IsSet(FrameworkVersionOpt)) {
|
!this->IsSet(FrameworkVersionOpt)) {
|
||||||
@@ -462,10 +462,10 @@ int cmCPackIFWGenerator::InitializeInternal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackIFWGenerator::GetComponentInstallSuffix(
|
std::string cmCPackIFWGenerator::GetComponentInstallSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
const std::string prefix = "packages/";
|
std::string const prefix = "packages/";
|
||||||
const std::string suffix = "/data";
|
std::string const suffix = "/data";
|
||||||
|
|
||||||
if (this->componentPackageMethod == this->ONE_PACKAGE) {
|
if (this->componentPackageMethod == this->ONE_PACKAGE) {
|
||||||
return cmStrCat(prefix, this->GetRootPackageName(), suffix);
|
return cmStrCat(prefix, this->GetRootPackageName(), suffix);
|
||||||
@@ -476,10 +476,10 @@ std::string cmCPackIFWGenerator::GetComponentInstallSuffix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackIFWGenerator::GetComponentInstallDirNameSuffix(
|
std::string cmCPackIFWGenerator::GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
const std::string prefix = "packages/";
|
std::string const prefix = "packages/";
|
||||||
const std::string suffix = "/data";
|
std::string const suffix = "/data";
|
||||||
|
|
||||||
if (this->componentPackageMethod == this->ONE_PACKAGE) {
|
if (this->componentPackageMethod == this->ONE_PACKAGE) {
|
||||||
return cmStrCat(prefix, this->GetRootPackageName(), suffix);
|
return cmStrCat(prefix, this->GetRootPackageName(), suffix);
|
||||||
@@ -492,7 +492,7 @@ std::string cmCPackIFWGenerator::GetComponentInstallDirNameSuffix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackComponent* cmCPackIFWGenerator::GetComponent(
|
cmCPackComponent* cmCPackIFWGenerator::GetComponent(
|
||||||
const std::string& projectName, const std::string& componentName)
|
std::string const& projectName, std::string const& componentName)
|
||||||
{
|
{
|
||||||
auto cit = this->Components.find(componentName);
|
auto cit = this->Components.find(componentName);
|
||||||
if (cit != this->Components.end()) {
|
if (cit != this->Components.end()) {
|
||||||
@@ -537,7 +537,7 @@ cmCPackComponent* cmCPackIFWGenerator::GetComponent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
|
cmCPackComponentGroup* cmCPackIFWGenerator::GetComponentGroup(
|
||||||
const std::string& projectName, const std::string& groupName)
|
std::string const& projectName, std::string const& groupName)
|
||||||
{
|
{
|
||||||
cmCPackComponentGroup* group =
|
cmCPackComponentGroup* group =
|
||||||
this->cmCPackGenerator::GetComponentGroup(projectName, groupName);
|
this->cmCPackGenerator::GetComponentGroup(projectName, groupName);
|
||||||
@@ -682,7 +682,7 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
|
cmCPackIFWRepository* cmCPackIFWGenerator::GetRepository(
|
||||||
const std::string& repositoryName)
|
std::string const& repositoryName)
|
||||||
{
|
{
|
||||||
auto rit = this->Repositories.find(repositoryName);
|
auto rit = this->Repositories.find(repositoryName);
|
||||||
if (rit != this->Repositories.end()) {
|
if (rit != this->Repositories.end()) {
|
||||||
|
|||||||
@@ -59,18 +59,18 @@ protected:
|
|||||||
*/
|
*/
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetPackagingInstallPrefix() override;
|
char const* GetPackagingInstallPrefix() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Target binary extension
|
* @brief Target binary extension
|
||||||
* @return Executable suffix or disk image format
|
* @return Executable suffix or disk image format
|
||||||
*/
|
*/
|
||||||
const char* GetOutputExtension() override;
|
char const* GetOutputExtension() override;
|
||||||
|
|
||||||
std::string GetComponentInstallSuffix(
|
std::string GetComponentInstallSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
std::string GetComponentInstallDirNameSuffix(
|
std::string GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get Component
|
* @brief Get Component
|
||||||
@@ -81,8 +81,8 @@ protected:
|
|||||||
*
|
*
|
||||||
* @return Pointer to component
|
* @return Pointer to component
|
||||||
*/
|
*/
|
||||||
cmCPackComponent* GetComponent(const std::string& projectName,
|
cmCPackComponent* GetComponent(std::string const& projectName,
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get group of component
|
* @brief Get group of component
|
||||||
@@ -94,7 +94,7 @@ protected:
|
|||||||
* @return Pointer to component group
|
* @return Pointer to component group
|
||||||
*/
|
*/
|
||||||
cmCPackComponentGroup* GetComponentGroup(
|
cmCPackComponentGroup* GetComponentGroup(
|
||||||
const std::string& projectName, const std::string& groupName) override;
|
std::string const& projectName, std::string const& groupName) override;
|
||||||
|
|
||||||
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
||||||
const override;
|
const override;
|
||||||
@@ -114,7 +114,7 @@ protected:
|
|||||||
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
|
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
|
||||||
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
|
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
|
||||||
|
|
||||||
cmCPackIFWRepository* GetRepository(const std::string& repositoryName);
|
cmCPackIFWRepository* GetRepository(std::string const& repositoryName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Data
|
// Data
|
||||||
@@ -143,10 +143,10 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::string> BuildRepogenCommand();
|
std::vector<std::string> BuildRepogenCommand();
|
||||||
int RunRepogen(const std::string& ifwTmpFile);
|
int RunRepogen(std::string const& ifwTmpFile);
|
||||||
|
|
||||||
std::vector<std::string> BuildBinaryCreatorCommand();
|
std::vector<std::string> BuildBinaryCreatorCommand();
|
||||||
int RunBinaryCreator(const std::string& ifwTmpFile);
|
int RunBinaryCreator(std::string const& ifwTmpFile);
|
||||||
|
|
||||||
std::string RepoGen;
|
std::string RepoGen;
|
||||||
std::string BinCreator;
|
std::string BinCreator;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
cmCPackIFWInstaller::cmCPackIFWInstaller() = default;
|
cmCPackIFWInstaller::cmCPackIFWInstaller() = default;
|
||||||
|
|
||||||
void cmCPackIFWInstaller::printSkippedOptionWarning(
|
void cmCPackIFWInstaller::printSkippedOptionWarning(
|
||||||
const std::string& optionName, const std::string& optionValue)
|
std::string const& optionName, std::string const& optionValue)
|
||||||
{
|
{
|
||||||
cmCPackIFWLogger(
|
cmCPackIFWLogger(
|
||||||
WARNING,
|
WARNING,
|
||||||
@@ -293,7 +293,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
|
|||||||
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
|
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
|
||||||
this->Resources.clear();
|
this->Resources.clear();
|
||||||
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
|
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
|
||||||
for (const auto& file : this->Resources) {
|
for (auto const& file : this->Resources) {
|
||||||
if (!cmSystemTools::FileExists(file)) {
|
if (!cmSystemTools::FileExists(file)) {
|
||||||
// The warning will say skipped, but there will later be a hard error
|
// The warning will say skipped, but there will later be a hard error
|
||||||
// when the binarycreator tool tries to read the missing file.
|
// when the binarycreator tool tries to read the missing file.
|
||||||
@@ -308,7 +308,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
|
|||||||
this->ProductImages.clear();
|
this->ProductImages.clear();
|
||||||
cmExpandList(productImages, this->ProductImages);
|
cmExpandList(productImages, this->ProductImages);
|
||||||
|
|
||||||
auto erase_missing_file_pred = [this](const std::string& file) -> bool {
|
auto erase_missing_file_pred = [this](std::string const& file) -> bool {
|
||||||
if (!cmSystemTools::FileExists(file)) {
|
if (!cmSystemTools::FileExists(file)) {
|
||||||
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_PRODUCT_IMAGES",
|
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_PRODUCT_IMAGES",
|
||||||
file);
|
file);
|
||||||
@@ -396,7 +396,7 @@ public:
|
|||||||
std::string path, basePath;
|
std::string path, basePath;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void StartElement(const std::string& name, const char** /*atts*/) override
|
void StartElement(std::string const& name, char const** /*atts*/) override
|
||||||
{
|
{
|
||||||
this->file = name == "file";
|
this->file = name == "file";
|
||||||
if (this->file) {
|
if (this->file) {
|
||||||
@@ -404,7 +404,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterDataHandler(const char* data, int length) override
|
void CharacterDataHandler(char const* data, int length) override
|
||||||
{
|
{
|
||||||
if (this->file) {
|
if (this->file) {
|
||||||
std::string content(data, data + length);
|
std::string content(data, data + length);
|
||||||
@@ -417,7 +417,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndElement(const std::string& /*name*/) override {}
|
void EndElement(std::string const& /*name*/) override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
void cmCPackIFWInstaller::GenerateInstallerFile()
|
void cmCPackIFWInstaller::GenerateInstallerFile()
|
||||||
@@ -621,7 +621,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
|
|||||||
// RunProgramArguments
|
// RunProgramArguments
|
||||||
if (!this->RunProgramArguments.empty()) {
|
if (!this->RunProgramArguments.empty()) {
|
||||||
xout.StartElement("RunProgramArguments");
|
xout.StartElement("RunProgramArguments");
|
||||||
for (const auto& arg : this->RunProgramArguments) {
|
for (auto const& arg : this->RunProgramArguments) {
|
||||||
xout.Element("Argument", arg);
|
xout.Element("Argument", arg);
|
||||||
}
|
}
|
||||||
xout.EndElement();
|
xout.EndElement();
|
||||||
@@ -640,7 +640,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
|
|||||||
// Product images (copy to config dir)
|
// Product images (copy to config dir)
|
||||||
if (!this->IsVersionLess("4.0") && !this->ProductImages.empty()) {
|
if (!this->IsVersionLess("4.0") && !this->ProductImages.empty()) {
|
||||||
xout.StartElement("ProductImages");
|
xout.StartElement("ProductImages");
|
||||||
const bool hasProductImageUrl = !this->ProductImageUrls.empty();
|
bool const hasProductImageUrl = !this->ProductImageUrls.empty();
|
||||||
for (size_t i = 0; i < this->ProductImages.size(); ++i) {
|
for (size_t i = 0; i < this->ProductImages.size(); ++i) {
|
||||||
xout.StartElement("ProductImage");
|
xout.StartElement("ProductImage");
|
||||||
auto const& srcImg = this->ProductImages[i];
|
auto const& srcImg = this->ProductImages[i];
|
||||||
|
|||||||
@@ -158,6 +158,6 @@ public:
|
|||||||
std::string Directory;
|
std::string Directory;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void printSkippedOptionWarning(const std::string& optionName,
|
void printSkippedOptionWarning(std::string const& optionName,
|
||||||
const std::string& optionValue);
|
std::string const& optionValue);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ cmCPackIFWPackage::CompareStruct::CompareStruct()
|
|||||||
cmCPackIFWPackage::DependenceStruct::DependenceStruct() = default;
|
cmCPackIFWPackage::DependenceStruct::DependenceStruct() = default;
|
||||||
|
|
||||||
cmCPackIFWPackage::DependenceStruct::DependenceStruct(
|
cmCPackIFWPackage::DependenceStruct::DependenceStruct(
|
||||||
const std::string& dependence)
|
std::string const& dependence)
|
||||||
{
|
{
|
||||||
// Preferred format is name and version are separated by a colon (:), but
|
// Preferred format is name and version are separated by a colon (:), but
|
||||||
// note that this is only supported with QtIFW 3.1 or later. Backward
|
// note that this is only supported with QtIFW 3.1 or later. Backward
|
||||||
@@ -51,7 +51,7 @@ cmCPackIFWPackage::DependenceStruct::DependenceStruct(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto versionPart =
|
auto const versionPart =
|
||||||
cm::string_view(dependence.data() + pos, dependence.size() - pos);
|
cm::string_view(dependence.data() + pos, dependence.size() - pos);
|
||||||
|
|
||||||
if (cmHasLiteralPrefix(versionPart, "<=")) {
|
if (cmHasLiteralPrefix(versionPart, "<=")) {
|
||||||
@@ -339,7 +339,7 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
|
|||||||
return this->ConfigureFromPrefix(prefix);
|
return this->ConfigureFromPrefix(prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
|
int cmCPackIFWPackage::ConfigureFromGroup(std::string const& groupName)
|
||||||
{
|
{
|
||||||
// Group configuration
|
// Group configuration
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Common options for components and groups
|
// Common options for components and groups
|
||||||
int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
|
int cmCPackIFWPackage::ConfigureFromPrefix(std::string const& prefix)
|
||||||
{
|
{
|
||||||
// Temporary variable for full option name
|
// Temporary variable for full option name
|
||||||
std::string option;
|
std::string option;
|
||||||
@@ -635,7 +635,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
const bool hyphensInNamesUnsupported = this->Generator &&
|
bool const hyphensInNamesUnsupported = this->Generator &&
|
||||||
!this->Generator->FrameworkVersion.empty() && this->IsVersionLess("3.1");
|
!this->Generator->FrameworkVersion.empty() && this->IsVersionLess("3.1");
|
||||||
bool warnUnsupportedNames = false;
|
bool warnUnsupportedNames = false;
|
||||||
std::set<DependenceStruct> compDepSet;
|
std::set<DependenceStruct> compDepSet;
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ public:
|
|||||||
struct DependenceStruct
|
struct DependenceStruct
|
||||||
{
|
{
|
||||||
DependenceStruct();
|
DependenceStruct();
|
||||||
explicit DependenceStruct(const std::string& dependence);
|
explicit DependenceStruct(std::string const& dependence);
|
||||||
|
|
||||||
std::string Name;
|
std::string Name;
|
||||||
CompareStruct Compare;
|
CompareStruct Compare;
|
||||||
|
|
||||||
std::string NameWithCompare() const;
|
std::string NameWithCompare() const;
|
||||||
|
|
||||||
bool operator<(const DependenceStruct& other) const
|
bool operator<(DependenceStruct const& other) const
|
||||||
{
|
{
|
||||||
return this->Name < other.Name;
|
return this->Name < other.Name;
|
||||||
}
|
}
|
||||||
@@ -132,8 +132,8 @@ public:
|
|||||||
int ConfigureFromOptions();
|
int ConfigureFromOptions();
|
||||||
int ConfigureFromComponent(cmCPackComponent* component);
|
int ConfigureFromComponent(cmCPackComponent* component);
|
||||||
int ConfigureFromGroup(cmCPackComponentGroup* group);
|
int ConfigureFromGroup(cmCPackComponentGroup* group);
|
||||||
int ConfigureFromGroup(const std::string& groupName);
|
int ConfigureFromGroup(std::string const& groupName);
|
||||||
int ConfigureFromPrefix(const std::string& prefix);
|
int ConfigureFromPrefix(std::string const& prefix);
|
||||||
|
|
||||||
void GeneratePackageFile();
|
void GeneratePackageFile();
|
||||||
|
|
||||||
|
|||||||
@@ -124,22 +124,22 @@ public:
|
|||||||
bool patched = false;
|
bool patched = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void StartElement(const std::string& name, const char** atts) override
|
void StartElement(std::string const& name, char const** atts) override
|
||||||
{
|
{
|
||||||
this->xout.StartElement(name);
|
this->xout.StartElement(name);
|
||||||
this->StartFragment(atts);
|
this->StartFragment(atts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartFragment(const char** atts)
|
void StartFragment(char const** atts)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; atts[i]; i += 2) {
|
for (size_t i = 0; atts[i]; i += 2) {
|
||||||
const char* key = atts[i];
|
char const* key = atts[i];
|
||||||
const char* value = atts[i + 1];
|
char const* value = atts[i + 1];
|
||||||
this->xout.Attribute(key, value);
|
this->xout.Attribute(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndElement(const std::string& name) override
|
void EndElement(std::string const& name) override
|
||||||
{
|
{
|
||||||
if (name == "Updates" && !this->patched) {
|
if (name == "Updates" && !this->patched) {
|
||||||
this->repository->WriteRepositoryUpdates(this->xout);
|
this->repository->WriteRepositoryUpdates(this->xout);
|
||||||
@@ -155,7 +155,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterDataHandler(const char* data, int length) override
|
void CharacterDataHandler(char const* data, int length) override
|
||||||
{
|
{
|
||||||
std::string content(data, data + length);
|
std::string content(data, data + length);
|
||||||
if (content.empty() || content == " " || content == " " ||
|
if (content.empty() || content == " " || content == " " ||
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
# include <sys/cygwin.h>
|
# include <sys/cygwin.h>
|
||||||
std::string CMakeToWixPath(const std::string& cygpath)
|
std::string CMakeToWixPath(std::string const& cygpath)
|
||||||
{
|
{
|
||||||
std::vector<char> winpath_chars;
|
std::vector<char> winpath_chars;
|
||||||
ssize_t winpath_size;
|
ssize_t winpath_size;
|
||||||
@@ -32,7 +32,7 @@ std::string CMakeToWixPath(const std::string& cygpath)
|
|||||||
return cmTrimWhitespace(winpath_chars.data());
|
return cmTrimWhitespace(winpath_chars.data());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
std::string CMakeToWixPath(const std::string& path)
|
std::string CMakeToWixPath(std::string const& path)
|
||||||
{
|
{
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string CMakeToWixPath(const std::string& cygpath);
|
std::string CMakeToWixPath(std::string const& cygpath);
|
||||||
|
|||||||
@@ -1224,7 +1224,7 @@ std::string cmCPackWIXGenerator::CreateHashedId(
|
|||||||
cmCryptoHash sha1(cmCryptoHash::AlgoSHA1);
|
cmCryptoHash sha1(cmCryptoHash::AlgoSHA1);
|
||||||
std::string const hash = sha1.HashString(path);
|
std::string const hash = sha1.HashString(path);
|
||||||
|
|
||||||
const size_t maxFileNameLength = 52;
|
size_t const maxFileNameLength = 52;
|
||||||
std::string identifier =
|
std::string identifier =
|
||||||
cmStrCat(cm::string_view(hash).substr(0, 7), '_',
|
cmStrCat(cm::string_view(hash).substr(0, 7), '_',
|
||||||
cm::string_view(normalizedFilename).substr(0, maxFileNameLength));
|
cm::string_view(normalizedFilename).substr(0, maxFileNameLength));
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ public:
|
|||||||
cmCPackTypeMacro(cmCPackWIXGenerator, cmCPackGenerator);
|
cmCPackTypeMacro(cmCPackWIXGenerator, cmCPackGenerator);
|
||||||
|
|
||||||
cmCPackWIXGenerator();
|
cmCPackWIXGenerator();
|
||||||
cmCPackWIXGenerator(const cmCPackWIXGenerator&) = delete;
|
cmCPackWIXGenerator(cmCPackWIXGenerator const&) = delete;
|
||||||
const cmCPackWIXGenerator& operator=(const cmCPackWIXGenerator&) = delete;
|
cmCPackWIXGenerator const& operator=(cmCPackWIXGenerator const&) = delete;
|
||||||
~cmCPackWIXGenerator();
|
~cmCPackWIXGenerator();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -33,7 +33,7 @@ protected:
|
|||||||
|
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
|
|
||||||
const char* GetOutputExtension() override { return ".msi"; }
|
char const* GetOutputExtension() override { return ".msi"; }
|
||||||
|
|
||||||
enum CPackSetDestdirSupport SupportsSetDestdir() const override
|
enum CPackSetDestdirSupport SupportsSetDestdir() const override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void cmWIXAccessControlList::ReportError(std::string const& entry,
|
|||||||
|
|
||||||
bool cmWIXAccessControlList::IsBooleanAttribute(std::string const& name)
|
bool cmWIXAccessControlList::IsBooleanAttribute(std::string const& name)
|
||||||
{
|
{
|
||||||
static const char* validAttributes[] = {
|
static char const* validAttributes[] = {
|
||||||
/* clang-format needs this comment to break after the opening brace */
|
/* clang-format needs this comment to break after the opening brace */
|
||||||
"Append",
|
"Append",
|
||||||
"ChangePermission",
|
"ChangePermission",
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ public:
|
|||||||
void CreateCMakePackageRegistryEntry(std::string const& package,
|
void CreateCMakePackageRegistryEntry(std::string const& package,
|
||||||
std::string const& upgradeGuid);
|
std::string const& upgradeGuid);
|
||||||
|
|
||||||
void EmitFeatureForComponentGroup(const cmCPackComponentGroup& group,
|
void EmitFeatureForComponentGroup(cmCPackComponentGroup const& group,
|
||||||
cmWIXPatch& patch);
|
cmWIXPatch& patch);
|
||||||
|
|
||||||
void EmitFeatureForComponent(const cmCPackComponent& component,
|
void EmitFeatureForComponent(cmCPackComponent const& component,
|
||||||
cmWIXPatch& patch);
|
cmWIXPatch& patch);
|
||||||
|
|
||||||
void EmitComponentRef(std::string const& id);
|
void EmitComponentRef(std::string const& id);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ void cmWIXPatch::ApplyFragment(std::string const& id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cmWIXPatchElement& fragment = i->second;
|
cmWIXPatchElement const& fragment = i->second;
|
||||||
for (auto const& attr : fragment.attributes) {
|
for (auto const& attr : fragment.attributes) {
|
||||||
writer.AddAttribute(attr.first, attr.second);
|
writer.AddAttribute(attr.first, attr.second);
|
||||||
}
|
}
|
||||||
@@ -39,22 +39,22 @@ void cmWIXPatch::ApplyFragment(std::string const& id,
|
|||||||
Fragments.erase(i);
|
Fragments.erase(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatch::ApplyElementChildren(const cmWIXPatchElement& element,
|
void cmWIXPatch::ApplyElementChildren(cmWIXPatchElement const& element,
|
||||||
cmWIXSourceWriter& writer)
|
cmWIXSourceWriter& writer)
|
||||||
{
|
{
|
||||||
for (const auto& node : element.children) {
|
for (auto const& node : element.children) {
|
||||||
switch (node->type()) {
|
switch (node->type()) {
|
||||||
case cmWIXPatchNode::ELEMENT:
|
case cmWIXPatchNode::ELEMENT:
|
||||||
ApplyElement(dynamic_cast<const cmWIXPatchElement&>(*node), writer);
|
ApplyElement(dynamic_cast<cmWIXPatchElement const&>(*node), writer);
|
||||||
break;
|
break;
|
||||||
case cmWIXPatchNode::TEXT:
|
case cmWIXPatchNode::TEXT:
|
||||||
writer.AddTextNode(dynamic_cast<const cmWIXPatchText&>(*node).text);
|
writer.AddTextNode(dynamic_cast<cmWIXPatchText const&>(*node).text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatch::ApplyElement(const cmWIXPatchElement& element,
|
void cmWIXPatch::ApplyElement(cmWIXPatchElement const& element,
|
||||||
cmWIXSourceWriter& writer)
|
cmWIXSourceWriter& writer)
|
||||||
{
|
{
|
||||||
writer.BeginElement(element.name);
|
writer.BeginElement(element.name);
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ public:
|
|||||||
bool CheckForUnappliedFragments();
|
bool CheckForUnappliedFragments();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ApplyElementChildren(const cmWIXPatchElement& element,
|
void ApplyElementChildren(cmWIXPatchElement const& element,
|
||||||
cmWIXSourceWriter& writer);
|
cmWIXSourceWriter& writer);
|
||||||
|
|
||||||
void ApplyElement(const cmWIXPatchElement& element,
|
void ApplyElement(cmWIXPatchElement const& element,
|
||||||
cmWIXSourceWriter& writer);
|
cmWIXSourceWriter& writer);
|
||||||
|
|
||||||
cmCPackLog* Logger;
|
cmCPackLog* Logger;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ cmWIXPatchParser::cmWIXPatchParser(fragment_map_t& fragments,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
|
void cmWIXPatchParser::StartElement(std::string const& name, char const** atts)
|
||||||
{
|
{
|
||||||
if (State == BEGIN_DOCUMENT) {
|
if (State == BEGIN_DOCUMENT) {
|
||||||
if (name == "CPackWiXPatch"_s) {
|
if (name == "CPackWiXPatch"_s) {
|
||||||
@@ -69,13 +69,13 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatchParser::StartFragment(const char** attributes)
|
void cmWIXPatchParser::StartFragment(char const** attributes)
|
||||||
{
|
{
|
||||||
cmWIXPatchElement* new_element = nullptr;
|
cmWIXPatchElement* new_element = nullptr;
|
||||||
/* find the id of for fragment */
|
/* find the id of for fragment */
|
||||||
for (size_t i = 0; attributes[i]; i += 2) {
|
for (size_t i = 0; attributes[i]; i += 2) {
|
||||||
const std::string key = attributes[i];
|
std::string const key = attributes[i];
|
||||||
const std::string value = attributes[i + 1];
|
std::string const value = attributes[i + 1];
|
||||||
|
|
||||||
if (key == "Id"_s) {
|
if (key == "Id"_s) {
|
||||||
if (Fragments.find(value) != Fragments.end()) {
|
if (Fragments.find(value) != Fragments.end()) {
|
||||||
@@ -94,8 +94,8 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
|
|||||||
ReportValidationError("No 'Id' specified for 'CPackWixFragment' element");
|
ReportValidationError("No 'Id' specified for 'CPackWixFragment' element");
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; attributes[i]; i += 2) {
|
for (size_t i = 0; attributes[i]; i += 2) {
|
||||||
const std::string key = attributes[i];
|
std::string const key = attributes[i];
|
||||||
const std::string value = attributes[i + 1];
|
std::string const value = attributes[i + 1];
|
||||||
|
|
||||||
if (key != "Id"_s) {
|
if (key != "Id"_s) {
|
||||||
new_element->attributes[key] = value;
|
new_element->attributes[key] = value;
|
||||||
@@ -104,7 +104,7 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatchParser::EndElement(const std::string& name)
|
void cmWIXPatchParser::EndElement(std::string const& name)
|
||||||
{
|
{
|
||||||
if (State == INSIDE_FRAGMENT) {
|
if (State == INSIDE_FRAGMENT) {
|
||||||
if (name == "CPackWiXFragment"_s) {
|
if (name == "CPackWiXFragment"_s) {
|
||||||
@@ -116,9 +116,9 @@ void cmWIXPatchParser::EndElement(const std::string& name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatchParser::CharacterDataHandler(const char* data, int length)
|
void cmWIXPatchParser::CharacterDataHandler(char const* data, int length)
|
||||||
{
|
{
|
||||||
const char* whitespace = "\x20\x09\x0d\x0a";
|
char const* whitespace = "\x20\x09\x0d\x0a";
|
||||||
|
|
||||||
if (State == INSIDE_FRAGMENT) {
|
if (State == INSIDE_FRAGMENT) {
|
||||||
cmWIXPatchElement& parent = *ElementStack.back();
|
cmWIXPatchElement& parent = *ElementStack.back();
|
||||||
@@ -137,7 +137,7 @@ void cmWIXPatchParser::CharacterDataHandler(const char* data, int length)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmWIXPatchParser::ReportError(int line, int column, const char* msg)
|
void cmWIXPatchParser::ReportError(int line, int column, char const* msg)
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"Error while processing XML patch file at "
|
"Error while processing XML patch file at "
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ struct cmWIXPatchElement : cmWIXPatchNode
|
|||||||
|
|
||||||
cmWIXPatchElement();
|
cmWIXPatchElement();
|
||||||
|
|
||||||
cmWIXPatchElement(const cmWIXPatchElement&) = delete;
|
cmWIXPatchElement(cmWIXPatchElement const&) = delete;
|
||||||
const cmWIXPatchElement& operator=(const cmWIXPatchElement&) = delete;
|
cmWIXPatchElement const& operator=(cmWIXPatchElement const&) = delete;
|
||||||
|
|
||||||
~cmWIXPatchElement();
|
~cmWIXPatchElement();
|
||||||
|
|
||||||
@@ -59,15 +59,15 @@ public:
|
|||||||
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
|
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void StartElement(const std::string& name, const char** atts);
|
virtual void StartElement(std::string const& name, char const** atts);
|
||||||
|
|
||||||
void StartFragment(const char** attributes);
|
void StartFragment(char const** attributes);
|
||||||
|
|
||||||
virtual void EndElement(const std::string& name);
|
virtual void EndElement(std::string const& name);
|
||||||
|
|
||||||
virtual void CharacterDataHandler(const char* data, int length);
|
virtual void CharacterDataHandler(char const* data, int length);
|
||||||
|
|
||||||
virtual void ReportError(int line, int column, const char* msg);
|
virtual void ReportError(int line, int column, char const* msg);
|
||||||
|
|
||||||
void ReportValidationError(std::string const& message);
|
void ReportValidationError(std::string const& message);
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ private:
|
|||||||
* @return DeduplicateStatus indicating whether to add, skip, or flag an
|
* @return DeduplicateStatus indicating whether to add, skip, or flag an
|
||||||
* error for the file.
|
* error for the file.
|
||||||
*/
|
*/
|
||||||
DeduplicateStatus CompareFile(const std::string& path,
|
DeduplicateStatus CompareFile(std::string const& path,
|
||||||
const std::string& localTopLevel)
|
std::string const& localTopLevel)
|
||||||
{
|
{
|
||||||
auto fileItr = this->Files.find(path);
|
auto fileItr = this->Files.find(path);
|
||||||
if (fileItr != this->Files.end()) {
|
if (fileItr != this->Files.end()) {
|
||||||
@@ -65,7 +65,7 @@ private:
|
|||||||
* @param path The path of the folder to compare.
|
* @param path The path of the folder to compare.
|
||||||
* @return DeduplicateStatus indicating whether to add or skip the folder.
|
* @return DeduplicateStatus indicating whether to add or skip the folder.
|
||||||
*/
|
*/
|
||||||
DeduplicateStatus CompareFolder(const std::string& path)
|
DeduplicateStatus CompareFolder(std::string const& path)
|
||||||
{
|
{
|
||||||
if (this->Folders.find(path) != this->Folders.end()) {
|
if (this->Folders.find(path) != this->Folders.end()) {
|
||||||
return DeduplicateStatus::Skip;
|
return DeduplicateStatus::Skip;
|
||||||
@@ -82,7 +82,7 @@ private:
|
|||||||
* @return DeduplicateStatus indicating whether to add, skip, or flag an
|
* @return DeduplicateStatus indicating whether to add, skip, or flag an
|
||||||
* error for the symlink.
|
* error for the symlink.
|
||||||
*/
|
*/
|
||||||
DeduplicateStatus CompareSymlink(const std::string& path)
|
DeduplicateStatus CompareSymlink(std::string const& path)
|
||||||
{
|
{
|
||||||
auto symlinkItr = this->Symlink.find(path);
|
auto symlinkItr = this->Symlink.find(path);
|
||||||
std::string symlinkValue;
|
std::string symlinkValue;
|
||||||
@@ -112,8 +112,8 @@ public:
|
|||||||
* @return DeduplicateStatus indicating the action to take for the given
|
* @return DeduplicateStatus indicating the action to take for the given
|
||||||
* path.
|
* path.
|
||||||
*/
|
*/
|
||||||
DeduplicateStatus IsDeduplicate(const std::string& path,
|
DeduplicateStatus IsDeduplicate(std::string const& path,
|
||||||
const std::string& localTopLevel)
|
std::string const& localTopLevel)
|
||||||
{
|
{
|
||||||
DeduplicateStatus status;
|
DeduplicateStatus status;
|
||||||
if (cmSystemTools::FileIsDirectory(path)) {
|
if (cmSystemTools::FileIsDirectory(path)) {
|
||||||
@@ -186,7 +186,7 @@ cmCPackArchiveGenerator::cmCPackArchiveGenerator(
|
|||||||
cmCPackArchiveGenerator::~cmCPackArchiveGenerator() = default;
|
cmCPackArchiveGenerator::~cmCPackArchiveGenerator() = default;
|
||||||
|
|
||||||
std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
|
std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
|
||||||
const std::string& component, bool isGroupName)
|
std::string const& component, bool isGroupName)
|
||||||
{
|
{
|
||||||
std::string componentUpper(cmSystemTools::UpperCase(component));
|
std::string componentUpper(cmSystemTools::UpperCase(component));
|
||||||
std::string packageFileName;
|
std::string packageFileName;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// get archive component filename
|
// get archive component filename
|
||||||
std::string GetArchiveComponentFileName(const std::string& component,
|
std::string GetArchiveComponentFileName(std::string const& component,
|
||||||
bool isGroupName);
|
bool isGroupName);
|
||||||
|
|
||||||
class Deduplicator;
|
class Deduplicator;
|
||||||
@@ -82,9 +82,9 @@ protected:
|
|||||||
int PackageComponentsAllInOne();
|
int PackageComponentsAllInOne();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char* GetNameOfClass() override { return "cmCPackArchiveGenerator"; }
|
char const* GetNameOfClass() override { return "cmCPackArchiveGenerator"; }
|
||||||
|
|
||||||
const char* GetOutputExtension() override
|
char const* GetOutputExtension() override
|
||||||
{
|
{
|
||||||
return this->OutputExtension.c_str();
|
return this->OutputExtension.c_str();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ int cmCPackBundleGenerator::InitializeInternal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")) {
|
if (this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP")) {
|
||||||
const std::string codesign_path = cmSystemTools::FindProgram(
|
std::string const codesign_path = cmSystemTools::FindProgram(
|
||||||
"codesign", std::vector<std::string>(), false);
|
"codesign", std::vector<std::string>(), false);
|
||||||
|
|
||||||
if (codesign_path.empty()) {
|
if (codesign_path.empty()) {
|
||||||
@@ -41,7 +41,7 @@ int cmCPackBundleGenerator::InitializeInternal()
|
|||||||
return this->Superclass::InitializeInternal();
|
return this->Superclass::InitializeInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackBundleGenerator::GetPackagingInstallPrefix()
|
char const* cmCPackBundleGenerator::GetPackagingInstallPrefix()
|
||||||
{
|
{
|
||||||
this->InstallPrefix = cmStrCat('/', this->GetOption("CPACK_BUNDLE_NAME"),
|
this->InstallPrefix = cmStrCat('/', this->GetOption("CPACK_BUNDLE_NAME"),
|
||||||
".app/Contents/Resources");
|
".app/Contents/Resources");
|
||||||
@@ -176,7 +176,7 @@ bool cmCPackBundleGenerator::SupportsComponentInstallation() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
|
int cmCPackBundleGenerator::SignBundle(std::string const& src_dir)
|
||||||
{
|
{
|
||||||
cmValue cpack_apple_cert_app =
|
cmValue cpack_apple_cert_app =
|
||||||
this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
|
this->GetOption("CPACK_BUNDLE_APPLE_CERT_APP");
|
||||||
@@ -189,7 +189,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
|
|||||||
cmStrCat(src_dir, '/', this->GetOption("CPACK_BUNDLE_NAME"), ".app");
|
cmStrCat(src_dir, '/', this->GetOption("CPACK_BUNDLE_NAME"), ".app");
|
||||||
|
|
||||||
// A list of additional files to sign, ie. frameworks and plugins.
|
// A list of additional files to sign, ie. frameworks and plugins.
|
||||||
const std::string sign_parameter =
|
std::string const sign_parameter =
|
||||||
this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
|
this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
|
||||||
? *this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
|
? *this->GetOption("CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER")
|
||||||
: "--deep -f";
|
: "--deep -f";
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
const char* GetPackagingInstallPrefix() override;
|
char const* GetPackagingInstallPrefix() override;
|
||||||
int ConstructBundle();
|
int ConstructBundle();
|
||||||
int SignBundle(const std::string& src_dir);
|
int SignBundle(std::string const& src_dir);
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
|
|
||||||
unsigned long cmCPackComponent::GetInstalledSize(
|
unsigned long cmCPackComponent::GetInstalledSize(
|
||||||
const std::string& installDir) const
|
std::string const& installDir) const
|
||||||
{
|
{
|
||||||
if (this->TotalSize != 0) {
|
if (this->TotalSize != 0) {
|
||||||
return this->TotalSize;
|
return this->TotalSize;
|
||||||
@@ -23,7 +23,7 @@ unsigned long cmCPackComponent::GetInstalledSize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned long cmCPackComponent::GetInstalledSizeInKbytes(
|
unsigned long cmCPackComponent::GetInstalledSizeInKbytes(
|
||||||
const std::string& installDir) const
|
std::string const& installDir) const
|
||||||
{
|
{
|
||||||
unsigned long result = (this->GetInstalledSize(installDir) + 512) / 1024;
|
unsigned long result = (this->GetInstalledSize(installDir) + 512) / 1024;
|
||||||
return result ? result : 1;
|
return result ? result : 1;
|
||||||
|
|||||||
@@ -94,11 +94,11 @@ public:
|
|||||||
/// Get the total installed size of all of the files in this
|
/// Get the total installed size of all of the files in this
|
||||||
/// component, in bytes. installDir is the directory into which the
|
/// component, in bytes. installDir is the directory into which the
|
||||||
/// component was installed.
|
/// component was installed.
|
||||||
unsigned long GetInstalledSize(const std::string& installDir) const;
|
unsigned long GetInstalledSize(std::string const& installDir) const;
|
||||||
|
|
||||||
/// Identical to GetInstalledSize, but returns the result in
|
/// Identical to GetInstalledSize, but returns the result in
|
||||||
/// kilobytes.
|
/// kilobytes.
|
||||||
unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
|
unsigned long GetInstalledSizeInKbytes(std::string const& installDir) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable unsigned long TotalSize = 0;
|
mutable unsigned long TotalSize = 0;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ int cmCPackCygwinBinaryGenerator::PackageFiles()
|
|||||||
return this->Superclass::PackageFiles();
|
return this->Superclass::PackageFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
|
char const* cmCPackCygwinBinaryGenerator::GetOutputExtension()
|
||||||
{
|
{
|
||||||
this->OutputExtension = "-";
|
this->OutputExtension = "-";
|
||||||
cmValue patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
cmValue patchNumber = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetOutputExtension() override;
|
char const* GetOutputExtension() override;
|
||||||
std::string OutputExtension;
|
std::string OutputExtension;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
|
|||||||
// Now create a tar file that contains the above .tar.bz2 file
|
// Now create a tar file that contains the above .tar.bz2 file
|
||||||
// and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY
|
// and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY
|
||||||
// files
|
// files
|
||||||
const std::string& compressOutFile = packageDirFileName;
|
std::string const& compressOutFile = packageDirFileName;
|
||||||
// at this point compressOutFile is the full path to
|
// at this point compressOutFile is the full path to
|
||||||
// _CPack_Package/.../package-2.5.0.tar.bz2
|
// _CPack_Package/.../package-2.5.0.tar.bz2
|
||||||
// we want to create a tar _CPack_Package/.../package-2.5.0-1-src.tar.bz2
|
// we want to create a tar _CPack_Package/.../package-2.5.0-1-src.tar.bz2
|
||||||
@@ -135,14 +135,14 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
|
char const* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
|
||||||
{
|
{
|
||||||
this->InstallPrefix =
|
this->InstallPrefix =
|
||||||
cmStrCat('/', this->GetOption("CPACK_PACKAGE_FILE_NAME"));
|
cmStrCat('/', this->GetOption("CPACK_PACKAGE_FILE_NAME"));
|
||||||
return this->InstallPrefix.c_str();
|
return this->InstallPrefix.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
|
char const* cmCPackCygwinSourceGenerator::GetOutputExtension()
|
||||||
{
|
{
|
||||||
this->OutputExtension = "-";
|
this->OutputExtension = "-";
|
||||||
cmValue patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
cmValue patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ public:
|
|||||||
~cmCPackCygwinSourceGenerator() override;
|
~cmCPackCygwinSourceGenerator() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char* GetPackagingInstallPrefix() override;
|
char const* GetPackagingInstallPrefix() override;
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetOutputExtension() override;
|
char const* GetOutputExtension() override;
|
||||||
std::string InstallPrefix;
|
std::string InstallPrefix;
|
||||||
std::string OutputExtension;
|
std::string OutputExtension;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,23 +51,23 @@ private:
|
|||||||
bool generateDeb() const;
|
bool generateDeb() const;
|
||||||
|
|
||||||
cmCPackLog* Logger;
|
cmCPackLog* Logger;
|
||||||
const std::string OutputName;
|
std::string const OutputName;
|
||||||
const std::string WorkDir;
|
std::string const WorkDir;
|
||||||
std::string CompressionSuffix;
|
std::string CompressionSuffix;
|
||||||
const std::string TopLevelDir;
|
std::string const TopLevelDir;
|
||||||
const std::string TemporaryDir;
|
std::string const TemporaryDir;
|
||||||
const std::string DebianArchiveType;
|
std::string const DebianArchiveType;
|
||||||
long NumThreads;
|
long NumThreads;
|
||||||
const std::map<std::string, std::string> ControlValues;
|
std::map<std::string, std::string> const ControlValues;
|
||||||
const bool GenShLibs;
|
bool const GenShLibs;
|
||||||
const std::string ShLibsFilename;
|
std::string const ShLibsFilename;
|
||||||
const bool GenPostInst;
|
bool const GenPostInst;
|
||||||
const std::string PostInst;
|
std::string const PostInst;
|
||||||
const bool GenPostRm;
|
bool const GenPostRm;
|
||||||
const std::string PostRm;
|
std::string const PostRm;
|
||||||
cmValue ControlExtra;
|
cmValue ControlExtra;
|
||||||
const bool PermissionStrictPolicy;
|
bool const PermissionStrictPolicy;
|
||||||
const std::vector<std::string> PackageFiles;
|
std::vector<std::string> const PackageFiles;
|
||||||
cmArchiveWrite::Compress TarCompressionType;
|
cmArchiveWrite::Compress TarCompressionType;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ bool DebGenerator::generate() const
|
|||||||
void DebGenerator::generateDebianBinaryFile() const
|
void DebGenerator::generateDebianBinaryFile() const
|
||||||
{
|
{
|
||||||
// debian-binary file
|
// debian-binary file
|
||||||
const std::string dbfilename = this->WorkDir + "/debian-binary";
|
std::string const dbfilename = this->WorkDir + "/debian-binary";
|
||||||
cmGeneratedFileStream out;
|
cmGeneratedFileStream out;
|
||||||
out.Open(dbfilename, false, true);
|
out.Open(dbfilename, false, true);
|
||||||
out << "2.0\n"; // required for valid debian package
|
out << "2.0\n"; // required for valid debian package
|
||||||
@@ -342,9 +342,9 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
|
|||||||
and
|
and
|
||||||
https://lintian.debian.org/tags/control-file-has-bad-permissions.html
|
https://lintian.debian.org/tags/control-file-has-bad-permissions.html
|
||||||
*/
|
*/
|
||||||
const mode_t permission644 = 0644;
|
mode_t const permission644 = 0644;
|
||||||
const mode_t permissionExecute = 0111;
|
mode_t const permissionExecute = 0111;
|
||||||
const mode_t permission755 = permission644 | permissionExecute;
|
mode_t const permission755 = permission644 | permissionExecute;
|
||||||
|
|
||||||
// for md5sum and control (that we have generated here), we use 644
|
// for md5sum and control (that we have generated here), we use 644
|
||||||
// (RW-R--R--)
|
// (RW-R--R--)
|
||||||
@@ -420,7 +420,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
|
|||||||
if (this->ControlExtra) {
|
if (this->ControlExtra) {
|
||||||
// permissions are now controlled by the original file permissions
|
// permissions are now controlled by the original file permissions
|
||||||
|
|
||||||
static const char* strictFiles[] = { "config", "postinst", "postrm",
|
static char const* strictFiles[] = { "config", "postinst", "postrm",
|
||||||
"preinst", "prerm" };
|
"preinst", "prerm" };
|
||||||
std::set<std::string> setStrictFiles(
|
std::set<std::string> setStrictFiles(
|
||||||
strictFiles, strictFiles + sizeof(strictFiles) / sizeof(strictFiles[0]));
|
strictFiles, strictFiles + sizeof(strictFiles) / sizeof(strictFiles[0]));
|
||||||
@@ -501,7 +501,7 @@ bool DebGenerator::generateDeb() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> findFilesIn(const std::string& path)
|
std::vector<std::string> findFilesIn(std::string const& path)
|
||||||
{
|
{
|
||||||
cmsys::Glob gl;
|
cmsys::Glob gl;
|
||||||
std::string findExpr = path + "/*";
|
std::string findExpr = path + "/*";
|
||||||
@@ -614,7 +614,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int cmCPackDebGenerator::PackageComponentsAllInOne(
|
int cmCPackDebGenerator::PackageComponentsAllInOne(
|
||||||
const std::string& compInstDirName)
|
std::string const& compInstDirName)
|
||||||
{
|
{
|
||||||
/* Reset package file name list it will be populated during the
|
/* Reset package file name list it will be populated during the
|
||||||
* component packaging run*/
|
* component packaging run*/
|
||||||
@@ -684,12 +684,12 @@ int cmCPackDebGenerator::PackageFiles()
|
|||||||
|
|
||||||
bool cmCPackDebGenerator::createDebPackages()
|
bool cmCPackDebGenerator::createDebPackages()
|
||||||
{
|
{
|
||||||
auto make_package = [this](const std::string& path,
|
auto make_package = [this](std::string const& path,
|
||||||
const char* const output_var,
|
char const* const output_var,
|
||||||
bool (cmCPackDebGenerator::*creator)()) -> bool {
|
bool (cmCPackDebGenerator::*creator)()) -> bool {
|
||||||
try {
|
try {
|
||||||
this->packageFiles = findFilesIn(path);
|
this->packageFiles = findFilesIn(path);
|
||||||
} catch (const std::runtime_error& ex) {
|
} catch (std::runtime_error const& ex) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
|
cmCPackLogger(cmCPackLog::LOG_ERROR, ex.what() << std::endl);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -805,12 +805,12 @@ bool cmCPackDebGenerator::createDeb()
|
|||||||
controlValues["Multi-Arch"] = *debian_pkg_multiarch;
|
controlValues["Multi-Arch"] = *debian_pkg_multiarch;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string strGenWDIR(this->GetOption("GEN_WDIR"));
|
std::string const strGenWDIR(this->GetOption("GEN_WDIR"));
|
||||||
const std::string shlibsfilename = strGenWDIR + "/shlibs";
|
std::string const shlibsfilename = strGenWDIR + "/shlibs";
|
||||||
|
|
||||||
cmValue debian_pkg_shlibs =
|
cmValue debian_pkg_shlibs =
|
||||||
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS");
|
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS");
|
||||||
const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") &&
|
bool const gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") &&
|
||||||
cmNonempty(debian_pkg_shlibs);
|
cmNonempty(debian_pkg_shlibs);
|
||||||
if (gen_shibs) {
|
if (gen_shibs) {
|
||||||
cmGeneratedFileStream out;
|
cmGeneratedFileStream out;
|
||||||
@@ -819,8 +819,8 @@ bool cmCPackDebGenerator::createDeb()
|
|||||||
out << '\n';
|
out << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string postinst = strGenWDIR + "/postinst";
|
std::string const postinst = strGenWDIR + "/postinst";
|
||||||
const std::string postrm = strGenWDIR + "/postrm";
|
std::string const postrm = strGenWDIR + "/postrm";
|
||||||
if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST")) {
|
if (this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST")) {
|
||||||
cmGeneratedFileStream out;
|
cmGeneratedFileStream out;
|
||||||
out.Open(postinst, false, true);
|
out.Open(postinst, false, true);
|
||||||
@@ -915,7 +915,7 @@ bool cmCPackDebGenerator::SupportsComponentInstallation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackDebGenerator::GetComponentInstallSuffix(
|
std::string cmCPackDebGenerator::GetComponentInstallSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
|
if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
|
||||||
return componentName;
|
return componentName;
|
||||||
@@ -935,7 +935,7 @@ std::string cmCPackDebGenerator::GetComponentInstallSuffix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
|
std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
return this->GetSanitizedDirOrFileName(
|
return this->GetSanitizedDirOrFileName(
|
||||||
this->GetComponentInstallSuffix(componentName));
|
this->GetComponentInstallSuffix(componentName));
|
||||||
|
|||||||
@@ -55,14 +55,14 @@ protected:
|
|||||||
* Special case of component install where all
|
* Special case of component install where all
|
||||||
* components will be put in a single installer.
|
* components will be put in a single installer.
|
||||||
*/
|
*/
|
||||||
int PackageComponentsAllInOne(const std::string& compInstDirName);
|
int PackageComponentsAllInOne(std::string const& compInstDirName);
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetOutputExtension() override { return ".deb"; }
|
char const* GetOutputExtension() override { return ".deb"; }
|
||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
std::string GetComponentInstallSuffix(
|
std::string GetComponentInstallSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
std::string GetComponentInstallDirNameSuffix(
|
std::string GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool createDebPackages();
|
bool createDebPackages();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
# include <CoreServices/CoreServices.h>
|
# include <CoreServices/CoreServices.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const uint16_t DefaultLpic[] = {
|
static uint16_t const DefaultLpic[] = {
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
0x0002, 0x0011, 0x0003, 0x0001, 0x0000, 0x0000, 0x0002, 0x0000,
|
0x0002, 0x0011, 0x0003, 0x0001, 0x0000, 0x0000, 0x0002, 0x0000,
|
||||||
0x0008, 0x0003, 0x0000, 0x0001, 0x0004, 0x0000, 0x0004, 0x0005,
|
0x0008, 0x0003, 0x0000, 0x0001, 0x0004, 0x0000, 0x0004, 0x0005,
|
||||||
@@ -47,7 +47,7 @@ static const uint16_t DefaultLpic[] = {
|
|||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::vector<std::string> DefaultMenu = {
|
static std::vector<std::string> const DefaultMenu = {
|
||||||
{ "English", "Agree", "Disagree", "Print", "Save...",
|
{ "English", "Agree", "Disagree", "Print", "Save...",
|
||||||
// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
|
// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
|
||||||
"You agree to the License Agreement terms when "
|
"You agree to the License Agreement terms when "
|
||||||
@@ -75,7 +75,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
|
|||||||
paths.emplace_back("/Applications/Xcode.app/Contents/Developer/Tools");
|
paths.emplace_back("/Applications/Xcode.app/Contents/Developer/Tools");
|
||||||
paths.emplace_back("/Developer/Tools");
|
paths.emplace_back("/Developer/Tools");
|
||||||
|
|
||||||
const std::string hdiutil_path =
|
std::string const hdiutil_path =
|
||||||
cmSystemTools::FindProgram("hdiutil", std::vector<std::string>(), false);
|
cmSystemTools::FindProgram("hdiutil", std::vector<std::string>(), false);
|
||||||
if (hdiutil_path.empty()) {
|
if (hdiutil_path.empty()) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
@@ -84,7 +84,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
|
|||||||
}
|
}
|
||||||
this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path);
|
this->SetOptionIfNotSet("CPACK_COMMAND_HDIUTIL", hdiutil_path);
|
||||||
|
|
||||||
const std::string setfile_path =
|
std::string const setfile_path =
|
||||||
cmSystemTools::FindProgram("SetFile", paths, false);
|
cmSystemTools::FindProgram("SetFile", paths, false);
|
||||||
if (setfile_path.empty()) {
|
if (setfile_path.empty()) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
@@ -93,7 +93,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
|
|||||||
}
|
}
|
||||||
this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path);
|
this->SetOptionIfNotSet("CPACK_COMMAND_SETFILE", setfile_path);
|
||||||
|
|
||||||
const std::string rez_path = cmSystemTools::FindProgram("Rez", paths, false);
|
std::string const rez_path = cmSystemTools::FindProgram("Rez", paths, false);
|
||||||
if (rez_path.empty()) {
|
if (rez_path.empty()) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"Cannot locate Rez command" << std::endl);
|
"Cannot locate Rez command" << std::endl);
|
||||||
@@ -166,7 +166,7 @@ int cmCPackDragNDropGenerator::InitializeInternal()
|
|||||||
return this->Superclass::InitializeInternal();
|
return this->Superclass::InitializeInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackDragNDropGenerator::GetOutputExtension()
|
char const* cmCPackDragNDropGenerator::GetOutputExtension()
|
||||||
{
|
{
|
||||||
return ".dmg";
|
return ".dmg";
|
||||||
}
|
}
|
||||||
@@ -266,22 +266,22 @@ bool cmCPackDragNDropGenerator::RunCommand(std::string const& command,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
int cmCPackDragNDropGenerator::CreateDMG(std::string const& src_dir,
|
||||||
const std::string& output_file)
|
std::string const& output_file)
|
||||||
{
|
{
|
||||||
// Get optional arguments ...
|
// Get optional arguments ...
|
||||||
cmValue cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON");
|
cmValue cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON");
|
||||||
|
|
||||||
const std::string cpack_dmg_volume_name =
|
std::string const cpack_dmg_volume_name =
|
||||||
this->GetOption("CPACK_DMG_VOLUME_NAME")
|
this->GetOption("CPACK_DMG_VOLUME_NAME")
|
||||||
? *this->GetOption("CPACK_DMG_VOLUME_NAME")
|
? *this->GetOption("CPACK_DMG_VOLUME_NAME")
|
||||||
: *this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
: *this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
|
|
||||||
const std::string cpack_dmg_format = this->GetOption("CPACK_DMG_FORMAT")
|
std::string const cpack_dmg_format = this->GetOption("CPACK_DMG_FORMAT")
|
||||||
? *this->GetOption("CPACK_DMG_FORMAT")
|
? *this->GetOption("CPACK_DMG_FORMAT")
|
||||||
: "UDZO";
|
: "UDZO";
|
||||||
|
|
||||||
const std::string cpack_dmg_filesystem =
|
std::string const cpack_dmg_filesystem =
|
||||||
this->GetOption("CPACK_DMG_FILESYSTEM")
|
this->GetOption("CPACK_DMG_FILESYSTEM")
|
||||||
? *this->GetOption("CPACK_DMG_FILESYSTEM")
|
? *this->GetOption("CPACK_DMG_FILESYSTEM")
|
||||||
: "HFS+";
|
: "HFS+";
|
||||||
@@ -302,7 +302,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
|||||||
cmValue cpack_dmg_ds_store_setup_script =
|
cmValue cpack_dmg_ds_store_setup_script =
|
||||||
this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT");
|
this->GetOption("CPACK_DMG_DS_STORE_SETUP_SCRIPT");
|
||||||
|
|
||||||
const bool cpack_dmg_disable_applications_symlink =
|
bool const cpack_dmg_disable_applications_symlink =
|
||||||
this->IsOn("CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK");
|
this->IsOn("CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK");
|
||||||
|
|
||||||
// only put license on dmg if is user provided
|
// only put license on dmg if is user provided
|
||||||
@@ -372,7 +372,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
|||||||
// Make sure the background file type is the same as the custom image
|
// Make sure the background file type is the same as the custom image
|
||||||
// and that the file is hidden so it doesn't show up.
|
// and that the file is hidden so it doesn't show up.
|
||||||
if (!cpack_dmg_background_image->empty()) {
|
if (!cpack_dmg_background_image->empty()) {
|
||||||
const std::string extension =
|
std::string const extension =
|
||||||
cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
|
cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
|
||||||
std::ostringstream package_background_source;
|
std::ostringstream package_background_source;
|
||||||
package_background_source << cpack_dmg_background_image;
|
package_background_source << cpack_dmg_background_image;
|
||||||
@@ -709,7 +709,7 @@ bool cmCPackDragNDropGenerator::SupportsComponentInstallation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackDragNDropGenerator::GetComponentInstallSuffix(
|
std::string cmCPackDragNDropGenerator::GetComponentInstallSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
// we want to group components together that go in the same dmg package
|
// we want to group components together that go in the same dmg package
|
||||||
std::string package_file_name = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
std::string package_file_name = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
@@ -749,7 +749,7 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallSuffix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
|
std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
return this->GetSanitizedDirOrFileName(
|
return this->GetSanitizedDirOrFileName(
|
||||||
this->GetComponentInstallSuffix(componentName));
|
this->GetComponentInstallSuffix(componentName));
|
||||||
@@ -814,7 +814,7 @@ void cmCPackDragNDropGenerator::WriteRezDict(cmXMLWriter& xml,
|
|||||||
|
|
||||||
bool cmCPackDragNDropGenerator::WriteLicense(RezDoc& rez, size_t licenseNumber,
|
bool cmCPackDragNDropGenerator::WriteLicense(RezDoc& rez, size_t licenseNumber,
|
||||||
std::string licenseLanguage,
|
std::string licenseLanguage,
|
||||||
const std::string& licenseFile,
|
std::string const& licenseFile,
|
||||||
std::string* error)
|
std::string* error)
|
||||||
{
|
{
|
||||||
if (!licenseFile.empty() && !singleLicense) {
|
if (!licenseFile.empty() && !singleLicense) {
|
||||||
@@ -919,11 +919,11 @@ bool cmCPackDragNDropGenerator::ReadFile(std::string const& file,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line,
|
bool cmCPackDragNDropGenerator::BreakLongLine(std::string const& line,
|
||||||
std::vector<std::string>& lines,
|
std::vector<std::string>& lines,
|
||||||
std::string* error)
|
std::string* error)
|
||||||
{
|
{
|
||||||
const size_t max_line_length = 255;
|
size_t const max_line_length = 255;
|
||||||
size_t line_length = max_line_length;
|
size_t line_length = max_line_length;
|
||||||
for (size_t i = 0; i < line.size(); i += line_length) {
|
for (size_t i = 0; i < line.size(); i += line_length) {
|
||||||
line_length = max_line_length;
|
line_length = max_line_length;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
const char* GetOutputExtension() override;
|
char const* GetOutputExtension() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
|
|
||||||
@@ -36,11 +36,11 @@ protected:
|
|||||||
bool RunCommand(std::string const& command, std::string* output = nullptr);
|
bool RunCommand(std::string const& command, std::string* output = nullptr);
|
||||||
|
|
||||||
std::string GetComponentInstallSuffix(
|
std::string GetComponentInstallSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
std::string GetComponentInstallDirNameSuffix(
|
std::string GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
|
|
||||||
int CreateDMG(const std::string& src_dir, const std::string& output_file);
|
int CreateDMG(std::string const& src_dir, std::string const& output_file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string slaDirectory;
|
std::string slaDirectory;
|
||||||
@@ -73,11 +73,11 @@ private:
|
|||||||
|
|
||||||
bool WriteLicense(RezDoc& rez, size_t licenseNumber,
|
bool WriteLicense(RezDoc& rez, size_t licenseNumber,
|
||||||
std::string licenseLanguage,
|
std::string licenseLanguage,
|
||||||
const std::string& licenseFile, std::string* error);
|
std::string const& licenseFile, std::string* error);
|
||||||
void EncodeLicense(RezDict& dict, std::vector<std::string> const& lines);
|
void EncodeLicense(RezDict& dict, std::vector<std::string> const& lines);
|
||||||
void EncodeMenu(RezDict& dict, std::vector<std::string> const& lines);
|
void EncodeMenu(RezDict& dict, std::vector<std::string> const& lines);
|
||||||
bool ReadFile(std::string const& file, std::vector<std::string>& lines,
|
bool ReadFile(std::string const& file, std::vector<std::string>& lines,
|
||||||
std::string* error);
|
std::string* error);
|
||||||
bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
|
bool BreakLongLine(std::string const& line, std::vector<std::string>& lines,
|
||||||
std::string* error);
|
std::string* error);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ bool cmCPackExternalGenerator::SupportsComponentInstallation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackExternalGenerator::InstallProjectViaInstallCommands(
|
int cmCPackExternalGenerator::InstallProjectViaInstallCommands(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory)
|
bool setDestDir, std::string const& tempInstallDirectory)
|
||||||
{
|
{
|
||||||
if (this->StagingEnabled()) {
|
if (this->StagingEnabled()) {
|
||||||
return this->cmCPackGenerator::InstallProjectViaInstallCommands(
|
return this->cmCPackGenerator::InstallProjectViaInstallCommands(
|
||||||
@@ -106,7 +106,7 @@ int cmCPackExternalGenerator::InstallProjectViaInstallCommands(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackExternalGenerator::InstallProjectViaInstallScript(
|
int cmCPackExternalGenerator::InstallProjectViaInstallScript(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory)
|
bool setDestDir, std::string const& tempInstallDirectory)
|
||||||
{
|
{
|
||||||
if (this->StagingEnabled()) {
|
if (this->StagingEnabled()) {
|
||||||
return this->cmCPackGenerator::InstallProjectViaInstallScript(
|
return this->cmCPackGenerator::InstallProjectViaInstallScript(
|
||||||
@@ -117,8 +117,8 @@ int cmCPackExternalGenerator::InstallProjectViaInstallScript(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories(
|
int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory,
|
bool setDestDir, std::string const& tempInstallDirectory,
|
||||||
const mode_t* default_dir_mode)
|
mode_t const* default_dir_mode)
|
||||||
{
|
{
|
||||||
if (this->StagingEnabled()) {
|
if (this->StagingEnabled()) {
|
||||||
return this->cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
return this->cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||||
@@ -129,8 +129,8 @@ int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackExternalGenerator::RunPreinstallTarget(
|
int cmCPackExternalGenerator::RunPreinstallTarget(
|
||||||
const std::string& installProjectName, const std::string& installDirectory,
|
std::string const& installProjectName, std::string const& installDirectory,
|
||||||
cmGlobalGenerator* globalGenerator, const std::string& buildConfig)
|
cmGlobalGenerator* globalGenerator, std::string const& buildConfig)
|
||||||
{
|
{
|
||||||
if (this->StagingEnabled()) {
|
if (this->StagingEnabled()) {
|
||||||
return this->cmCPackGenerator::RunPreinstallTarget(
|
return this->cmCPackGenerator::RunPreinstallTarget(
|
||||||
@@ -141,10 +141,10 @@ int cmCPackExternalGenerator::RunPreinstallTarget(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackExternalGenerator::InstallCMakeProject(
|
int cmCPackExternalGenerator::InstallCMakeProject(
|
||||||
bool setDestDir, const std::string& installDirectory,
|
bool setDestDir, std::string const& installDirectory,
|
||||||
const std::string& baseTempInstallDirectory, const mode_t* default_dir_mode,
|
std::string const& baseTempInstallDirectory, mode_t const* default_dir_mode,
|
||||||
const std::string& component, bool componentInstall,
|
std::string const& component, bool componentInstall,
|
||||||
const std::string& installSubDirectory, const std::string& buildConfig,
|
std::string const& installSubDirectory, std::string const& buildConfig,
|
||||||
std::string& absoluteDestFiles)
|
std::string& absoluteDestFiles)
|
||||||
{
|
{
|
||||||
if (this->StagingEnabled()) {
|
if (this->StagingEnabled()) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class cmCPackExternalGenerator : public cmCPackGenerator
|
|||||||
public:
|
public:
|
||||||
cmCPackTypeMacro(cmCPackExternalGenerator, cmCPackGenerator);
|
cmCPackTypeMacro(cmCPackExternalGenerator, cmCPackGenerator);
|
||||||
|
|
||||||
const char* GetOutputExtension() override { return ".json"; }
|
char const* GetOutputExtension() override { return ".json"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
@@ -32,23 +32,23 @@ protected:
|
|||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
|
|
||||||
int InstallProjectViaInstallCommands(
|
int InstallProjectViaInstallCommands(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory) override;
|
bool setDestDir, std::string const& tempInstallDirectory) override;
|
||||||
int InstallProjectViaInstallScript(
|
int InstallProjectViaInstallScript(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory) override;
|
bool setDestDir, std::string const& tempInstallDirectory) override;
|
||||||
int InstallProjectViaInstalledDirectories(
|
int InstallProjectViaInstalledDirectories(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory,
|
bool setDestDir, std::string const& tempInstallDirectory,
|
||||||
const mode_t* default_dir_mode) override;
|
mode_t const* default_dir_mode) override;
|
||||||
|
|
||||||
int RunPreinstallTarget(const std::string& installProjectName,
|
int RunPreinstallTarget(std::string const& installProjectName,
|
||||||
const std::string& installDirectory,
|
std::string const& installDirectory,
|
||||||
cmGlobalGenerator* globalGenerator,
|
cmGlobalGenerator* globalGenerator,
|
||||||
const std::string& buildConfig) override;
|
std::string const& buildConfig) override;
|
||||||
int InstallCMakeProject(bool setDestDir, const std::string& installDirectory,
|
int InstallCMakeProject(bool setDestDir, std::string const& installDirectory,
|
||||||
const std::string& baseTempInstallDirectory,
|
std::string const& baseTempInstallDirectory,
|
||||||
const mode_t* default_dir_mode,
|
mode_t const* default_dir_mode,
|
||||||
const std::string& component, bool componentInstall,
|
std::string const& component, bool componentInstall,
|
||||||
const std::string& installSubDirectory,
|
std::string const& installSubDirectory,
|
||||||
const std::string& buildConfig,
|
std::string const& buildConfig,
|
||||||
std::string& absoluteDestFiles) override;
|
std::string& absoluteDestFiles) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
#include "cmWorkingDirectory.h"
|
#include "cmWorkingDirectory.h"
|
||||||
|
|
||||||
// Suffix used to tell libpkg what compression to use
|
// Suffix used to tell libpkg what compression to use
|
||||||
static const char FreeBSDPackageCompression[] = "txz";
|
static char const FreeBSDPackageCompression[] = "txz";
|
||||||
static const char FreeBSDPackageSuffix_17[] = ".pkg";
|
static char const FreeBSDPackageSuffix_17[] = ".pkg";
|
||||||
|
|
||||||
cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator()
|
cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator()
|
||||||
: cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr",
|
: cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr",
|
||||||
@@ -55,8 +55,8 @@ public:
|
|||||||
: d(nullptr)
|
: d(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
PkgCreate(const std::string& output_dir, const std::string& toplevel_dir,
|
PkgCreate(std::string const& output_dir, std::string const& toplevel_dir,
|
||||||
const std::string& manifest_name)
|
std::string const& manifest_name)
|
||||||
: d(pkg_create_new())
|
: d(pkg_create_new())
|
||||||
, manifest(manifest_name)
|
, manifest(manifest_name)
|
||||||
|
|
||||||
@@ -106,9 +106,9 @@ private:
|
|||||||
class EscapeQuotes
|
class EscapeQuotes
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const std::string& value;
|
std::string const& value;
|
||||||
|
|
||||||
EscapeQuotes(const std::string& s)
|
EscapeQuotes(std::string const& s)
|
||||||
: value(s)
|
: value(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
// Output a string as "string" with escaping applied.
|
// Output a string as "string" with escaping applied.
|
||||||
cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
|
cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
|
||||||
const EscapeQuotes& v)
|
EscapeQuotes const& v)
|
||||||
{
|
{
|
||||||
s << '"';
|
s << '"';
|
||||||
for (char c : v.value) {
|
for (char c : v.value) {
|
||||||
@@ -179,7 +179,7 @@ class ManifestKeyValue : public ManifestKey
|
|||||||
public:
|
public:
|
||||||
std::string value;
|
std::string value;
|
||||||
|
|
||||||
ManifestKeyValue(const std::string& k, std::string v)
|
ManifestKeyValue(std::string const& k, std::string v)
|
||||||
: ManifestKey(k)
|
: ManifestKey(k)
|
||||||
, value(std::move(v))
|
, value(std::move(v))
|
||||||
{
|
{
|
||||||
@@ -198,18 +198,18 @@ public:
|
|||||||
using VList = std::vector<std::string>;
|
using VList = std::vector<std::string>;
|
||||||
VList value;
|
VList value;
|
||||||
|
|
||||||
ManifestKeyListValue(const std::string& k)
|
ManifestKeyListValue(std::string const& k)
|
||||||
: ManifestKey(k)
|
: ManifestKey(k)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ManifestKeyListValue& operator<<(const std::string& v)
|
ManifestKeyListValue& operator<<(std::string const& v)
|
||||||
{
|
{
|
||||||
value.push_back(v);
|
value.push_back(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ManifestKeyListValue& operator<<(const std::vector<std::string>& v)
|
ManifestKeyListValue& operator<<(std::vector<std::string> const& v)
|
||||||
{
|
{
|
||||||
for (std::string const& e : v) {
|
for (std::string const& e : v) {
|
||||||
(*this) << e;
|
(*this) << e;
|
||||||
@@ -237,7 +237,7 @@ public:
|
|||||||
class ManifestKeyDepsValue : public ManifestKeyListValue
|
class ManifestKeyDepsValue : public ManifestKeyListValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ManifestKeyDepsValue(const std::string& k)
|
ManifestKeyDepsValue(std::string const& k)
|
||||||
: ManifestKeyListValue(k)
|
: ManifestKeyListValue(k)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ public:
|
|||||||
|
|
||||||
// Write one of the key-value classes (above) to the stream @p s
|
// Write one of the key-value classes (above) to the stream @p s
|
||||||
cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
|
cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
|
||||||
const ManifestKey& v)
|
ManifestKey const& v)
|
||||||
{
|
{
|
||||||
s << '"' << v.key << "\": ";
|
s << '"' << v.key << "\": ";
|
||||||
v.write_value(s);
|
v.write_value(s);
|
||||||
@@ -264,7 +264,7 @@ cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
|
|||||||
|
|
||||||
// Look up variable; if no value is set, returns an empty string;
|
// Look up variable; if no value is set, returns an empty string;
|
||||||
// basically a wrapper that handles the nullptr return from GetOption().
|
// basically a wrapper that handles the nullptr return from GetOption().
|
||||||
std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name)
|
std::string cmCPackFreeBSDGenerator::var_lookup(char const* var_name)
|
||||||
{
|
{
|
||||||
cmValue pv = this->GetOption(var_name);
|
cmValue pv = this->GetOption(var_name);
|
||||||
if (!pv) {
|
if (!pv) {
|
||||||
@@ -312,7 +312,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
|
|||||||
|
|
||||||
// Package only actual files; others are ignored (in particular,
|
// Package only actual files; others are ignored (in particular,
|
||||||
// intermediate subdirectories are ignored).
|
// intermediate subdirectories are ignored).
|
||||||
static bool ignore_file(const std::string& filename)
|
static bool ignore_file(std::string const& filename)
|
||||||
{
|
{
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
return stat(filename.c_str(), &statbuf) < 0 ||
|
return stat(filename.c_str(), &statbuf) < 0 ||
|
||||||
@@ -325,8 +325,8 @@ static bool ignore_file(const std::string& filename)
|
|||||||
// to paths relative to @p toplevel, with a leading / (since the paths
|
// to paths relative to @p toplevel, with a leading / (since the paths
|
||||||
// in FreeBSD package files are supposed to be absolute).
|
// in FreeBSD package files are supposed to be absolute).
|
||||||
void write_manifest_files(cmGeneratedFileStream& s,
|
void write_manifest_files(cmGeneratedFileStream& s,
|
||||||
const std::string& toplevel,
|
std::string const& toplevel,
|
||||||
const std::vector<std::string>& files)
|
std::vector<std::string> const& files)
|
||||||
{
|
{
|
||||||
s << "\"files\": {\n";
|
s << "\"files\": {\n";
|
||||||
for (std::string const& file : files) {
|
for (std::string const& file : files) {
|
||||||
@@ -405,7 +405,7 @@ int cmCPackFreeBSDGenerator::PackageFiles()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string output_dir = cmSystemTools::GetFilenamePath(toplevel);
|
std::string const output_dir = cmSystemTools::GetFilenamePath(toplevel);
|
||||||
PkgCreate package(output_dir, toplevel, manifestname);
|
PkgCreate package(output_dir, toplevel, manifestname);
|
||||||
if (package.isValid()) {
|
if (package.isValid()) {
|
||||||
if (!package.Create()) {
|
if (!package.Create()) {
|
||||||
@@ -431,17 +431,17 @@ int cmCPackFreeBSDGenerator::PackageFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string packageFileName =
|
std::string const packageFileName =
|
||||||
var_lookup("CPACK_PACKAGE_FILE_NAME") + FreeBSDPackageSuffix_17;
|
var_lookup("CPACK_PACKAGE_FILE_NAME") + FreeBSDPackageSuffix_17;
|
||||||
if (packageFileNames.size() == 1 && !packageFileName.empty() &&
|
if (packageFileNames.size() == 1 && !packageFileName.empty() &&
|
||||||
packageFileNames[0] != packageFileName) {
|
packageFileNames[0] != packageFileName) {
|
||||||
// Since libpkg always writes <name>-<version>.<suffix>,
|
// Since libpkg always writes <name>-<version>.<suffix>,
|
||||||
// if there is a CPACK_PACKAGE_FILE_NAME set, we need to
|
// if there is a CPACK_PACKAGE_FILE_NAME set, we need to
|
||||||
// rename, and then re-set the name.
|
// rename, and then re-set the name.
|
||||||
const std::string sourceFile = packageFileNames[0];
|
std::string const sourceFile = packageFileNames[0];
|
||||||
const std::string packageSubDirectory =
|
std::string const packageSubDirectory =
|
||||||
cmSystemTools::GetParentDirectory(sourceFile);
|
cmSystemTools::GetParentDirectory(sourceFile);
|
||||||
const std::string targetFileName =
|
std::string const targetFileName =
|
||||||
packageSubDirectory + '/' + packageFileName;
|
packageSubDirectory + '/' + packageFileName;
|
||||||
if (cmSystemTools::RenameFile(sourceFile, targetFileName)) {
|
if (cmSystemTools::RenameFile(sourceFile, targetFileName)) {
|
||||||
this->packageFileNames.clear();
|
this->packageFileNames.clear();
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ public:
|
|||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string var_lookup(const char* var_name);
|
std::string var_lookup(char const* var_name);
|
||||||
void write_manifest_fields(cmGeneratedFileStream&);
|
void write_manifest_fields(cmGeneratedFileStream&);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ cmCPackGenerator::~cmCPackGenerator()
|
|||||||
this->MakefileMap = nullptr;
|
this->MakefileMap = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackGenerator::DisplayVerboseOutput(const std::string& msg,
|
void cmCPackGenerator::DisplayVerboseOutput(std::string const& msg,
|
||||||
float /*unused*/)
|
float /*unused*/)
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE, msg << std::endl);
|
cmCPackLogger(cmCPackLog::LOG_VERBOSE, msg << std::endl);
|
||||||
@@ -227,7 +227,7 @@ int cmCPackGenerator::InstallProject()
|
|||||||
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
|
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
|
||||||
if (cmNonempty(default_dir_install_permissions)) {
|
if (cmNonempty(default_dir_install_permissions)) {
|
||||||
cmList items{ default_dir_install_permissions };
|
cmList items{ default_dir_install_permissions };
|
||||||
for (const auto& arg : items) {
|
for (auto const& arg : items) {
|
||||||
if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) {
|
if (!cmFSPermissions::stringToModeT(arg, default_dir_mode_v)) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"Invalid permission value '"
|
"Invalid permission value '"
|
||||||
@@ -275,8 +275,8 @@ int cmCPackGenerator::InstallProject()
|
|||||||
// Run pre-build actions
|
// Run pre-build actions
|
||||||
cmValue preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
|
cmValue preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
|
||||||
if (preBuildScripts) {
|
if (preBuildScripts) {
|
||||||
const cmList scripts{ preBuildScripts };
|
cmList const scripts{ preBuildScripts };
|
||||||
for (const auto& script : scripts) {
|
for (auto const& script : scripts) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
||||||
"Executing pre-build script: " << script << std::endl);
|
"Executing pre-build script: " << script << std::endl);
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ int cmCPackGenerator::InstallProject()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::InstallProjectViaInstallCommands(
|
int cmCPackGenerator::InstallProjectViaInstallCommands(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory)
|
bool setDestDir, std::string const& tempInstallDirectory)
|
||||||
{
|
{
|
||||||
(void)setDestDir;
|
(void)setDestDir;
|
||||||
cmValue installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
|
cmValue installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
|
||||||
@@ -333,8 +333,8 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory,
|
bool setDestDir, std::string const& tempInstallDirectory,
|
||||||
const mode_t* default_dir_mode)
|
mode_t const* default_dir_mode)
|
||||||
{
|
{
|
||||||
(void)setDestDir;
|
(void)setDestDir;
|
||||||
(void)tempInstallDirectory;
|
(void)tempInstallDirectory;
|
||||||
@@ -362,7 +362,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
cmList::iterator it;
|
cmList::iterator it;
|
||||||
const std::string& tempDir = tempInstallDirectory;
|
std::string const& tempDir = tempInstallDirectory;
|
||||||
for (it = installDirectoriesList.begin();
|
for (it = installDirectoriesList.begin();
|
||||||
it != installDirectoriesList.end(); ++it) {
|
it != installDirectoriesList.end(); ++it) {
|
||||||
std::vector<std::pair<std::string, std::string>> symlinkedFiles;
|
std::vector<std::pair<std::string, std::string>> symlinkedFiles;
|
||||||
@@ -470,7 +470,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::InstallProjectViaInstallScript(
|
int cmCPackGenerator::InstallProjectViaInstallScript(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory)
|
bool setDestDir, std::string const& tempInstallDirectory)
|
||||||
{
|
{
|
||||||
cmValue cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
|
cmValue cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPTS");
|
||||||
{
|
{
|
||||||
@@ -537,8 +537,8 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||||
bool setDestDir, const std::string& baseTempInstallDirectory,
|
bool setDestDir, std::string const& baseTempInstallDirectory,
|
||||||
const mode_t* default_dir_mode)
|
mode_t const* default_dir_mode)
|
||||||
{
|
{
|
||||||
cmValue cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
|
cmValue cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
|
||||||
cmValue cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
|
cmValue cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
|
||||||
@@ -679,11 +679,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::RunPreinstallTarget(
|
int cmCPackGenerator::RunPreinstallTarget(
|
||||||
const std::string& installProjectName, const std::string& installDirectory,
|
std::string const& installProjectName, std::string const& installDirectory,
|
||||||
cmGlobalGenerator* globalGenerator, const std::string& buildConfig)
|
cmGlobalGenerator* globalGenerator, std::string const& buildConfig)
|
||||||
{
|
{
|
||||||
// Does this generator require pre-install?
|
// Does this generator require pre-install?
|
||||||
if (const char* preinstall = globalGenerator->GetPreinstallTargetName()) {
|
if (char const* preinstall = globalGenerator->GetPreinstallTargetName()) {
|
||||||
std::string buildCommand = globalGenerator->GenerateCMakeBuildCommand(
|
std::string buildCommand = globalGenerator->GenerateCMakeBuildCommand(
|
||||||
preinstall, buildConfig, "", "", false);
|
preinstall, buildConfig, "", "", false);
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
@@ -717,10 +717,10 @@ int cmCPackGenerator::RunPreinstallTarget(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::InstallCMakeProject(
|
int cmCPackGenerator::InstallCMakeProject(
|
||||||
bool setDestDir, const std::string& installDirectory,
|
bool setDestDir, std::string const& installDirectory,
|
||||||
const std::string& baseTempInstallDirectory, const mode_t* default_dir_mode,
|
std::string const& baseTempInstallDirectory, mode_t const* default_dir_mode,
|
||||||
const std::string& component, bool componentInstall,
|
std::string const& component, bool componentInstall,
|
||||||
const std::string& installSubDirectory, const std::string& buildConfig,
|
std::string const& installSubDirectory, std::string const& buildConfig,
|
||||||
std::string& absoluteDestFiles)
|
std::string& absoluteDestFiles)
|
||||||
{
|
{
|
||||||
std::string tempInstallDirectory = baseTempInstallDirectory;
|
std::string tempInstallDirectory = baseTempInstallDirectory;
|
||||||
@@ -736,7 +736,7 @@ int cmCPackGenerator::InstallCMakeProject(
|
|||||||
cm.SetHomeOutputDirectory("");
|
cm.SetHomeOutputDirectory("");
|
||||||
cm.GetCurrentSnapshot().SetDefaultDefinitions();
|
cm.GetCurrentSnapshot().SetDefaultDefinitions();
|
||||||
cm.AddCMakePaths();
|
cm.AddCMakePaths();
|
||||||
cm.SetProgressCallback([this](const std::string& msg, float prog) {
|
cm.SetProgressCallback([this](std::string const& msg, float prog) {
|
||||||
this->DisplayVerboseOutput(msg, prog);
|
this->DisplayVerboseOutput(msg, prog);
|
||||||
});
|
});
|
||||||
cm.SetTrace(this->Trace);
|
cm.SetTrace(this->Trace);
|
||||||
@@ -998,7 +998,7 @@ bool cmCPackGenerator::GenerateChecksumFile(cmCryptoHash& crypto,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::CopyPackageFile(const std::string& srcFilePath,
|
bool cmCPackGenerator::CopyPackageFile(std::string const& srcFilePath,
|
||||||
cm::string_view filename) const
|
cm::string_view filename) const
|
||||||
{
|
{
|
||||||
std::string destFilePath =
|
std::string destFilePath =
|
||||||
@@ -1021,7 +1021,7 @@ bool cmCPackGenerator::CopyPackageFile(const std::string& srcFilePath,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::ReadListFile(const char* moduleName)
|
bool cmCPackGenerator::ReadListFile(char const* moduleName)
|
||||||
{
|
{
|
||||||
bool retval;
|
bool retval;
|
||||||
std::string fullPath = this->MakefileMap->GetModulesFile(moduleName);
|
std::string fullPath = this->MakefileMap->GetModulesFile(moduleName);
|
||||||
@@ -1032,7 +1032,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename ValueType>
|
template <typename ValueType>
|
||||||
void cmCPackGenerator::StoreOptionIfNotSet(const std::string& op,
|
void cmCPackGenerator::StoreOptionIfNotSet(std::string const& op,
|
||||||
ValueType value)
|
ValueType value)
|
||||||
{
|
{
|
||||||
cmValue def = this->MakefileMap->GetDefinition(op);
|
cmValue def = this->MakefileMap->GetDefinition(op);
|
||||||
@@ -1042,18 +1042,18 @@ void cmCPackGenerator::StoreOptionIfNotSet(const std::string& op,
|
|||||||
this->StoreOption(op, value);
|
this->StoreOption(op, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
|
void cmCPackGenerator::SetOptionIfNotSet(std::string const& op,
|
||||||
const char* value)
|
char const* value)
|
||||||
{
|
{
|
||||||
this->StoreOptionIfNotSet(op, value);
|
this->StoreOptionIfNotSet(op, value);
|
||||||
}
|
}
|
||||||
void cmCPackGenerator::SetOptionIfNotSet(const std::string& op, cmValue value)
|
void cmCPackGenerator::SetOptionIfNotSet(std::string const& op, cmValue value)
|
||||||
{
|
{
|
||||||
this->StoreOptionIfNotSet(op, value);
|
this->StoreOptionIfNotSet(op, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ValueType>
|
template <typename ValueType>
|
||||||
void cmCPackGenerator::StoreOption(const std::string& op, ValueType value)
|
void cmCPackGenerator::StoreOption(std::string const& op, ValueType value)
|
||||||
{
|
{
|
||||||
if (!value) {
|
if (!value) {
|
||||||
this->MakefileMap->RemoveDefinition(op);
|
this->MakefileMap->RemoveDefinition(op);
|
||||||
@@ -1065,11 +1065,11 @@ void cmCPackGenerator::StoreOption(const std::string& op, ValueType value)
|
|||||||
this->MakefileMap->AddDefinition(op, value);
|
this->MakefileMap->AddDefinition(op, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackGenerator::SetOption(const std::string& op, const char* value)
|
void cmCPackGenerator::SetOption(std::string const& op, char const* value)
|
||||||
{
|
{
|
||||||
this->StoreOption(op, value);
|
this->StoreOption(op, value);
|
||||||
}
|
}
|
||||||
void cmCPackGenerator::SetOption(const std::string& op, cmValue value)
|
void cmCPackGenerator::SetOption(std::string const& op, cmValue value)
|
||||||
{
|
{
|
||||||
this->StoreOption(op, value);
|
this->StoreOption(op, value);
|
||||||
}
|
}
|
||||||
@@ -1186,8 +1186,8 @@ int cmCPackGenerator::DoPackage()
|
|||||||
this->MakefileMap->AddDefinition(
|
this->MakefileMap->AddDefinition(
|
||||||
"CPACK_PACKAGE_FILES", cmList::to_string(this->packageFileNames));
|
"CPACK_PACKAGE_FILES", cmList::to_string(this->packageFileNames));
|
||||||
|
|
||||||
const cmList scripts{ postBuildScripts };
|
cmList const scripts{ postBuildScripts };
|
||||||
for (const auto& script : scripts) {
|
for (auto const& script : scripts) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
||||||
"Executing post-build script: " << script << std::endl);
|
"Executing post-build script: " << script << std::endl);
|
||||||
|
|
||||||
@@ -1230,7 +1230,7 @@ int cmCPackGenerator::DoPackage()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
|
int cmCPackGenerator::Initialize(std::string const& name, cmMakefile* mf)
|
||||||
{
|
{
|
||||||
this->MakefileMap = mf;
|
this->MakefileMap = mf;
|
||||||
this->Name = name;
|
this->Name = name;
|
||||||
@@ -1313,12 +1313,12 @@ int cmCPackGenerator::InitializeInternal()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::IsSet(const std::string& name) const
|
bool cmCPackGenerator::IsSet(std::string const& name) const
|
||||||
{
|
{
|
||||||
return this->MakefileMap->IsSet(name);
|
return this->MakefileMap->IsSet(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmValue cmCPackGenerator::GetOptionIfSet(const std::string& name) const
|
cmValue cmCPackGenerator::GetOptionIfSet(std::string const& name) const
|
||||||
{
|
{
|
||||||
cmValue ret = this->MakefileMap->GetDefinition(name);
|
cmValue ret = this->MakefileMap->GetDefinition(name);
|
||||||
if (!ret || ret->empty() || cmIsNOTFOUND(*ret)) {
|
if (!ret || ret->empty() || cmIsNOTFOUND(*ret)) {
|
||||||
@@ -1327,12 +1327,12 @@ cmValue cmCPackGenerator::GetOptionIfSet(const std::string& name) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::IsOn(const std::string& name) const
|
bool cmCPackGenerator::IsOn(std::string const& name) const
|
||||||
{
|
{
|
||||||
return this->GetOption(name).IsOn();
|
return this->GetOption(name).IsOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
|
bool cmCPackGenerator::IsSetToOff(std::string const& op) const
|
||||||
{
|
{
|
||||||
cmValue ret = this->MakefileMap->GetDefinition(op);
|
cmValue ret = this->MakefileMap->GetDefinition(op);
|
||||||
if (cmNonempty(ret)) {
|
if (cmNonempty(ret)) {
|
||||||
@@ -1341,7 +1341,7 @@ bool cmCPackGenerator::IsSetToOff(const std::string& op) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::IsSetToEmpty(const std::string& op) const
|
bool cmCPackGenerator::IsSetToEmpty(std::string const& op) const
|
||||||
{
|
{
|
||||||
cmValue ret = this->MakefileMap->GetDefinition(op);
|
cmValue ret = this->MakefileMap->GetDefinition(op);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -1350,7 +1350,7 @@ bool cmCPackGenerator::IsSetToEmpty(const std::string& op) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmValue cmCPackGenerator::GetOption(const std::string& op) const
|
cmValue cmCPackGenerator::GetOption(std::string const& op) const
|
||||||
{
|
{
|
||||||
cmValue ret = this->MakefileMap->GetDefinition(op);
|
cmValue ret = this->MakefileMap->GetDefinition(op);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
@@ -1370,7 +1370,7 @@ int cmCPackGenerator::PackageFiles()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackGenerator::GetInstallPath()
|
char const* cmCPackGenerator::GetInstallPath()
|
||||||
{
|
{
|
||||||
if (!this->InstallPath.empty()) {
|
if (!this->InstallPath.empty()) {
|
||||||
return this->InstallPath.c_str();
|
return this->InstallPath.c_str();
|
||||||
@@ -1403,7 +1403,7 @@ const char* cmCPackGenerator::GetInstallPath()
|
|||||||
return this->InstallPath.c_str();
|
return this->InstallPath.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* cmCPackGenerator::GetPackagingInstallPrefix()
|
char const* cmCPackGenerator::GetPackagingInstallPrefix()
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
"GetPackagingInstallPrefix: '"
|
"GetPackagingInstallPrefix: '"
|
||||||
@@ -1434,15 +1434,15 @@ std::string cmCPackGenerator::FindTemplate(cm::string_view name,
|
|||||||
return ffile;
|
return ffile;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::ConfigureString(const std::string& inString,
|
bool cmCPackGenerator::ConfigureString(std::string const& inString,
|
||||||
std::string& outString)
|
std::string& outString)
|
||||||
{
|
{
|
||||||
this->MakefileMap->ConfigureString(inString, outString, true, false);
|
this->MakefileMap->ConfigureString(inString, outString, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackGenerator::ConfigureFile(const std::string& inName,
|
bool cmCPackGenerator::ConfigureFile(std::string const& inName,
|
||||||
const std::string& outName,
|
std::string const& outName,
|
||||||
bool copyOnly /* = false */)
|
bool copyOnly /* = false */)
|
||||||
{
|
{
|
||||||
return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true,
|
return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true,
|
||||||
@@ -1537,7 +1537,7 @@ int cmCPackGenerator::PrepareGroupingKind()
|
|||||||
this->componentPackageMethod = method;
|
this->componentPackageMethod = method;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE",
|
char const* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE",
|
||||||
"ONE_PER_GROUP", "UNKNOWN" };
|
"ONE_PER_GROUP", "UNKNOWN" };
|
||||||
|
|
||||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||||
@@ -1550,7 +1550,7 @@ int cmCPackGenerator::PrepareGroupingKind()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackGenerator::GetSanitizedDirOrFileName(
|
std::string cmCPackGenerator::GetSanitizedDirOrFileName(
|
||||||
const std::string& name, bool isFullName) const
|
std::string const& name, bool isFullName) const
|
||||||
{
|
{
|
||||||
if (isFullName) {
|
if (isFullName) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -1577,10 +1577,10 @@ std::string cmCPackGenerator::GetSanitizedDirOrFileName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
constexpr const char* prohibited_chars = "<>\"/\\|?*`";
|
constexpr char const* prohibited_chars = "<>\"/\\|?*`";
|
||||||
#else
|
#else
|
||||||
// Note: Windows also excludes the colon.
|
// Note: Windows also excludes the colon.
|
||||||
constexpr const char* prohibited_chars = "<>\"/\\|?*`:";
|
constexpr char const* prohibited_chars = "<>\"/\\|?*`:";
|
||||||
#endif
|
#endif
|
||||||
// Given name contains non-supported character?
|
// Given name contains non-supported character?
|
||||||
// Then return its MD5 hash.
|
// Then return its MD5 hash.
|
||||||
@@ -1594,21 +1594,21 @@ std::string cmCPackGenerator::GetSanitizedDirOrFileName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackGenerator::GetComponentInstallSuffix(
|
std::string cmCPackGenerator::GetComponentInstallSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
return componentName;
|
return componentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackGenerator::GetComponentInstallDirNameSuffix(
|
std::string cmCPackGenerator::GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
return this->GetSanitizedDirOrFileName(
|
return this->GetSanitizedDirOrFileName(
|
||||||
this->GetComponentInstallSuffix(componentName));
|
this->GetComponentInstallSuffix(componentName));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackGenerator::GetComponentPackageFileName(
|
std::string cmCPackGenerator::GetComponentPackageFileName(
|
||||||
const std::string& initialPackageFileName,
|
std::string const& initialPackageFileName,
|
||||||
const std::string& groupOrComponentName, bool isGroupName)
|
std::string const& groupOrComponentName, bool isGroupName)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1667,7 +1667,7 @@ bool cmCPackGenerator::WantsComponentInstallation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
|
cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
|
||||||
const std::string& projectName, const std::string& name)
|
std::string const& projectName, std::string const& name)
|
||||||
{
|
{
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
bool hasInstallationType = this->InstallationTypes.count(name) != 0;
|
bool hasInstallationType = this->InstallationTypes.count(name) != 0;
|
||||||
@@ -1691,7 +1691,7 @@ cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackComponent* cmCPackGenerator::GetComponent(
|
cmCPackComponent* cmCPackGenerator::GetComponent(
|
||||||
const std::string& projectName, const std::string& name)
|
std::string const& projectName, std::string const& name)
|
||||||
{
|
{
|
||||||
bool hasComponent = this->Components.count(name) != 0;
|
bool hasComponent = this->Components.count(name) != 0;
|
||||||
cmCPackComponent* component = &this->Components[name];
|
cmCPackComponent* component = &this->Components[name];
|
||||||
@@ -1760,7 +1760,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
|
cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
|
||||||
const std::string& projectName, const std::string& name)
|
std::string const& projectName, std::string const& name)
|
||||||
{
|
{
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
std::string macroPrefix =
|
std::string macroPrefix =
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class cmMakefile;
|
|||||||
class cmCPackGenerator
|
class cmCPackGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual const char* GetNameOfClass() = 0;
|
virtual char const* GetNameOfClass() = 0;
|
||||||
/**
|
/**
|
||||||
* If verbose then more information is printed out
|
* If verbose then more information is printed out
|
||||||
*/
|
*/
|
||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Initialize generator
|
* Initialize generator
|
||||||
*/
|
*/
|
||||||
int Initialize(const std::string& name, cmMakefile* mf);
|
int Initialize(std::string const& name, cmMakefile* mf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct generator
|
* Construct generator
|
||||||
@@ -88,33 +88,33 @@ public:
|
|||||||
virtual ~cmCPackGenerator();
|
virtual ~cmCPackGenerator();
|
||||||
|
|
||||||
//! Set and get the options
|
//! Set and get the options
|
||||||
void SetOption(const std::string& op, const char* value);
|
void SetOption(std::string const& op, char const* value);
|
||||||
void SetOption(const std::string& op, const std::string& value)
|
void SetOption(std::string const& op, std::string const& value)
|
||||||
{
|
{
|
||||||
this->SetOption(op, cmValue(value));
|
this->SetOption(op, cmValue(value));
|
||||||
}
|
}
|
||||||
void SetOption(const std::string& op, cmValue value);
|
void SetOption(std::string const& op, cmValue value);
|
||||||
void SetOptionIfNotSet(const std::string& op, const char* value);
|
void SetOptionIfNotSet(std::string const& op, char const* value);
|
||||||
void SetOptionIfNotSet(const std::string& op, const std::string& value)
|
void SetOptionIfNotSet(std::string const& op, std::string const& value)
|
||||||
{
|
{
|
||||||
this->SetOptionIfNotSet(op, cmValue(value));
|
this->SetOptionIfNotSet(op, cmValue(value));
|
||||||
}
|
}
|
||||||
void SetOptionIfNotSet(const std::string& op, cmValue value);
|
void SetOptionIfNotSet(std::string const& op, cmValue value);
|
||||||
cmValue GetOption(const std::string& op) const;
|
cmValue GetOption(std::string const& op) const;
|
||||||
std::vector<std::string> GetOptions() const;
|
std::vector<std::string> GetOptions() const;
|
||||||
bool IsSet(const std::string& name) const;
|
bool IsSet(std::string const& name) const;
|
||||||
cmValue GetOptionIfSet(const std::string& name) const;
|
cmValue GetOptionIfSet(std::string const& name) const;
|
||||||
bool IsOn(const std::string& name) const;
|
bool IsOn(std::string const& name) const;
|
||||||
bool IsSetToOff(const std::string& op) const;
|
bool IsSetToOff(std::string const& op) const;
|
||||||
bool IsSetToEmpty(const std::string& op) const;
|
bool IsSetToEmpty(std::string const& op) const;
|
||||||
|
|
||||||
//! Set the logger
|
//! Set the logger
|
||||||
void SetLogger(cmCPackLog* log) { this->Logger = log; }
|
void SetLogger(cmCPackLog* log) { this->Logger = log; }
|
||||||
|
|
||||||
//! Display verbose information via logger
|
//! Display verbose information via logger
|
||||||
void DisplayVerboseOutput(const std::string& msg, float progress);
|
void DisplayVerboseOutput(std::string const& msg, float progress);
|
||||||
|
|
||||||
bool ReadListFile(const char* moduleName);
|
bool ReadListFile(char const* moduleName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
@@ -132,8 +132,8 @@ protected:
|
|||||||
|
|
||||||
cmInstalledFile const* GetInstalledFile(std::string const& name) const;
|
cmInstalledFile const* GetInstalledFile(std::string const& name) const;
|
||||||
|
|
||||||
virtual const char* GetOutputExtension() { return ".cpack"; }
|
virtual char const* GetOutputExtension() { return ".cpack"; }
|
||||||
virtual const char* GetOutputPostfix() { return nullptr; }
|
virtual char const* GetOutputPostfix() { return nullptr; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare requested grouping kind from CPACK_xxx vars
|
* Prepare requested grouping kind from CPACK_xxx vars
|
||||||
@@ -154,7 +154,7 @@ protected:
|
|||||||
* directory or file. (Defaults to true.)
|
* directory or file. (Defaults to true.)
|
||||||
* @return the sanitized name.
|
* @return the sanitized name.
|
||||||
*/
|
*/
|
||||||
virtual std::string GetSanitizedDirOrFileName(const std::string& name,
|
virtual std::string GetSanitizedDirOrFileName(std::string const& name,
|
||||||
bool isFullName = true) const;
|
bool isFullName = true) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,7 +168,7 @@ protected:
|
|||||||
* default is "componentName"
|
* default is "componentName"
|
||||||
*/
|
*/
|
||||||
virtual std::string GetComponentInstallSuffix(
|
virtual std::string GetComponentInstallSuffix(
|
||||||
const std::string& componentName);
|
std::string const& componentName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value that GetComponentInstallSuffix returns, but sanitized.
|
* The value that GetComponentInstallSuffix returns, but sanitized.
|
||||||
@@ -178,7 +178,7 @@ protected:
|
|||||||
* default is "componentName".
|
* default is "componentName".
|
||||||
*/
|
*/
|
||||||
virtual std::string GetComponentInstallDirNameSuffix(
|
virtual std::string GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName);
|
std::string const& componentName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CPack specific generator may mangle CPACK_PACKAGE_FILE_NAME
|
* CPack specific generator may mangle CPACK_PACKAGE_FILE_NAME
|
||||||
@@ -190,8 +190,8 @@ protected:
|
|||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
virtual std::string GetComponentPackageFileName(
|
virtual std::string GetComponentPackageFileName(
|
||||||
const std::string& initialPackageFileName,
|
std::string const& initialPackageFileName,
|
||||||
const std::string& groupOrComponentName, bool isGroupName);
|
std::string const& groupOrComponentName, bool isGroupName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Package the list of files and/or components which
|
* Package the list of files and/or components which
|
||||||
@@ -203,44 +203,44 @@ protected:
|
|||||||
* the list of packages generated by the specific generator.
|
* the list of packages generated by the specific generator.
|
||||||
*/
|
*/
|
||||||
virtual int PackageFiles();
|
virtual int PackageFiles();
|
||||||
virtual const char* GetInstallPath();
|
virtual char const* GetInstallPath();
|
||||||
virtual const char* GetPackagingInstallPrefix();
|
virtual char const* GetPackagingInstallPrefix();
|
||||||
|
|
||||||
bool GenerateChecksumFile(cmCryptoHash& crypto,
|
bool GenerateChecksumFile(cmCryptoHash& crypto,
|
||||||
cm::string_view filename) const;
|
cm::string_view filename) const;
|
||||||
bool CopyPackageFile(const std::string& srcFilePath,
|
bool CopyPackageFile(std::string const& srcFilePath,
|
||||||
cm::string_view filename) const;
|
cm::string_view filename) const;
|
||||||
|
|
||||||
std::string FindTemplate(cm::string_view name,
|
std::string FindTemplate(cm::string_view name,
|
||||||
cm::optional<cm::string_view> alt = cm::nullopt);
|
cm::optional<cm::string_view> alt = cm::nullopt);
|
||||||
virtual bool ConfigureFile(const std::string& inName,
|
virtual bool ConfigureFile(std::string const& inName,
|
||||||
const std::string& outName,
|
std::string const& outName,
|
||||||
bool copyOnly = false);
|
bool copyOnly = false);
|
||||||
virtual bool ConfigureString(const std::string& input, std::string& output);
|
virtual bool ConfigureString(std::string const& input, std::string& output);
|
||||||
virtual int InitializeInternal();
|
virtual int InitializeInternal();
|
||||||
|
|
||||||
//! Run install commands if specified
|
//! Run install commands if specified
|
||||||
virtual int InstallProjectViaInstallCommands(
|
virtual int InstallProjectViaInstallCommands(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory);
|
bool setDestDir, std::string const& tempInstallDirectory);
|
||||||
virtual int InstallProjectViaInstallScript(
|
virtual int InstallProjectViaInstallScript(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory);
|
bool setDestDir, std::string const& tempInstallDirectory);
|
||||||
virtual int InstallProjectViaInstalledDirectories(
|
virtual int InstallProjectViaInstalledDirectories(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory,
|
bool setDestDir, std::string const& tempInstallDirectory,
|
||||||
const mode_t* default_dir_mode);
|
mode_t const* default_dir_mode);
|
||||||
virtual int InstallProjectViaInstallCMakeProjects(
|
virtual int InstallProjectViaInstallCMakeProjects(
|
||||||
bool setDestDir, const std::string& tempInstallDirectory,
|
bool setDestDir, std::string const& tempInstallDirectory,
|
||||||
const mode_t* default_dir_mode);
|
mode_t const* default_dir_mode);
|
||||||
|
|
||||||
virtual int RunPreinstallTarget(const std::string& installProjectName,
|
virtual int RunPreinstallTarget(std::string const& installProjectName,
|
||||||
const std::string& installDirectory,
|
std::string const& installDirectory,
|
||||||
cmGlobalGenerator* globalGenerator,
|
cmGlobalGenerator* globalGenerator,
|
||||||
const std::string& buildConfig);
|
std::string const& buildConfig);
|
||||||
virtual int InstallCMakeProject(
|
virtual int InstallCMakeProject(
|
||||||
bool setDestDir, const std::string& installDirectory,
|
bool setDestDir, std::string const& installDirectory,
|
||||||
const std::string& baseTempInstallDirectory,
|
std::string const& baseTempInstallDirectory,
|
||||||
const mode_t* default_dir_mode, const std::string& component,
|
mode_t const* default_dir_mode, std::string const& component,
|
||||||
bool componentInstall, const std::string& installSubDirectory,
|
bool componentInstall, std::string const& installSubDirectory,
|
||||||
const std::string& buildConfig, std::string& absoluteDestFiles);
|
std::string const& buildConfig, std::string& absoluteDestFiles);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The various level of support of
|
* The various level of support of
|
||||||
@@ -291,11 +291,11 @@ protected:
|
|||||||
*/
|
*/
|
||||||
virtual bool WantsComponentInstallation() const;
|
virtual bool WantsComponentInstallation() const;
|
||||||
virtual cmCPackInstallationType* GetInstallationType(
|
virtual cmCPackInstallationType* GetInstallationType(
|
||||||
const std::string& projectName, const std::string& name);
|
std::string const& projectName, std::string const& name);
|
||||||
virtual cmCPackComponent* GetComponent(const std::string& projectName,
|
virtual cmCPackComponent* GetComponent(std::string const& projectName,
|
||||||
const std::string& name);
|
std::string const& name);
|
||||||
virtual cmCPackComponentGroup* GetComponentGroup(
|
virtual cmCPackComponentGroup* GetComponentGroup(
|
||||||
const std::string& projectName, const std::string& name);
|
std::string const& projectName, std::string const& name);
|
||||||
|
|
||||||
cmSystemTools::OutputOption GeneratorVerbose;
|
cmSystemTools::OutputOption GeneratorVerbose;
|
||||||
std::string Name;
|
std::string Name;
|
||||||
@@ -370,9 +370,9 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
template <typename ValueType>
|
template <typename ValueType>
|
||||||
void StoreOption(const std::string& op, ValueType value);
|
void StoreOption(std::string const& op, ValueType value);
|
||||||
template <typename ValueType>
|
template <typename ValueType>
|
||||||
void StoreOptionIfNotSet(const std::string& op, ValueType value);
|
void StoreOptionIfNotSet(std::string const& op, ValueType value);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define cmCPackTypeMacro(klass, superclass) \
|
#define cmCPackTypeMacro(klass, superclass) \
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<cmCPackGenerator> cmCPackGeneratorFactory::NewGenerator(
|
std::unique_ptr<cmCPackGenerator> cmCPackGeneratorFactory::NewGenerator(
|
||||||
const std::string& name)
|
std::string const& name)
|
||||||
{
|
{
|
||||||
auto it = this->GeneratorCreators.find(name);
|
auto it = this->GeneratorCreators.find(name);
|
||||||
if (it == this->GeneratorCreators.end()) {
|
if (it == this->GeneratorCreators.end()) {
|
||||||
@@ -148,7 +148,7 @@ std::unique_ptr<cmCPackGenerator> cmCPackGeneratorFactory::NewGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackGeneratorFactory::RegisterGenerator(
|
void cmCPackGeneratorFactory::RegisterGenerator(
|
||||||
const std::string& name, const char* generatorDescription,
|
std::string const& name, char const* generatorDescription,
|
||||||
CreateGeneratorCall* createGenerator)
|
CreateGeneratorCall* createGenerator)
|
||||||
{
|
{
|
||||||
if (!createGenerator) {
|
if (!createGenerator) {
|
||||||
|
|||||||
@@ -23,18 +23,18 @@ public:
|
|||||||
cmCPackGeneratorFactory();
|
cmCPackGeneratorFactory();
|
||||||
|
|
||||||
//! Get the generator
|
//! Get the generator
|
||||||
std::unique_ptr<cmCPackGenerator> NewGenerator(const std::string& name);
|
std::unique_ptr<cmCPackGenerator> NewGenerator(std::string const& name);
|
||||||
|
|
||||||
using CreateGeneratorCall = cmCPackGenerator*();
|
using CreateGeneratorCall = cmCPackGenerator*();
|
||||||
|
|
||||||
void RegisterGenerator(const std::string& name,
|
void RegisterGenerator(std::string const& name,
|
||||||
const char* generatorDescription,
|
char const* generatorDescription,
|
||||||
CreateGeneratorCall* createGenerator);
|
CreateGeneratorCall* createGenerator);
|
||||||
|
|
||||||
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
|
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
|
||||||
|
|
||||||
using DescriptionsMap = std::map<std::string, std::string>;
|
using DescriptionsMap = std::map<std::string, std::string>;
|
||||||
const DescriptionsMap& GetGeneratorsList() const
|
DescriptionsMap const& GetGeneratorsList() const
|
||||||
{
|
{
|
||||||
return this->GeneratorDescriptions;
|
return this->GeneratorDescriptions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ int cmCPackInnoSetupGenerator::InitializeInternal()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetOptionIfNotSet("CPACK_INNOSETUP_EXECUTABLE", "ISCC");
|
SetOptionIfNotSet("CPACK_INNOSETUP_EXECUTABLE", "ISCC");
|
||||||
const std::string& isccPath = cmSystemTools::FindProgram(
|
std::string const& isccPath = cmSystemTools::FindProgram(
|
||||||
GetOption("CPACK_INNOSETUP_EXECUTABLE"), path, false);
|
GetOption("CPACK_INNOSETUP_EXECUTABLE"), path, false);
|
||||||
|
|
||||||
if (isccPath.empty()) {
|
if (isccPath.empty()) {
|
||||||
@@ -58,7 +58,7 @@ int cmCPackInnoSetupGenerator::InitializeInternal()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string isccCmd =
|
std::string const isccCmd =
|
||||||
cmStrCat(QuotePath(isccPath, PathType::Native), "/?");
|
cmStrCat(QuotePath(isccPath, PathType::Native), "/?");
|
||||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||||
"Test Inno Setup version: " << isccCmd << std::endl);
|
"Test Inno Setup version: " << isccCmd << std::endl);
|
||||||
@@ -76,8 +76,8 @@ int cmCPackInnoSetupGenerator::InitializeInternal()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int isccVersion = atoi(vRex.match(1).c_str());
|
int const isccVersion = atoi(vRex.match(1).c_str());
|
||||||
const int minIsccVersion = 6;
|
int const minIsccVersion = 6;
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
"Inno Setup Version: " << isccVersion << std::endl);
|
"Inno Setup Version: " << isccVersion << std::endl);
|
||||||
|
|
||||||
@@ -98,8 +98,8 @@ int cmCPackInnoSetupGenerator::PackageFiles()
|
|||||||
{
|
{
|
||||||
// Includes
|
// Includes
|
||||||
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_EXTRA_SCRIPTS")) {
|
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_EXTRA_SCRIPTS")) {
|
||||||
const cmList extraScripts(*v);
|
cmList const extraScripts(*v);
|
||||||
for (const std::string& i : extraScripts) {
|
for (std::string const& i : extraScripts) {
|
||||||
includeDirectives.emplace_back(cmStrCat(
|
includeDirectives.emplace_back(cmStrCat(
|
||||||
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
|
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ int cmCPackInnoSetupGenerator::PackageFiles()
|
|||||||
|
|
||||||
// [Languages] section
|
// [Languages] section
|
||||||
SetOptionIfNotSet("CPACK_INNOSETUP_LANGUAGES", "english");
|
SetOptionIfNotSet("CPACK_INNOSETUP_LANGUAGES", "english");
|
||||||
const cmList languages(GetOption("CPACK_INNOSETUP_LANGUAGES"));
|
cmList const languages(GetOption("CPACK_INNOSETUP_LANGUAGES"));
|
||||||
for (std::string i : languages) {
|
for (std::string i : languages) {
|
||||||
cmCPackInnoSetupKeyValuePairs params;
|
cmCPackInnoSetupKeyValuePairs params;
|
||||||
|
|
||||||
@@ -133,8 +133,8 @@ int cmCPackInnoSetupGenerator::PackageFiles()
|
|||||||
|
|
||||||
// [Code] section
|
// [Code] section
|
||||||
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_CODE_FILES")) {
|
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_CODE_FILES")) {
|
||||||
const cmList codeFiles(*v);
|
cmList const codeFiles(*v);
|
||||||
for (const std::string& i : codeFiles) {
|
for (std::string const& i : codeFiles) {
|
||||||
codeIncludes.emplace_back(cmStrCat(
|
codeIncludes.emplace_back(cmStrCat(
|
||||||
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
|
"#include ", QuotePath(cmSystemTools::CollapseFullPath(i, toplevel))));
|
||||||
}
|
}
|
||||||
@@ -288,9 +288,9 @@ bool cmCPackInnoSetupGenerator::ProcessSetupSection()
|
|||||||
* Handle custom directives (they have higher priority than other variables,
|
* Handle custom directives (they have higher priority than other variables,
|
||||||
* so they have to be processed after all other variables)
|
* so they have to be processed after all other variables)
|
||||||
*/
|
*/
|
||||||
for (const std::string& i : GetOptions()) {
|
for (std::string const& i : GetOptions()) {
|
||||||
if (cmHasPrefix(i, "CPACK_INNOSETUP_SETUP_")) {
|
if (cmHasPrefix(i, "CPACK_INNOSETUP_SETUP_")) {
|
||||||
const std::string& directive =
|
std::string const& directive =
|
||||||
i.substr(cmStrLen("CPACK_INNOSETUP_SETUP_"));
|
i.substr(cmStrLen("CPACK_INNOSETUP_SETUP_"));
|
||||||
setupDirectives[directive] = GetOption(i);
|
setupDirectives[directive] = GetOption(i);
|
||||||
}
|
}
|
||||||
@@ -304,7 +304,7 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
std::map<std::string, std::string> customFileInstructions;
|
std::map<std::string, std::string> customFileInstructions;
|
||||||
if (cmValue v =
|
if (cmValue v =
|
||||||
GetOptionIfSet("CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS")) {
|
GetOptionIfSet("CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS")) {
|
||||||
const cmList instructions(*v);
|
cmList const instructions(*v);
|
||||||
if (instructions.size() % 2 != 0) {
|
if (instructions.size() % 2 != 0) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS should "
|
"CPACK_INNOSETUP_CUSTOM_INSTALL_INSTRUCTIONS should "
|
||||||
@@ -314,18 +314,18 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto it = instructions.begin(); it != instructions.end(); ++it) {
|
for (auto it = instructions.begin(); it != instructions.end(); ++it) {
|
||||||
const std::string& key =
|
std::string const& key =
|
||||||
QuotePath(cmSystemTools::CollapseFullPath(*it, toplevel));
|
QuotePath(cmSystemTools::CollapseFullPath(*it, toplevel));
|
||||||
customFileInstructions[key] = *(++it);
|
customFileInstructions[key] = *(++it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& iconsPrefix =
|
std::string const& iconsPrefix =
|
||||||
toplevelProgramFolder ? "{autoprograms}\\" : "{group}\\";
|
toplevelProgramFolder ? "{autoprograms}\\" : "{group}\\";
|
||||||
|
|
||||||
std::map<std::string, std::string> icons;
|
std::map<std::string, std::string> icons;
|
||||||
if (cmValue v = GetOptionIfSet("CPACK_PACKAGE_EXECUTABLES")) {
|
if (cmValue v = GetOptionIfSet("CPACK_PACKAGE_EXECUTABLES")) {
|
||||||
const cmList executables(*v);
|
cmList const executables(*v);
|
||||||
if (executables.size() % 2 != 0) {
|
if (executables.size() % 2 != 0) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"CPACK_PACKAGE_EXECUTABLES should should contain pairs of "
|
"CPACK_PACKAGE_EXECUTABLES should should contain pairs of "
|
||||||
@@ -335,7 +335,7 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto it = executables.begin(); it != executables.end(); ++it) {
|
for (auto it = executables.begin(); it != executables.end(); ++it) {
|
||||||
const std::string& key = *it;
|
std::string const& key = *it;
|
||||||
icons[key] = *(++it);
|
icons[key] = *(++it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,7 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
cmExpandList(*v, runExecutables);
|
cmExpandList(*v, runExecutables);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const std::string& i : files) {
|
for (std::string const& i : files) {
|
||||||
cmCPackInnoSetupKeyValuePairs params;
|
cmCPackInnoSetupKeyValuePairs params;
|
||||||
|
|
||||||
std::string toplevelDirectory;
|
std::string toplevelDirectory;
|
||||||
@@ -358,12 +358,12 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
cmCPackComponent* component = nullptr;
|
cmCPackComponent* component = nullptr;
|
||||||
std::string componentParam;
|
std::string componentParam;
|
||||||
if (!Components.empty()) {
|
if (!Components.empty()) {
|
||||||
const std::string& fileName = cmSystemTools::RelativePath(toplevel, i);
|
std::string const& fileName = cmSystemTools::RelativePath(toplevel, i);
|
||||||
const std::string::size_type pos = fileName.find('/');
|
std::string::size_type const pos = fileName.find('/');
|
||||||
|
|
||||||
// Use the custom component install directory if we have one
|
// Use the custom component install directory if we have one
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
const std::string& componentName = fileName.substr(0, pos);
|
std::string const& componentName = fileName.substr(0, pos);
|
||||||
component = &Components[componentName];
|
component = &Components[componentName];
|
||||||
|
|
||||||
toplevelDirectory =
|
toplevelDirectory =
|
||||||
@@ -420,10 +420,10 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
params["DestDir"] = QuotePath(destDir);
|
params["DestDir"] = QuotePath(destDir);
|
||||||
|
|
||||||
if (component && component->IsDownloaded) {
|
if (component && component->IsDownloaded) {
|
||||||
const std::string& archiveName =
|
std::string const& archiveName =
|
||||||
cmSystemTools::GetFilenameWithoutLastExtension(
|
cmSystemTools::GetFilenameWithoutLastExtension(
|
||||||
component->ArchiveFile);
|
component->ArchiveFile);
|
||||||
const std::string& relativePath =
|
std::string const& relativePath =
|
||||||
cmSystemTools::RelativePath(toplevelDirectory, i);
|
cmSystemTools::RelativePath(toplevelDirectory, i);
|
||||||
|
|
||||||
params["Source"] =
|
params["Source"] =
|
||||||
@@ -444,9 +444,9 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
fileInstructions.push_back(ISKeyValueLine(params));
|
fileInstructions.push_back(ISKeyValueLine(params));
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
const std::string& name =
|
std::string const& name =
|
||||||
cmSystemTools::GetFilenameWithoutLastExtension(i);
|
cmSystemTools::GetFilenameWithoutLastExtension(i);
|
||||||
const std::string& extension =
|
std::string const& extension =
|
||||||
cmSystemTools::GetFilenameLastExtension(i);
|
cmSystemTools::GetFilenameLastExtension(i);
|
||||||
if ((extension == ".exe" || extension == ".com") && // only .exe, .com
|
if ((extension == ".exe" || extension == ".com") && // only .exe, .com
|
||||||
icons.count(name)) {
|
icons.count(name)) {
|
||||||
@@ -504,7 +504,7 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
"^(mailto:|(ftps?|https?|news)://).*$");
|
"^(mailto:|(ftps?|https?|news)://).*$");
|
||||||
|
|
||||||
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_MENU_LINKS")) {
|
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_MENU_LINKS")) {
|
||||||
const cmList menuIcons(*v);
|
cmList const menuIcons(*v);
|
||||||
if (menuIcons.size() % 2 != 0) {
|
if (menuIcons.size() % 2 != 0) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"CPACK_INNOSETUP_MENU_LINKS should "
|
"CPACK_INNOSETUP_MENU_LINKS should "
|
||||||
@@ -514,8 +514,8 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto it = menuIcons.begin(); it != menuIcons.end(); ++it) {
|
for (auto it = menuIcons.begin(); it != menuIcons.end(); ++it) {
|
||||||
const std::string& target = *it;
|
std::string const& target = *it;
|
||||||
const std::string& label = *(++it);
|
std::string const& label = *(++it);
|
||||||
cmCPackInnoSetupKeyValuePairs params;
|
cmCPackInnoSetupKeyValuePairs params;
|
||||||
|
|
||||||
params["Name"] = QuotePath(cmStrCat(iconsPrefix, label));
|
params["Name"] = QuotePath(cmStrCat(iconsPrefix, label));
|
||||||
@@ -524,7 +524,7 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
|
|||||||
} else {
|
} else {
|
||||||
std::string dir = "{app}";
|
std::string dir = "{app}";
|
||||||
std::string componentName;
|
std::string componentName;
|
||||||
for (const auto& i : Components) {
|
for (auto const& i : Components) {
|
||||||
if (cmSystemTools::FileExists(cmSystemTools::CollapseFullPath(
|
if (cmSystemTools::FileExists(cmSystemTools::CollapseFullPath(
|
||||||
cmStrCat(i.second.Name, '\\', target), toplevel))) {
|
cmStrCat(i.second.Name, '\\', target), toplevel))) {
|
||||||
dir = CustomComponentInstallDirectory(&i.second);
|
dir = CustomComponentInstallDirectory(&i.second);
|
||||||
@@ -684,10 +684,10 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetOptionIfNotSet("CPACK_INNOSETUP_VERIFY_DOWNLOADS", "ON");
|
SetOptionIfNotSet("CPACK_INNOSETUP_VERIFY_DOWNLOADS", "ON");
|
||||||
const bool verifyDownloads =
|
bool const verifyDownloads =
|
||||||
GetOption("CPACK_INNOSETUP_VERIFY_DOWNLOADS").IsOn();
|
GetOption("CPACK_INNOSETUP_VERIFY_DOWNLOADS").IsOn();
|
||||||
|
|
||||||
const std::string& urlPrefix =
|
std::string const& urlPrefix =
|
||||||
cmHasSuffix(GetOption("CPACK_DOWNLOAD_SITE").GetCStr(), '/')
|
cmHasSuffix(GetOption("CPACK_DOWNLOAD_SITE").GetCStr(), '/')
|
||||||
? GetOption("CPACK_DOWNLOAD_SITE")
|
? GetOption("CPACK_DOWNLOAD_SITE")
|
||||||
: cmStrCat(GetOption("CPACK_DOWNLOAD_SITE"), '/');
|
: cmStrCat(GetOption("CPACK_DOWNLOAD_SITE"), '/');
|
||||||
@@ -722,7 +722,7 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
|
|||||||
SetOption("CPACK_INNOSETUP_DOWNLOAD_COMPONENTS_INTERNAL",
|
SetOption("CPACK_INNOSETUP_DOWNLOAD_COMPONENTS_INTERNAL",
|
||||||
cmJoin(archiveComponents, ", "));
|
cmJoin(archiveComponents, ", "));
|
||||||
|
|
||||||
static const std::string& downloadLines =
|
static std::string const& downloadLines =
|
||||||
"#define protected CPackDownloadCount "
|
"#define protected CPackDownloadCount "
|
||||||
"@CPACK_INNOSETUP_DOWNLOAD_COUNT_INTERNAL@\n"
|
"@CPACK_INNOSETUP_DOWNLOAD_COUNT_INTERNAL@\n"
|
||||||
"#dim protected CPackDownloadUrls[CPackDownloadCount] "
|
"#dim protected CPackDownloadUrls[CPackDownloadCount] "
|
||||||
@@ -742,7 +742,7 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the required script
|
// Add the required script
|
||||||
const std::string& componentsScriptTemplate =
|
std::string const& componentsScriptTemplate =
|
||||||
FindTemplate("ISComponents.pas");
|
FindTemplate("ISComponents.pas");
|
||||||
if (componentsScriptTemplate.empty()) {
|
if (componentsScriptTemplate.empty()) {
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
@@ -759,8 +759,8 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
|
|||||||
|
|
||||||
bool cmCPackInnoSetupGenerator::ConfigureISScript()
|
bool cmCPackInnoSetupGenerator::ConfigureISScript()
|
||||||
{
|
{
|
||||||
const std::string& isScriptTemplate = FindTemplate("ISScript.template.in");
|
std::string const& isScriptTemplate = FindTemplate("ISScript.template.in");
|
||||||
const std::string& isScriptFile =
|
std::string const& isScriptFile =
|
||||||
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISScript.iss");
|
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISScript.iss");
|
||||||
|
|
||||||
if (isScriptTemplate.empty()) {
|
if (isScriptTemplate.empty()) {
|
||||||
@@ -772,12 +772,12 @@ bool cmCPackInnoSetupGenerator::ConfigureISScript()
|
|||||||
|
|
||||||
// Create internal variables
|
// Create internal variables
|
||||||
std::vector<std::string> setupSection;
|
std::vector<std::string> setupSection;
|
||||||
for (const auto& i : setupDirectives) {
|
for (auto const& i : setupDirectives) {
|
||||||
setupSection.emplace_back(cmStrCat(i.first, '=', TranslateBool(i.second)));
|
setupSection.emplace_back(cmStrCat(i.first, '=', TranslateBool(i.second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also create comments if the sections are empty
|
// Also create comments if the sections are empty
|
||||||
const std::string& defaultMessage =
|
std::string const& defaultMessage =
|
||||||
"; CPack didn't find any entries for this section";
|
"; CPack didn't find any entries for this section";
|
||||||
|
|
||||||
if (!IsSetToEmpty("CPACK_CREATE_DESKTOP_LINKS")) {
|
if (!IsSetToEmpty("CPACK_CREATE_DESKTOP_LINKS")) {
|
||||||
@@ -837,28 +837,28 @@ bool cmCPackInnoSetupGenerator::ConfigureISScript()
|
|||||||
|
|
||||||
bool cmCPackInnoSetupGenerator::Compile()
|
bool cmCPackInnoSetupGenerator::Compile()
|
||||||
{
|
{
|
||||||
const std::string& isScriptFile =
|
std::string const& isScriptFile =
|
||||||
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISScript.iss");
|
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISScript.iss");
|
||||||
const std::string& isccLogFile =
|
std::string const& isccLogFile =
|
||||||
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISCCOutput.log");
|
cmStrCat(GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/ISCCOutput.log");
|
||||||
|
|
||||||
std::vector<std::string> isccArgs;
|
std::vector<std::string> isccArgs;
|
||||||
|
|
||||||
// Custom defines
|
// Custom defines
|
||||||
for (const std::string& i : GetOptions()) {
|
for (std::string const& i : GetOptions()) {
|
||||||
if (cmHasPrefix(i, "CPACK_INNOSETUP_DEFINE_")) {
|
if (cmHasPrefix(i, "CPACK_INNOSETUP_DEFINE_")) {
|
||||||
const std::string& name = i.substr(cmStrLen("CPACK_INNOSETUP_DEFINE_"));
|
std::string const& name = i.substr(cmStrLen("CPACK_INNOSETUP_DEFINE_"));
|
||||||
isccArgs.push_back(
|
isccArgs.push_back(
|
||||||
cmStrCat("\"/D", name, '=', TranslateBool(GetOption(i)), '"'));
|
cmStrCat("\"/D", name, '=', TranslateBool(GetOption(i)), '"'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_EXECUTABLE_ARGUMENTS")) {
|
if (cmValue v = GetOptionIfSet("CPACK_INNOSETUP_EXECUTABLE_ARGUMENTS")) {
|
||||||
const cmList args(*v);
|
cmList const args(*v);
|
||||||
isccArgs.insert(isccArgs.end(), args.begin(), args.end());
|
isccArgs.insert(isccArgs.end(), args.begin(), args.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& isccCmd =
|
std::string const& isccCmd =
|
||||||
cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM"), PathType::Native),
|
cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM"), PathType::Native),
|
||||||
' ', cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile));
|
' ', cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile));
|
||||||
|
|
||||||
@@ -866,7 +866,7 @@ bool cmCPackInnoSetupGenerator::Compile()
|
|||||||
|
|
||||||
std::string output;
|
std::string output;
|
||||||
int retVal = 1;
|
int retVal = 1;
|
||||||
const bool res = cmSystemTools::RunSingleCommand(
|
bool const res = cmSystemTools::RunSingleCommand(
|
||||||
isccCmd, &output, &output, &retVal, nullptr, this->GeneratorVerbose,
|
isccCmd, &output, &output, &retVal, nullptr, this->GeneratorVerbose,
|
||||||
cmDuration::zero());
|
cmDuration::zero());
|
||||||
|
|
||||||
@@ -885,11 +885,11 @@ bool cmCPackInnoSetupGenerator::Compile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
||||||
cmCPackComponent* component, const std::string& uploadDirectory,
|
cmCPackComponent* component, std::string const& uploadDirectory,
|
||||||
std::string* hash)
|
std::string* hash)
|
||||||
{
|
{
|
||||||
// Remove the old archive, if one exists
|
// Remove the old archive, if one exists
|
||||||
const std::string& archiveFile =
|
std::string const& archiveFile =
|
||||||
uploadDirectory + '/' + component->ArchiveFile;
|
uploadDirectory + '/' + component->ArchiveFile;
|
||||||
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
|
||||||
"- Building downloaded component archive: " << archiveFile
|
"- Building downloaded component archive: " << archiveFile
|
||||||
@@ -922,16 +922,16 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The directory where this component's files reside
|
// The directory where this component's files reside
|
||||||
const std::string& dirName =
|
std::string const& dirName =
|
||||||
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), '/', component->Name);
|
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), '/', component->Name);
|
||||||
|
|
||||||
// Build the list of files to go into this archive
|
// Build the list of files to go into this archive
|
||||||
const std::string& zipListFileName =
|
std::string const& zipListFileName =
|
||||||
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
|
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
|
||||||
const bool needQuotesInFile = GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
|
bool const needQuotesInFile = GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
|
||||||
{ // the scope is needed for cmGeneratedFileStream
|
{ // the scope is needed for cmGeneratedFileStream
|
||||||
cmGeneratedFileStream out(zipListFileName);
|
cmGeneratedFileStream out(zipListFileName);
|
||||||
for (const std::string& i : component->Files) {
|
for (std::string const& i : component->Files) {
|
||||||
out << (needQuotesInFile ? Quote(i) : i) << std::endl;
|
out << (needQuotesInFile ? Quote(i) : i) << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -943,7 +943,7 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
|||||||
zipListFileName.c_str());
|
zipListFileName.c_str());
|
||||||
std::string output;
|
std::string output;
|
||||||
int retVal = -1;
|
int retVal = -1;
|
||||||
const bool res = cmSystemTools::RunSingleCommand(
|
bool const res = cmSystemTools::RunSingleCommand(
|
||||||
cmd, &output, &output, &retVal, dirName.c_str(), this->GeneratorVerbose,
|
cmd, &output, &output, &retVal, dirName.c_str(), this->GeneratorVerbose,
|
||||||
cmDuration::zero());
|
cmDuration::zero());
|
||||||
if (!res || retVal) {
|
if (!res || retVal) {
|
||||||
@@ -967,12 +967,12 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const std::string& hashCmd =
|
std::string const& hashCmd =
|
||||||
cmStrCat("certutil -hashfile ", QuotePath(archiveFile), " SHA256");
|
cmStrCat("certutil -hashfile ", QuotePath(archiveFile), " SHA256");
|
||||||
|
|
||||||
std::string hashOutput;
|
std::string hashOutput;
|
||||||
int hashRetVal = -1;
|
int hashRetVal = -1;
|
||||||
const bool hashRes = cmSystemTools::RunSingleCommand(
|
bool const hashRes = cmSystemTools::RunSingleCommand(
|
||||||
hashCmd, &hashOutput, &hashOutput, &hashRetVal, nullptr,
|
hashCmd, &hashOutput, &hashOutput, &hashRetVal, nullptr,
|
||||||
this->GeneratorVerbose, cmDuration::zero());
|
this->GeneratorVerbose, cmDuration::zero());
|
||||||
if (!hashRes || hashRetVal) {
|
if (!hashRes || hashRetVal) {
|
||||||
@@ -993,7 +993,7 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmValue cmCPackInnoSetupGenerator::RequireOption(const std::string& key)
|
cmValue cmCPackInnoSetupGenerator::RequireOption(std::string const& key)
|
||||||
{
|
{
|
||||||
cmValue value = GetOption(key);
|
cmValue value = GetOption(key);
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ cmValue cmCPackInnoSetupGenerator::RequireOption(const std::string& key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::CustomComponentInstallDirectory(
|
std::string cmCPackInnoSetupGenerator::CustomComponentInstallDirectory(
|
||||||
const cmCPackComponent* component)
|
cmCPackComponent const* component)
|
||||||
{
|
{
|
||||||
cmValue outputDir = GetOption(
|
cmValue outputDir = GetOption(
|
||||||
cmStrCat("CPACK_INNOSETUP_", component->Name, "_INSTALL_DIRECTORY"));
|
cmStrCat("CPACK_INNOSETUP_", component->Name, "_INSTALL_DIRECTORY"));
|
||||||
@@ -1036,7 +1036,7 @@ std::string cmCPackInnoSetupGenerator::CustomComponentInstallDirectory(
|
|||||||
return "{app}";
|
return "{app}";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::TranslateBool(const std::string& value)
|
std::string cmCPackInnoSetupGenerator::TranslateBool(std::string const& value)
|
||||||
{
|
{
|
||||||
if (value.empty()) {
|
if (value.empty()) {
|
||||||
return value;
|
return value;
|
||||||
@@ -1056,13 +1056,13 @@ std::string cmCPackInnoSetupGenerator::TranslateBool(const std::string& value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::ISKeyValueLine(
|
std::string cmCPackInnoSetupGenerator::ISKeyValueLine(
|
||||||
const cmCPackInnoSetupKeyValuePairs& params)
|
cmCPackInnoSetupKeyValuePairs const& params)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* To simplify readability of the generated code, the keys are sorted.
|
* To simplify readability of the generated code, the keys are sorted.
|
||||||
* Unknown keys are ignored to avoid errors during compilation.
|
* Unknown keys are ignored to avoid errors during compilation.
|
||||||
*/
|
*/
|
||||||
static const char* const availableKeys[] = {
|
static char const* const availableKeys[] = {
|
||||||
"Source", "DestDir", "Name", "Filename",
|
"Source", "DestDir", "Name", "Filename",
|
||||||
"Description", "GroupDescription", "MessagesFile", "Types",
|
"Description", "GroupDescription", "MessagesFile", "Types",
|
||||||
"ExternalSize", "BeforeInstall", "Flags", "Components",
|
"ExternalSize", "BeforeInstall", "Flags", "Components",
|
||||||
@@ -1070,7 +1070,7 @@ std::string cmCPackInnoSetupGenerator::ISKeyValueLine(
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::vector<std::string> keys;
|
std::vector<std::string> keys;
|
||||||
for (const char* i : availableKeys) {
|
for (char const* i : availableKeys) {
|
||||||
if (params.count(i)) {
|
if (params.count(i)) {
|
||||||
keys.emplace_back(cmStrCat(i, ": ", params.at(i)));
|
keys.emplace_back(cmStrCat(i, ": ", params.at(i)));
|
||||||
}
|
}
|
||||||
@@ -1080,13 +1080,13 @@ std::string cmCPackInnoSetupGenerator::ISKeyValueLine(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::CreateRecursiveComponentPath(
|
std::string cmCPackInnoSetupGenerator::CreateRecursiveComponentPath(
|
||||||
cmCPackComponentGroup* group, const std::string& path)
|
cmCPackComponentGroup* group, std::string const& path)
|
||||||
{
|
{
|
||||||
if (!group) {
|
if (!group) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& newPath =
|
std::string const& newPath =
|
||||||
path.empty() ? group->Name : cmStrCat(group->Name, '\\', path);
|
path.empty() ? group->Name : cmStrCat(group->Name, '\\', path);
|
||||||
return CreateRecursiveComponentPath(group->ParentGroup, newPath);
|
return CreateRecursiveComponentPath(group->ParentGroup, newPath);
|
||||||
}
|
}
|
||||||
@@ -1114,7 +1114,7 @@ void cmCPackInnoSetupGenerator::CreateRecursiveComponentGroups(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::Quote(const std::string& string)
|
std::string cmCPackInnoSetupGenerator::Quote(std::string const& string)
|
||||||
{
|
{
|
||||||
if (cmHasPrefix(string, '"') && cmHasSuffix(string, '"')) {
|
if (cmHasPrefix(string, '"') && cmHasSuffix(string, '"')) {
|
||||||
return Quote(string.substr(1, string.length() - 2));
|
return Quote(string.substr(1, string.length() - 2));
|
||||||
@@ -1126,7 +1126,7 @@ std::string cmCPackInnoSetupGenerator::Quote(const std::string& string)
|
|||||||
return cmStrCat('"', nString, '"');
|
return cmStrCat('"', nString, '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path,
|
std::string cmCPackInnoSetupGenerator::QuotePath(std::string const& path,
|
||||||
PathType type)
|
PathType type)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -1140,7 +1140,7 @@ std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackInnoSetupGenerator::PrepareForConstant(
|
std::string cmCPackInnoSetupGenerator::PrepareForConstant(
|
||||||
const std::string& string)
|
std::string const& string)
|
||||||
{
|
{
|
||||||
std::string nString = string;
|
std::string nString = string;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ protected:
|
|||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
|
|
||||||
inline const char* GetOutputExtension() override { return ".exe"; }
|
inline char const* GetOutputExtension() override { return ".exe"; }
|
||||||
|
|
||||||
inline cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
inline cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
||||||
const override
|
const override
|
||||||
@@ -63,22 +63,22 @@ private:
|
|||||||
bool Compile();
|
bool Compile();
|
||||||
|
|
||||||
bool BuildDownloadedComponentArchive(cmCPackComponent* component,
|
bool BuildDownloadedComponentArchive(cmCPackComponent* component,
|
||||||
const std::string& uploadDirectory,
|
std::string const& uploadDirectory,
|
||||||
std::string* hash);
|
std::string* hash);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the option's value or an empty string if the option isn't set.
|
* Returns the option's value or an empty string if the option isn't set.
|
||||||
*/
|
*/
|
||||||
cmValue RequireOption(const std::string& key);
|
cmValue RequireOption(std::string const& key);
|
||||||
|
|
||||||
std::string CustomComponentInstallDirectory(
|
std::string CustomComponentInstallDirectory(
|
||||||
const cmCPackComponent* component);
|
cmCPackComponent const* component);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates boolean expressions into "yes" or "no", as required in
|
* Translates boolean expressions into "yes" or "no", as required in
|
||||||
* Inno Setup (only if "CPACK_INNOSETUP_USE_CMAKE_BOOL_FORMAT" is on).
|
* Inno Setup (only if "CPACK_INNOSETUP_USE_CMAKE_BOOL_FORMAT" is on).
|
||||||
*/
|
*/
|
||||||
std::string TranslateBool(const std::string& value);
|
std::string TranslateBool(std::string const& value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a typical line of key and value pairs using the given map.
|
* Creates a typical line of key and value pairs using the given map.
|
||||||
@@ -86,10 +86,10 @@ private:
|
|||||||
* (e.g.: Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}";
|
* (e.g.: Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}";
|
||||||
* GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked)
|
* GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked)
|
||||||
*/
|
*/
|
||||||
std::string ISKeyValueLine(const cmCPackInnoSetupKeyValuePairs& params);
|
std::string ISKeyValueLine(cmCPackInnoSetupKeyValuePairs const& params);
|
||||||
|
|
||||||
std::string CreateRecursiveComponentPath(cmCPackComponentGroup* group,
|
std::string CreateRecursiveComponentPath(cmCPackComponentGroup* group,
|
||||||
const std::string& path = "");
|
std::string const& path = "");
|
||||||
|
|
||||||
void CreateRecursiveComponentGroups(cmCPackComponentGroup* group);
|
void CreateRecursiveComponentGroups(cmCPackComponentGroup* group);
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ private:
|
|||||||
* These functions add quotes if the given value hasn't already quotes.
|
* These functions add quotes if the given value hasn't already quotes.
|
||||||
* Paths are converted into the format used by Windows before.
|
* Paths are converted into the format used by Windows before.
|
||||||
*/
|
*/
|
||||||
std::string Quote(const std::string& string);
|
std::string Quote(std::string const& string);
|
||||||
std::string QuotePath(const std::string& path,
|
std::string QuotePath(std::string const& path,
|
||||||
PathType type = PathType::Windows);
|
PathType type = PathType::Windows);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,7 +106,7 @@ private:
|
|||||||
* '|' '}' ',' '%' '"'
|
* '|' '}' ',' '%' '"'
|
||||||
* Required for Inno Setup constants like {cm:...}
|
* Required for Inno Setup constants like {cm:...}
|
||||||
*/
|
*/
|
||||||
std::string PrepareForConstant(const std::string& string);
|
std::string PrepareForConstant(std::string const& string);
|
||||||
|
|
||||||
std::vector<std::string> includeDirectives;
|
std::vector<std::string> includeDirectives;
|
||||||
cmCPackInnoSetupKeyValuePairs setupDirectives;
|
cmCPackInnoSetupKeyValuePairs setupDirectives;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void cmCPackLog::SetLogOutputStream(std::ostream* os)
|
|||||||
this->LogOutput = os;
|
this->LogOutput = os;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackLog::SetLogOutputFile(const char* fname)
|
bool cmCPackLog::SetLogOutputFile(char const* fname)
|
||||||
{
|
{
|
||||||
this->LogOutputStream.reset();
|
this->LogOutputStream.reset();
|
||||||
if (fname) {
|
if (fname) {
|
||||||
@@ -38,7 +38,7 @@ bool cmCPackLog::SetLogOutputFile(const char* fname)
|
|||||||
return this->LogOutput != nullptr;
|
return this->LogOutput != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackLog::Log(int tag, const char* file, int line, const char* msg,
|
void cmCPackLog::Log(int tag, char const* file, int line, char const* msg,
|
||||||
size_t length)
|
size_t length)
|
||||||
{
|
{
|
||||||
// By default no logging
|
// By default no logging
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ public:
|
|||||||
cmCPackLog();
|
cmCPackLog();
|
||||||
~cmCPackLog();
|
~cmCPackLog();
|
||||||
|
|
||||||
cmCPackLog(const cmCPackLog&) = delete;
|
cmCPackLog(cmCPackLog const&) = delete;
|
||||||
cmCPackLog& operator=(const cmCPackLog&) = delete;
|
cmCPackLog& operator=(cmCPackLog const&) = delete;
|
||||||
|
|
||||||
enum cm_log_tags
|
enum cm_log_tags
|
||||||
{
|
{
|
||||||
@@ -40,19 +40,19 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! Various signatures for logging.
|
//! Various signatures for logging.
|
||||||
void Log(const char* file, int line, const char* msg)
|
void Log(char const* file, int line, char const* msg)
|
||||||
{
|
{
|
||||||
this->Log(LOG_OUTPUT, file, line, msg);
|
this->Log(LOG_OUTPUT, file, line, msg);
|
||||||
}
|
}
|
||||||
void Log(const char* file, int line, const char* msg, size_t length)
|
void Log(char const* file, int line, char const* msg, size_t length)
|
||||||
{
|
{
|
||||||
this->Log(LOG_OUTPUT, file, line, msg, length);
|
this->Log(LOG_OUTPUT, file, line, msg, length);
|
||||||
}
|
}
|
||||||
void Log(int tag, const char* file, int line, const char* msg)
|
void Log(int tag, char const* file, int line, char const* msg)
|
||||||
{
|
{
|
||||||
this->Log(tag, file, line, msg, strlen(msg));
|
this->Log(tag, file, line, msg, strlen(msg));
|
||||||
}
|
}
|
||||||
void Log(int tag, const char* file, int line, const char* msg,
|
void Log(int tag, char const* file, int line, char const* msg,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
//! Set Verbose
|
//! Set Verbose
|
||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
//! Set the log output file. The cmCPackLog will try to create file. If it
|
//! Set the log output file. The cmCPackLog will try to create file. If it
|
||||||
// cannot, it will report an error.
|
// cannot, it will report an error.
|
||||||
bool SetLogOutputFile(const char* fname);
|
bool SetLogOutputFile(char const* fname);
|
||||||
|
|
||||||
//! Set the various prefixes for the logging. SetPrefix sets the generic
|
//! Set the various prefixes for the logging. SetPrefix sets the generic
|
||||||
// prefix that overwrites missing ones.
|
// prefix that overwrites missing ones.
|
||||||
@@ -121,17 +121,17 @@ private:
|
|||||||
class cmCPackLogWrite
|
class cmCPackLogWrite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmCPackLogWrite(const char* data, size_t length)
|
cmCPackLogWrite(char const* data, size_t length)
|
||||||
: Data(data)
|
: Data(data)
|
||||||
, Length(length)
|
, Length(length)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Data;
|
char const* Data;
|
||||||
std::streamsize Length;
|
std::streamsize Length;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream& operator<<(std::ostream& os, const cmCPackLogWrite& c)
|
inline std::ostream& operator<<(std::ostream& os, cmCPackLogWrite const& c)
|
||||||
{
|
{
|
||||||
os.write(c.Data, c.Length);
|
os.write(c.Data, c.Length);
|
||||||
os.flush();
|
os.flush();
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
std::string outputDir = "$INSTDIR";
|
std::string outputDir = "$INSTDIR";
|
||||||
std::string fileN = cmSystemTools::RelativePath(this->toplevel, file);
|
std::string fileN = cmSystemTools::RelativePath(this->toplevel, file);
|
||||||
if (!this->Components.empty()) {
|
if (!this->Components.empty()) {
|
||||||
const std::string::size_type pos = fileN.find('/');
|
std::string::size_type const pos = fileN.find('/');
|
||||||
|
|
||||||
// Use the custom component install directory if we have one
|
// Use the custom component install directory if we have one
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
@@ -111,7 +111,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
}
|
}
|
||||||
std::replace(fileN.begin(), fileN.end(), '/', '\\');
|
std::replace(fileN.begin(), fileN.end(), '/', '\\');
|
||||||
|
|
||||||
const std::string componentOutputDir =
|
std::string const componentOutputDir =
|
||||||
this->CustomComponentInstallDirectory(componentName);
|
this->CustomComponentInstallDirectory(componentName);
|
||||||
|
|
||||||
dstr << " RMDir \"" << componentOutputDir << "\\" << fileN << "\""
|
dstr << " RMDir \"" << componentOutputDir << "\\" << fileN << "\""
|
||||||
@@ -212,7 +212,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
if (cmValue wantedPosition =
|
if (cmValue wantedPosition =
|
||||||
this->GetOptionIfSet("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION")) {
|
this->GetOptionIfSet("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION")) {
|
||||||
if (!wantedPosition->empty()) {
|
if (!wantedPosition->empty()) {
|
||||||
const std::set<std::string> possiblePositions{ "CENTER", "LEFT",
|
std::set<std::string> const possiblePositions{ "CENTER", "LEFT",
|
||||||
"RIGHT" };
|
"RIGHT" };
|
||||||
if (possiblePositions.find(*wantedPosition) ==
|
if (possiblePositions.find(*wantedPosition) ==
|
||||||
possiblePositions.end()) {
|
possiblePositions.end()) {
|
||||||
@@ -629,7 +629,7 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
|
|||||||
cmList::iterator it;
|
cmList::iterator it;
|
||||||
for (it = cpackMenuLinksList.begin(); it != cpackMenuLinksList.end(); ++it) {
|
for (it = cpackMenuLinksList.begin(); it != cpackMenuLinksList.end(); ++it) {
|
||||||
std::string sourceName = *it;
|
std::string sourceName = *it;
|
||||||
const bool url = urlRegex.find(sourceName);
|
bool const url = urlRegex.find(sourceName);
|
||||||
|
|
||||||
// Convert / to \ in filenames, but not in urls:
|
// Convert / to \ in filenames, but not in urls:
|
||||||
//
|
//
|
||||||
@@ -666,12 +666,12 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackNSISGenerator::GetListOfSubdirectories(
|
bool cmCPackNSISGenerator::GetListOfSubdirectories(
|
||||||
const char* topdir, std::vector<std::string>& dirs)
|
char const* topdir, std::vector<std::string>& dirs)
|
||||||
{
|
{
|
||||||
cmsys::Directory dir;
|
cmsys::Directory dir;
|
||||||
dir.Load(topdir);
|
dir.Load(topdir);
|
||||||
for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
|
for (unsigned long i = 0; i < dir.GetNumberOfFiles(); ++i) {
|
||||||
const char* fileName = dir.GetFile(i);
|
char const* fileName = dir.GetFile(i);
|
||||||
if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
|
if (strcmp(fileName, ".") != 0 && strcmp(fileName, "..") != 0) {
|
||||||
std::string const fullPath =
|
std::string const fullPath =
|
||||||
std::string(topdir).append("/").append(fileName);
|
std::string(topdir).append("/").append(fileName);
|
||||||
@@ -727,7 +727,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
|
|||||||
componentCode += " SectionIn" + out.str() + "\n";
|
componentCode += " SectionIn" + out.str() + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string componentOutputDir =
|
std::string const componentOutputDir =
|
||||||
this->CustomComponentInstallDirectory(component->Name);
|
this->CustomComponentInstallDirectory(component->Name);
|
||||||
componentCode += cmStrCat(" SetOutPath \"", componentOutputDir, "\"\n");
|
componentCode += cmStrCat(" SetOutPath \"", componentOutputDir, "\"\n");
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ protected:
|
|||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr);
|
void CreateMenuLinks(std::ostream& str, std::ostream& deleteStr);
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetOutputExtension() override { return ".exe"; }
|
char const* GetOutputExtension() override { return ".exe"; }
|
||||||
const char* GetOutputPostfix() override { return "win32"; }
|
char const* GetOutputPostfix() override { return "win32"; }
|
||||||
|
|
||||||
bool GetListOfSubdirectories(const char* dir,
|
bool GetListOfSubdirectories(char const* dir,
|
||||||
std::vector<std::string>& dirs);
|
std::vector<std::string>& dirs);
|
||||||
|
|
||||||
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir()
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ void cmCPackNuGetGenerator::AddGeneratedPackageNames()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// add the generated packages to package file names list
|
// add the generated packages to package file names list
|
||||||
const std::string& fileNames = *files_list;
|
std::string const& fileNames = *files_list;
|
||||||
const char sep = ';';
|
char const sep = ';';
|
||||||
std::string::size_type pos1 = 0;
|
std::string::size_type pos1 = 0;
|
||||||
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
|
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
|
||||||
while (pos2 != std::string::npos) {
|
while (pos2 != std::string::npos) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ protected:
|
|||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
|
|
||||||
const char* GetOutputExtension() override { return ".nupkg"; }
|
char const* GetOutputExtension() override { return ".nupkg"; }
|
||||||
bool SupportsAbsoluteDestination() const override { return false; }
|
bool SupportsAbsoluteDestination() const override { return false; }
|
||||||
/**
|
/**
|
||||||
* The method used to prepare variables when component
|
* The method used to prepare variables when component
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ int cmCPackPKGGenerator::InitializeInternal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackPKGGenerator::GetPackageName(
|
std::string cmCPackPKGGenerator::GetPackageName(
|
||||||
const cmCPackComponent& component)
|
cmCPackComponent const& component)
|
||||||
{
|
{
|
||||||
if (component.ArchiveFile.empty()) {
|
if (component.ArchiveFile.empty()) {
|
||||||
std::string packagesDir =
|
std::string packagesDir =
|
||||||
@@ -48,8 +48,8 @@ std::string cmCPackPKGGenerator::GetPackageName(
|
|||||||
return cmStrCat(component.ArchiveFile, ".pkg");
|
return cmStrCat(component.ArchiveFile, ".pkg");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::CreateBackground(const char* themeName,
|
void cmCPackPKGGenerator::CreateBackground(char const* themeName,
|
||||||
const char* metapackageFile,
|
char const* metapackageFile,
|
||||||
cm::string_view genName,
|
cm::string_view genName,
|
||||||
cmXMLWriter& xout)
|
cmXMLWriter& xout)
|
||||||
{
|
{
|
||||||
@@ -107,8 +107,8 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName,
|
|||||||
xout.EndElement();
|
xout.EndElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile,
|
void cmCPackPKGGenerator::WriteDistributionFile(char const* metapackageFile,
|
||||||
const char* genName)
|
char const* genName)
|
||||||
{
|
{
|
||||||
std::string distributionTemplate =
|
std::string distributionTemplate =
|
||||||
this->FindTemplate("CPack.distribution.dist.in");
|
this->FindTemplate("CPack.distribution.dist.in");
|
||||||
@@ -206,7 +206,7 @@ void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::CreateChoiceOutline(
|
void cmCPackPKGGenerator::CreateChoiceOutline(
|
||||||
const cmCPackComponentGroup& group, cmXMLWriter& xout)
|
cmCPackComponentGroup const& group, cmXMLWriter& xout)
|
||||||
{
|
{
|
||||||
xout.StartElement("line");
|
xout.StartElement("line");
|
||||||
xout.Attribute("choice", cmStrCat(group.Name, "Choice"));
|
xout.Attribute("choice", cmStrCat(group.Name, "Choice"));
|
||||||
@@ -223,7 +223,7 @@ void cmCPackPKGGenerator::CreateChoiceOutline(
|
|||||||
xout.EndElement();
|
xout.EndElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::CreateChoice(const cmCPackComponentGroup& group,
|
void cmCPackPKGGenerator::CreateChoice(cmCPackComponentGroup const& group,
|
||||||
cmXMLWriter& xout)
|
cmXMLWriter& xout)
|
||||||
{
|
{
|
||||||
xout.StartElement("choice");
|
xout.StartElement("choice");
|
||||||
@@ -238,7 +238,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponentGroup& group,
|
|||||||
xout.EndElement();
|
xout.EndElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
|
void cmCPackPKGGenerator::CreateChoice(cmCPackComponent const& component,
|
||||||
cmXMLWriter& xout)
|
cmXMLWriter& xout)
|
||||||
{
|
{
|
||||||
std::string packageId;
|
std::string packageId;
|
||||||
@@ -278,7 +278,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
|
|||||||
// on (B and A), while selecting something that depends on C--either D
|
// on (B and A), while selecting something that depends on C--either D
|
||||||
// or E--will automatically cause C to get selected.
|
// or E--will automatically cause C to get selected.
|
||||||
std::ostringstream selected("my.choice.selected", std::ios_base::ate);
|
std::ostringstream selected("my.choice.selected", std::ios_base::ate);
|
||||||
std::set<const cmCPackComponent*> visited;
|
std::set<cmCPackComponent const*> visited;
|
||||||
AddDependencyAttributes(component, visited, selected);
|
AddDependencyAttributes(component, visited, selected);
|
||||||
visited.clear();
|
visited.clear();
|
||||||
AddReverseDependencyAttributes(component, visited, selected);
|
AddReverseDependencyAttributes(component, visited, selected);
|
||||||
@@ -350,8 +350,8 @@ void cmCPackPKGGenerator::CreateDomains(cmXMLWriter& xout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::AddDependencyAttributes(
|
void cmCPackPKGGenerator::AddDependencyAttributes(
|
||||||
const cmCPackComponent& component,
|
cmCPackComponent const& component,
|
||||||
std::set<const cmCPackComponent*>& visited, std::ostringstream& out)
|
std::set<cmCPackComponent const*>& visited, std::ostringstream& out)
|
||||||
{
|
{
|
||||||
if (visited.find(&component) != visited.end()) {
|
if (visited.find(&component) != visited.end()) {
|
||||||
return;
|
return;
|
||||||
@@ -365,8 +365,8 @@ void cmCPackPKGGenerator::AddDependencyAttributes(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCPackPKGGenerator::AddReverseDependencyAttributes(
|
void cmCPackPKGGenerator::AddReverseDependencyAttributes(
|
||||||
const cmCPackComponent& component,
|
cmCPackComponent const& component,
|
||||||
std::set<const cmCPackComponent*>& visited, std::ostringstream& out)
|
std::set<cmCPackComponent const*>& visited, std::ostringstream& out)
|
||||||
{
|
{
|
||||||
if (visited.find(&component) != visited.end()) {
|
if (visited.find(&component) != visited.end()) {
|
||||||
return;
|
return;
|
||||||
@@ -379,8 +379,8 @@ void cmCPackPKGGenerator::AddReverseDependencyAttributes(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
|
bool cmCPackPKGGenerator::CopyCreateResourceFile(std::string const& name,
|
||||||
const std::string& dirName)
|
std::string const& dirName)
|
||||||
{
|
{
|
||||||
std::string uname = cmSystemTools::UpperCase(name);
|
std::string uname = cmSystemTools::UpperCase(name);
|
||||||
std::string cpackVar = cmStrCat("CPACK_RESOURCE_FILE_", uname);
|
std::string cpackVar = cmStrCat("CPACK_RESOURCE_FILE_", uname);
|
||||||
@@ -426,8 +426,8 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name,
|
bool cmCPackPKGGenerator::CopyResourcePlistFile(std::string const& name,
|
||||||
const char* outName)
|
char const* outName)
|
||||||
{
|
{
|
||||||
if (!outName) {
|
if (!outName) {
|
||||||
outName = name.c_str();
|
outName = name.c_str();
|
||||||
@@ -451,9 +451,9 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(const std::string& name,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir,
|
int cmCPackPKGGenerator::CopyInstallScript(std::string const& resdir,
|
||||||
const std::string& script,
|
std::string const& script,
|
||||||
const std::string& name)
|
std::string const& name)
|
||||||
{
|
{
|
||||||
std::string dst = cmStrCat(resdir, '/', name);
|
std::string dst = cmStrCat(resdir, '/', name);
|
||||||
cmSystemTools::CopyFileAlways(script, dst);
|
cmSystemTools::CopyFileAlways(script, dst);
|
||||||
|
|||||||
@@ -34,61 +34,61 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
const char* GetOutputPostfix() override { return "darwin"; }
|
char const* GetOutputPostfix() override { return "darwin"; }
|
||||||
|
|
||||||
// Copies or creates the resource file with the given name to the
|
// Copies or creates the resource file with the given name to the
|
||||||
// package or package staging directory dirName. The variable
|
// package or package staging directory dirName. The variable
|
||||||
// CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
|
// CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
|
||||||
// version of name) specifies the input file to use for this file,
|
// version of name) specifies the input file to use for this file,
|
||||||
// which will be configured via ConfigureFile.
|
// which will be configured via ConfigureFile.
|
||||||
bool CopyCreateResourceFile(const std::string& name,
|
bool CopyCreateResourceFile(std::string const& name,
|
||||||
const std::string& dirName);
|
std::string const& dirName);
|
||||||
bool CopyResourcePlistFile(const std::string& name,
|
bool CopyResourcePlistFile(std::string const& name,
|
||||||
const char* outName = nullptr);
|
char const* outName = nullptr);
|
||||||
|
|
||||||
int CopyInstallScript(const std::string& resdir, const std::string& script,
|
int CopyInstallScript(std::string const& resdir, std::string const& script,
|
||||||
const std::string& name);
|
std::string const& name);
|
||||||
|
|
||||||
// Retrieve the name of package file that will be generated for this
|
// Retrieve the name of package file that will be generated for this
|
||||||
// component. The name is just the file name with extension, and
|
// component. The name is just the file name with extension, and
|
||||||
// does not include the subdirectory.
|
// does not include the subdirectory.
|
||||||
std::string GetPackageName(const cmCPackComponent& component);
|
std::string GetPackageName(cmCPackComponent const& component);
|
||||||
|
|
||||||
// Writes a distribution.dist file, which turns a metapackage into a
|
// Writes a distribution.dist file, which turns a metapackage into a
|
||||||
// full-fledged distribution. This file is used to describe
|
// full-fledged distribution. This file is used to describe
|
||||||
// inter-component dependencies. metapackageFile is the name of the
|
// inter-component dependencies. metapackageFile is the name of the
|
||||||
// metapackage for the distribution. Only valid for a
|
// metapackage for the distribution. Only valid for a
|
||||||
// component-based install.
|
// component-based install.
|
||||||
void WriteDistributionFile(const char* metapackageFile, const char* genName);
|
void WriteDistributionFile(char const* metapackageFile, char const* genName);
|
||||||
|
|
||||||
// Subroutine of WriteDistributionFile that writes out the
|
// Subroutine of WriteDistributionFile that writes out the
|
||||||
// dependency attributes for inter-component dependencies.
|
// dependency attributes for inter-component dependencies.
|
||||||
void AddDependencyAttributes(const cmCPackComponent& component,
|
void AddDependencyAttributes(cmCPackComponent const& component,
|
||||||
std::set<const cmCPackComponent*>& visited,
|
std::set<cmCPackComponent const*>& visited,
|
||||||
std::ostringstream& out);
|
std::ostringstream& out);
|
||||||
|
|
||||||
// Subroutine of WriteDistributionFile that writes out the
|
// Subroutine of WriteDistributionFile that writes out the
|
||||||
// reverse dependency attributes for inter-component dependencies.
|
// reverse dependency attributes for inter-component dependencies.
|
||||||
void AddReverseDependencyAttributes(
|
void AddReverseDependencyAttributes(
|
||||||
const cmCPackComponent& component,
|
cmCPackComponent const& component,
|
||||||
std::set<const cmCPackComponent*>& visited, std::ostringstream& out);
|
std::set<cmCPackComponent const*>& visited, std::ostringstream& out);
|
||||||
|
|
||||||
// Generates XML that encodes the hierarchy of component groups and
|
// Generates XML that encodes the hierarchy of component groups and
|
||||||
// their components in a form that can be used by distribution
|
// their components in a form that can be used by distribution
|
||||||
// metapackages.
|
// metapackages.
|
||||||
void CreateChoiceOutline(const cmCPackComponentGroup& group,
|
void CreateChoiceOutline(cmCPackComponentGroup const& group,
|
||||||
cmXMLWriter& xout);
|
cmXMLWriter& xout);
|
||||||
|
|
||||||
/// Create the "choice" XML element to describe a component group
|
/// Create the "choice" XML element to describe a component group
|
||||||
/// for the installer GUI.
|
/// for the installer GUI.
|
||||||
void CreateChoice(const cmCPackComponentGroup& group, cmXMLWriter& xout);
|
void CreateChoice(cmCPackComponentGroup const& group, cmXMLWriter& xout);
|
||||||
|
|
||||||
/// Create the "choice" XML element to describe a component for the
|
/// Create the "choice" XML element to describe a component for the
|
||||||
/// installer GUI.
|
/// installer GUI.
|
||||||
void CreateChoice(const cmCPackComponent& component, cmXMLWriter& xout);
|
void CreateChoice(cmCPackComponent const& component, cmXMLWriter& xout);
|
||||||
|
|
||||||
/// Creates a background in the distribution XML.
|
/// Creates a background in the distribution XML.
|
||||||
void CreateBackground(const char* themeName, const char* metapackageFile,
|
void CreateBackground(char const* themeName, char const* metapackageFile,
|
||||||
cm::string_view genName, cmXMLWriter& xout);
|
cm::string_view genName, cmXMLWriter& xout);
|
||||||
|
|
||||||
/// Create the "domains" XML element to indicate where the product can
|
/// Create the "domains" XML element to indicate where the product can
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ int cmCPackProductBuildGenerator::InitializeInternal()
|
|||||||
return this->Superclass::InitializeInternal();
|
return this->Superclass::InitializeInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command)
|
bool cmCPackProductBuildGenerator::RunProductBuild(std::string const& command)
|
||||||
{
|
{
|
||||||
std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
|
std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
|
||||||
"/ProductBuildOutput.log");
|
"/ProductBuildOutput.log");
|
||||||
@@ -175,8 +175,8 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cmCPackProductBuildGenerator::GenerateComponentPackage(
|
bool cmCPackProductBuildGenerator::GenerateComponentPackage(
|
||||||
const std::string& packageFileDir, const std::string& packageFileName,
|
std::string const& packageFileDir, std::string const& packageFileName,
|
||||||
const std::string& packageDir, const cmCPackComponent* component)
|
std::string const& packageDir, cmCPackComponent const* component)
|
||||||
{
|
{
|
||||||
std::string packageFile = cmStrCat(packageFileDir, '/', packageFileName);
|
std::string packageFile = cmStrCat(packageFileDir, '/', packageFileName);
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
|
|||||||
"- Building component package: " << packageFile
|
"- Building component package: " << packageFile
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
|
|
||||||
const char* comp_name = component ? component->Name.c_str() : nullptr;
|
char const* comp_name = component ? component->Name.c_str() : nullptr;
|
||||||
|
|
||||||
cmValue preflight = this->GetComponentScript("PREFLIGHT", comp_name);
|
cmValue preflight = this->GetComponentScript("PREFLIGHT", comp_name);
|
||||||
cmValue postflight = this->GetComponentScript("POSTFLIGHT", comp_name);
|
cmValue postflight = this->GetComponentScript("POSTFLIGHT", comp_name);
|
||||||
@@ -267,7 +267,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmValue cmCPackProductBuildGenerator::GetComponentScript(
|
cmValue cmCPackProductBuildGenerator::GetComponentScript(
|
||||||
const char* script, const char* component_name)
|
char const* script, char const* component_name)
|
||||||
{
|
{
|
||||||
std::string scriptname = cmStrCat("CPACK_", script, '_');
|
std::string scriptname = cmStrCat("CPACK_", script, '_');
|
||||||
if (component_name) {
|
if (component_name) {
|
||||||
|
|||||||
@@ -30,21 +30,21 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
int InitializeInternal() override;
|
int InitializeInternal() override;
|
||||||
int PackageFiles() override;
|
int PackageFiles() override;
|
||||||
const char* GetOutputExtension() override { return ".pkg"; }
|
char const* GetOutputExtension() override { return ".pkg"; }
|
||||||
|
|
||||||
// Run ProductBuild with the given command line, which will (if
|
// Run ProductBuild with the given command line, which will (if
|
||||||
// successful) produce the given package file. Returns true if
|
// successful) produce the given package file. Returns true if
|
||||||
// ProductBuild succeeds, false otherwise.
|
// ProductBuild succeeds, false otherwise.
|
||||||
bool RunProductBuild(const std::string& command);
|
bool RunProductBuild(std::string const& command);
|
||||||
|
|
||||||
// Generate a package in the file packageFile for the given
|
// Generate a package in the file packageFile for the given
|
||||||
// component. All of the files within this component are stored in
|
// component. All of the files within this component are stored in
|
||||||
// the directory packageDir. Returns true if successful, false
|
// the directory packageDir. Returns true if successful, false
|
||||||
// otherwise.
|
// otherwise.
|
||||||
bool GenerateComponentPackage(const std::string& packageFileDir,
|
bool GenerateComponentPackage(std::string const& packageFileDir,
|
||||||
const std::string& packageFileName,
|
std::string const& packageFileName,
|
||||||
const std::string& packageDir,
|
std::string const& packageDir,
|
||||||
const cmCPackComponent* component);
|
cmCPackComponent const* component);
|
||||||
|
|
||||||
cmValue GetComponentScript(const char* script, const char* script_component);
|
cmValue GetComponentScript(char const* script, char const* script_component);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void cmCPackRPMGenerator::AddGeneratedPackageNames()
|
|||||||
{
|
{
|
||||||
// add the generated packages to package file names list
|
// add the generated packages to package file names list
|
||||||
std::string fileNames(this->GetOption("GEN_CPACK_OUTPUT_FILES"));
|
std::string fileNames(this->GetOption("GEN_CPACK_OUTPUT_FILES"));
|
||||||
const char sep = ';';
|
char const sep = ';';
|
||||||
std::string::size_type pos1 = 0;
|
std::string::size_type pos1 = 0;
|
||||||
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
|
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
|
||||||
while (pos2 != std::string::npos) {
|
while (pos2 != std::string::npos) {
|
||||||
@@ -107,7 +107,7 @@ int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackRPMGenerator::GetSanitizedDirOrFileName(
|
std::string cmCPackRPMGenerator::GetSanitizedDirOrFileName(
|
||||||
const std::string& name, bool isFullName) const
|
std::string const& name, bool isFullName) const
|
||||||
{
|
{
|
||||||
auto sanitizedName =
|
auto sanitizedName =
|
||||||
this->cmCPackGenerator::GetSanitizedDirOrFileName(name, isFullName);
|
this->cmCPackGenerator::GetSanitizedDirOrFileName(name, isFullName);
|
||||||
@@ -363,7 +363,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCPackRPMGenerator::PackageComponentsAllInOne(
|
int cmCPackRPMGenerator::PackageComponentsAllInOne(
|
||||||
const std::string& compInstDirName)
|
std::string const& compInstDirName)
|
||||||
{
|
{
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
/* Reset package file name list it will be populated during the
|
/* Reset package file name list it will be populated during the
|
||||||
@@ -445,7 +445,7 @@ bool cmCPackRPMGenerator::SupportsComponentInstallation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackRPMGenerator::GetComponentInstallSuffix(
|
std::string cmCPackRPMGenerator::GetComponentInstallSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
|
if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
|
||||||
return componentName;
|
return componentName;
|
||||||
@@ -465,7 +465,7 @@ std::string cmCPackRPMGenerator::GetComponentInstallSuffix(
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
|
std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName)
|
std::string const& componentName)
|
||||||
{
|
{
|
||||||
return this->GetSanitizedDirOrFileName(
|
return this->GetSanitizedDirOrFileName(
|
||||||
this->GetComponentInstallSuffix(componentName));
|
this->GetComponentInstallSuffix(componentName));
|
||||||
|
|||||||
@@ -59,15 +59,15 @@ protected:
|
|||||||
* Special case of component install where all
|
* Special case of component install where all
|
||||||
* components will be put in a single installer.
|
* components will be put in a single installer.
|
||||||
*/
|
*/
|
||||||
int PackageComponentsAllInOne(const std::string& compInstDirName);
|
int PackageComponentsAllInOne(std::string const& compInstDirName);
|
||||||
const char* GetOutputExtension() override { return ".rpm"; }
|
char const* GetOutputExtension() override { return ".rpm"; }
|
||||||
std::string GetSanitizedDirOrFileName(const std::string& name,
|
std::string GetSanitizedDirOrFileName(std::string const& name,
|
||||||
bool isFullName = true) const override;
|
bool isFullName = true) const override;
|
||||||
bool SupportsComponentInstallation() const override;
|
bool SupportsComponentInstallation() const override;
|
||||||
std::string GetComponentInstallSuffix(
|
std::string GetComponentInstallSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
std::string GetComponentInstallDirNameSuffix(
|
std::string GetComponentInstallDirNameSuffix(
|
||||||
const std::string& componentName) override;
|
std::string const& componentName) override;
|
||||||
|
|
||||||
void AddGeneratedPackageNames();
|
void AddGeneratedPackageNames();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
|
|||||||
}
|
}
|
||||||
this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", licenseText);
|
this->SetOptionIfNotSet("CPACK_RESOURCE_FILE_LICENSE_CONTENT", licenseText);
|
||||||
|
|
||||||
const char headerLengthTag[] = "###CPACK_HEADER_LENGTH###";
|
char const headerLengthTag[] = "###CPACK_HEADER_LENGTH###";
|
||||||
|
|
||||||
// Create the header
|
// Create the header
|
||||||
std::string inFile = this->GetOption("CPACK_STGZ_HEADER_FILE");
|
std::string inFile = this->GetOption("CPACK_STGZ_HEADER_FILE");
|
||||||
@@ -96,7 +96,7 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
|
|||||||
this->ConfigureString(packageHeaderText, res);
|
this->ConfigureString(packageHeaderText, res);
|
||||||
|
|
||||||
// Count the lines
|
// Count the lines
|
||||||
const char* ptr = res.c_str();
|
char const* ptr = res.c_str();
|
||||||
while (*ptr) {
|
while (*ptr) {
|
||||||
if (*ptr == '\n') {
|
if (*ptr == '\n') {
|
||||||
counter++;
|
counter++;
|
||||||
|
|||||||
@@ -39,14 +39,14 @@
|
|||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const cmDocumentationEntry cmDocumentationName = {
|
cmDocumentationEntry const cmDocumentationName = {
|
||||||
{},
|
{},
|
||||||
" cpack - Packaging driver provided by CMake."
|
" cpack - Packaging driver provided by CMake."
|
||||||
};
|
};
|
||||||
|
|
||||||
const cmDocumentationEntry cmDocumentationUsage = { {}, " cpack [options]" };
|
cmDocumentationEntry const cmDocumentationUsage = { {}, " cpack [options]" };
|
||||||
|
|
||||||
const cmDocumentationEntry cmDocumentationOptions[14] = {
|
cmDocumentationEntry const cmDocumentationOptions[14] = {
|
||||||
{ "-G <generators>", "Override/define CPACK_GENERATOR" },
|
{ "-G <generators>", "Override/define CPACK_GENERATOR" },
|
||||||
{ "-C <Configuration>", "Specify the project configuration" },
|
{ "-C <Configuration>", "Specify the project configuration" },
|
||||||
{ "-D <var>=<value>", "Set a CPack variable." },
|
{ "-D <var>=<value>", "Set a CPack variable." },
|
||||||
@@ -63,22 +63,22 @@ const cmDocumentationEntry cmDocumentationOptions[14] = {
|
|||||||
{ "--list-presets", "List available package presets" }
|
{ "--list-presets", "List available package presets" }
|
||||||
};
|
};
|
||||||
|
|
||||||
void cpackProgressCallback(const std::string& message, float /*unused*/)
|
void cpackProgressCallback(std::string const& message, float /*unused*/)
|
||||||
{
|
{
|
||||||
std::cout << "-- " << message << '\n';
|
std::cout << "-- " << message << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<cmDocumentationEntry> makeGeneratorDocs(
|
std::vector<cmDocumentationEntry> makeGeneratorDocs(
|
||||||
const cmCPackGeneratorFactory& gf)
|
cmCPackGeneratorFactory const& gf)
|
||||||
{
|
{
|
||||||
const auto& generators = gf.GetGeneratorsList();
|
auto const& generators = gf.GetGeneratorsList();
|
||||||
|
|
||||||
std::vector<cmDocumentationEntry> docs;
|
std::vector<cmDocumentationEntry> docs;
|
||||||
docs.reserve(generators.size());
|
docs.reserve(generators.size());
|
||||||
|
|
||||||
std::transform(
|
std::transform(
|
||||||
generators.cbegin(), generators.cend(), std::back_inserter(docs),
|
generators.cbegin(), generators.cend(), std::back_inserter(docs),
|
||||||
[](const std::decay<decltype(generators)>::type::value_type& gen) {
|
[](std::decay<decltype(generators)>::type::value_type const& gen) {
|
||||||
return cmDocumentationEntry{ gen.first, gen.second };
|
return cmDocumentationEntry{ gen.first, gen.second };
|
||||||
});
|
});
|
||||||
return docs;
|
return docs;
|
||||||
@@ -139,27 +139,27 @@ int main(int argc, char const* const* argv)
|
|||||||
|
|
||||||
std::map<std::string, std::string> definitions;
|
std::map<std::string, std::string> definitions;
|
||||||
|
|
||||||
auto const verboseLambda = [&log](const std::string&, cmake*,
|
auto const verboseLambda = [&log](std::string const&, cmake*,
|
||||||
cmMakefile*) -> bool {
|
cmMakefile*) -> bool {
|
||||||
log.SetVerbose(true);
|
log.SetVerbose(true);
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbose\n");
|
cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Verbose\n");
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto const debugLambda = [&log](const std::string&, cmake*,
|
auto const debugLambda = [&log](std::string const&, cmake*,
|
||||||
cmMakefile*) -> bool {
|
cmMakefile*) -> bool {
|
||||||
log.SetDebug(true);
|
log.SetDebug(true);
|
||||||
cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Debug\n");
|
cmCPack_Log(&log, cmCPackLog::LOG_OUTPUT, "Enable Debug\n");
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto const traceLambda = [](const std::string&, cmake* state,
|
auto const traceLambda = [](std::string const&, cmake* state,
|
||||||
cmMakefile*) -> bool {
|
cmMakefile*) -> bool {
|
||||||
state->SetTrace(true);
|
state->SetTrace(true);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto const traceExpandLambda = [](const std::string&, cmake* state,
|
auto const traceExpandLambda = [](std::string const&, cmake* state,
|
||||||
cmMakefile*) -> bool {
|
cmMakefile*) -> bool {
|
||||||
state->SetTrace(true);
|
state->SetTrace(true);
|
||||||
state->SetTraceExpand(true);
|
state->SetTraceExpand(true);
|
||||||
@@ -209,7 +209,7 @@ int main(int argc, char const* const* argv)
|
|||||||
CommandArgument::setToTrue(listPresets) },
|
CommandArgument::setToTrue(listPresets) },
|
||||||
CommandArgument{ "-D", CommandArgument::Values::One,
|
CommandArgument{ "-D", CommandArgument::Values::One,
|
||||||
CommandArgument::RequiresSeparator::No,
|
CommandArgument::RequiresSeparator::No,
|
||||||
[&log, &definitions](const std::string& arg, cmake*,
|
[&log, &definitions](std::string const& arg, cmake*,
|
||||||
cmMakefile*) -> bool {
|
cmMakefile*) -> bool {
|
||||||
std::string value = arg;
|
std::string value = arg;
|
||||||
size_t pos = value.find_first_of('=');
|
size_t pos = value.find_first_of('=');
|
||||||
@@ -255,12 +255,12 @@ int main(int argc, char const* const* argv)
|
|||||||
|
|
||||||
// Set up presets
|
// Set up presets
|
||||||
if (!preset.empty() || listPresets) {
|
if (!preset.empty() || listPresets) {
|
||||||
const auto workingDirectory = cmSystemTools::GetLogicalWorkingDirectory();
|
auto const workingDirectory = cmSystemTools::GetLogicalWorkingDirectory();
|
||||||
|
|
||||||
auto const presetGeneratorsPresent =
|
auto const presetGeneratorsPresent =
|
||||||
[&generators](const cmCMakePresetsGraph::PackagePreset& p) {
|
[&generators](cmCMakePresetsGraph::PackagePreset const& p) {
|
||||||
return std::all_of(p.Generators.begin(), p.Generators.end(),
|
return std::all_of(p.Generators.begin(), p.Generators.end(),
|
||||||
[&generators](const std::string& gen) {
|
[&generators](std::string const& gen) {
|
||||||
return generators.GetGeneratorsList().count(
|
return generators.GetGeneratorsList().count(
|
||||||
gen) != 0;
|
gen) != 0;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
#include "cmXMLParser.h"
|
#include "cmXMLParser.h"
|
||||||
|
|
||||||
static int cmBZRXMLParserUnknownEncodingHandler(void* /*unused*/,
|
static int cmBZRXMLParserUnknownEncodingHandler(void* /*unused*/,
|
||||||
const XML_Char* name,
|
XML_Char const* name,
|
||||||
XML_Encoding* info)
|
XML_Encoding* info)
|
||||||
{
|
{
|
||||||
static const int latin1[] = {
|
static int const latin1[] = {
|
||||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
|
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
|
||||||
0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011,
|
0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011,
|
||||||
0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A,
|
0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A,
|
||||||
@@ -86,7 +86,7 @@ cmCTestBZR::~cmCTestBZR() = default;
|
|||||||
class cmCTestBZR::InfoParser : public cmCTestVC::LineParser
|
class cmCTestBZR::InfoParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InfoParser(cmCTestBZR* bzr, const char* prefix)
|
InfoParser(cmCTestBZR* bzr, char const* prefix)
|
||||||
: BZR(bzr)
|
: BZR(bzr)
|
||||||
{
|
{
|
||||||
this->SetLog(&bzr->Log, prefix);
|
this->SetLog(&bzr->Log, prefix);
|
||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
class cmCTestBZR::RevnoParser : public cmCTestVC::LineParser
|
class cmCTestBZR::RevnoParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RevnoParser(cmCTestBZR* bzr, const char* prefix, std::string& rev)
|
RevnoParser(cmCTestBZR* bzr, char const* prefix, std::string& rev)
|
||||||
: Rev(rev)
|
: Rev(rev)
|
||||||
{
|
{
|
||||||
this->SetLog(&bzr->Log, prefix);
|
this->SetLog(&bzr->Log, prefix);
|
||||||
@@ -179,7 +179,7 @@ class cmCTestBZR::LogParser
|
|||||||
, private cmXMLParser
|
, private cmXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LogParser(cmCTestBZR* bzr, const char* prefix)
|
LogParser(cmCTestBZR* bzr, char const* prefix)
|
||||||
: OutputLogger(bzr->Log, prefix)
|
: OutputLogger(bzr->Log, prefix)
|
||||||
, BZR(bzr)
|
, BZR(bzr)
|
||||||
, EmailRegex("(.*) <([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+)>")
|
, EmailRegex("(.*) <([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+)>")
|
||||||
@@ -211,14 +211,14 @@ private:
|
|||||||
|
|
||||||
cmsys::RegularExpression EmailRegex;
|
cmsys::RegularExpression EmailRegex;
|
||||||
|
|
||||||
bool ProcessChunk(const char* data, int length) override
|
bool ProcessChunk(char const* data, int length) override
|
||||||
{
|
{
|
||||||
this->OutputLogger::ProcessChunk(data, length);
|
this->OutputLogger::ProcessChunk(data, length);
|
||||||
this->ParseChunk(data, length);
|
this->ParseChunk(data, length);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartElement(const std::string& name, const char** /*atts*/) override
|
void StartElement(std::string const& name, char const** /*atts*/) override
|
||||||
{
|
{
|
||||||
this->CData.clear();
|
this->CData.clear();
|
||||||
if (name == "log") {
|
if (name == "log") {
|
||||||
@@ -243,12 +243,12 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterDataHandler(const char* data, int length) override
|
void CharacterDataHandler(char const* data, int length) override
|
||||||
{
|
{
|
||||||
cm::append(this->CData, data, data + length);
|
cm::append(this->CData, data, data + length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndElement(const std::string& name) override
|
void EndElement(std::string const& name) override
|
||||||
{
|
{
|
||||||
if (name == "log") {
|
if (name == "log") {
|
||||||
this->BZR->DoRevision(this->Rev, this->Changes);
|
this->BZR->DoRevision(this->Rev, this->Changes);
|
||||||
@@ -278,7 +278,7 @@ private:
|
|||||||
this->CData.clear();
|
this->CData.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportError(int /*line*/, int /*column*/, const char* msg) override
|
void ReportError(int /*line*/, int /*column*/, char const* msg) override
|
||||||
{
|
{
|
||||||
this->BZR->Log << "Error parsing bzr log xml: " << msg << "\n";
|
this->BZR->Log << "Error parsing bzr log xml: " << msg << "\n";
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ private:
|
|||||||
class cmCTestBZR::UpdateParser : public cmCTestVC::LineParser
|
class cmCTestBZR::UpdateParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UpdateParser(cmCTestBZR* bzr, const char* prefix)
|
UpdateParser(cmCTestBZR* bzr, char const* prefix)
|
||||||
: BZR(bzr)
|
: BZR(bzr)
|
||||||
{
|
{
|
||||||
this->SetLog(&bzr->Log, prefix);
|
this->SetLog(&bzr->Log, prefix);
|
||||||
@@ -298,12 +298,12 @@ private:
|
|||||||
cmCTestBZR* BZR;
|
cmCTestBZR* BZR;
|
||||||
cmsys::RegularExpression RegexUpdate;
|
cmsys::RegularExpression RegexUpdate;
|
||||||
|
|
||||||
bool ProcessChunk(const char* first, int length) override
|
bool ProcessChunk(char const* first, int length) override
|
||||||
{
|
{
|
||||||
bool last_is_new_line = (*first == '\r' || *first == '\n');
|
bool last_is_new_line = (*first == '\r' || *first == '\n');
|
||||||
|
|
||||||
const char* const last = first + length;
|
char const* const last = first + length;
|
||||||
for (const char* c = first; c != last; ++c) {
|
for (char const* c = first; c != last; ++c) {
|
||||||
if (*c == '\r' || *c == '\n') {
|
if (*c == '\r' || *c == '\n') {
|
||||||
if (!last_is_new_line) {
|
if (!last_is_new_line) {
|
||||||
// Log this line.
|
// Log this line.
|
||||||
@@ -346,8 +346,8 @@ private:
|
|||||||
}
|
}
|
||||||
cmSystemTools::ConvertToUnixSlashes(path);
|
cmSystemTools::ConvertToUnixSlashes(path);
|
||||||
|
|
||||||
const std::string dir = cmSystemTools::GetFilenamePath(path);
|
std::string const dir = cmSystemTools::GetFilenamePath(path);
|
||||||
const std::string name = cmSystemTools::GetFilenameName(path);
|
std::string const name = cmSystemTools::GetFilenameName(path);
|
||||||
|
|
||||||
if (c0 == 'C') {
|
if (c0 == 'C') {
|
||||||
this->BZR->Dirs[dir][name].Status = PathConflicting;
|
this->BZR->Dirs[dir][name].Status = PathConflicting;
|
||||||
@@ -420,7 +420,7 @@ bool cmCTestBZR::LoadRevisions()
|
|||||||
class cmCTestBZR::StatusParser : public cmCTestVC::LineParser
|
class cmCTestBZR::StatusParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StatusParser(cmCTestBZR* bzr, const char* prefix)
|
StatusParser(cmCTestBZR* bzr, char const* prefix)
|
||||||
: BZR(bzr)
|
: BZR(bzr)
|
||||||
{
|
{
|
||||||
this->SetLog(&bzr->Log, prefix);
|
this->SetLog(&bzr->Log, prefix);
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
bool cmCTestBinPackerAllocation::operator==(
|
bool cmCTestBinPackerAllocation::operator==(
|
||||||
const cmCTestBinPackerAllocation& other) const
|
cmCTestBinPackerAllocation const& other) const
|
||||||
{
|
{
|
||||||
return this->ProcessIndex == other.ProcessIndex &&
|
return this->ProcessIndex == other.ProcessIndex &&
|
||||||
this->SlotsNeeded == other.SlotsNeeded && this->Id == other.Id;
|
this->SlotsNeeded == other.SlotsNeeded && this->Id == other.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTestBinPackerAllocation::operator!=(
|
bool cmCTestBinPackerAllocation::operator!=(
|
||||||
const cmCTestBinPackerAllocation& other) const
|
cmCTestBinPackerAllocation const& other) const
|
||||||
{
|
{
|
||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
@@ -35,8 +35,8 @@ namespace {
|
|||||||
*/
|
*/
|
||||||
template <typename AllocationStrategy>
|
template <typename AllocationStrategy>
|
||||||
bool AllocateCTestResources(
|
bool AllocateCTestResources(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
const std::vector<std::string>& resourcesSorted, std::size_t currentIndex,
|
std::vector<std::string> const& resourcesSorted, std::size_t currentIndex,
|
||||||
std::vector<cmCTestBinPackerAllocation*>& allocations)
|
std::vector<cmCTestBinPackerAllocation*>& allocations)
|
||||||
{
|
{
|
||||||
// Iterate through all large enough resources until we find a solution
|
// Iterate through all large enough resources until we find a solution
|
||||||
@@ -83,7 +83,7 @@ bool AllocateCTestResources(
|
|||||||
|
|
||||||
template <typename AllocationStrategy>
|
template <typename AllocationStrategy>
|
||||||
bool AllocateCTestResources(
|
bool AllocateCTestResources(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<cmCTestBinPackerAllocation>& allocations)
|
std::vector<cmCTestBinPackerAllocation>& allocations)
|
||||||
{
|
{
|
||||||
// Sort the resource requirements in descending order by slots needed
|
// Sort the resource requirements in descending order by slots needed
|
||||||
@@ -115,27 +115,27 @@ class RoundRobinAllocationStrategy
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void InitialSort(
|
static void InitialSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted);
|
std::vector<std::string>& resourcesSorted);
|
||||||
|
|
||||||
static void IncrementalSort(
|
static void IncrementalSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex);
|
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
void RoundRobinAllocationStrategy::InitialSort(
|
void RoundRobinAllocationStrategy::InitialSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted)
|
std::vector<std::string>& resourcesSorted)
|
||||||
{
|
{
|
||||||
std::stable_sort(
|
std::stable_sort(
|
||||||
resourcesSorted.rbegin(), resourcesSorted.rend(),
|
resourcesSorted.rbegin(), resourcesSorted.rend(),
|
||||||
[&resources](const std::string& id1, const std::string& id2) {
|
[&resources](std::string const& id1, std::string const& id2) {
|
||||||
return resources.at(id1).Free() < resources.at(id2).Free();
|
return resources.at(id1).Free() < resources.at(id2).Free();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundRobinAllocationStrategy::IncrementalSort(
|
void RoundRobinAllocationStrategy::IncrementalSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex)
|
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex)
|
||||||
{
|
{
|
||||||
auto tmp = resourcesSorted[lastAllocatedIndex];
|
auto tmp = resourcesSorted[lastAllocatedIndex];
|
||||||
@@ -153,27 +153,27 @@ class BlockAllocationStrategy
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void InitialSort(
|
static void InitialSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted);
|
std::vector<std::string>& resourcesSorted);
|
||||||
|
|
||||||
static void IncrementalSort(
|
static void IncrementalSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex);
|
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
void BlockAllocationStrategy::InitialSort(
|
void BlockAllocationStrategy::InitialSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<std::string>& resourcesSorted)
|
std::vector<std::string>& resourcesSorted)
|
||||||
{
|
{
|
||||||
std::stable_sort(
|
std::stable_sort(
|
||||||
resourcesSorted.rbegin(), resourcesSorted.rend(),
|
resourcesSorted.rbegin(), resourcesSorted.rend(),
|
||||||
[&resources](const std::string& id1, const std::string& id2) {
|
[&resources](std::string const& id1, std::string const& id2) {
|
||||||
return resources.at(id1).Free() < resources.at(id2).Free();
|
return resources.at(id1).Free() < resources.at(id2).Free();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAllocationStrategy::IncrementalSort(
|
void BlockAllocationStrategy::IncrementalSort(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>&,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const&,
|
||||||
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex)
|
std::vector<std::string>& resourcesSorted, std::size_t lastAllocatedIndex)
|
||||||
{
|
{
|
||||||
auto tmp = resourcesSorted[lastAllocatedIndex];
|
auto tmp = resourcesSorted[lastAllocatedIndex];
|
||||||
@@ -187,7 +187,7 @@ void BlockAllocationStrategy::IncrementalSort(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cmAllocateCTestResourcesRoundRobin(
|
bool cmAllocateCTestResourcesRoundRobin(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<cmCTestBinPackerAllocation>& allocations)
|
std::vector<cmCTestBinPackerAllocation>& allocations)
|
||||||
{
|
{
|
||||||
return AllocateCTestResources<RoundRobinAllocationStrategy>(resources,
|
return AllocateCTestResources<RoundRobinAllocationStrategy>(resources,
|
||||||
@@ -195,7 +195,7 @@ bool cmAllocateCTestResourcesRoundRobin(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool cmAllocateCTestResourcesBlock(
|
bool cmAllocateCTestResourcesBlock(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<cmCTestBinPackerAllocation>& allocations)
|
std::vector<cmCTestBinPackerAllocation>& allocations)
|
||||||
{
|
{
|
||||||
return AllocateCTestResources<BlockAllocationStrategy>(resources,
|
return AllocateCTestResources<BlockAllocationStrategy>(resources,
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ struct cmCTestBinPackerAllocation
|
|||||||
int SlotsNeeded;
|
int SlotsNeeded;
|
||||||
std::string Id;
|
std::string Id;
|
||||||
|
|
||||||
bool operator==(const cmCTestBinPackerAllocation& other) const;
|
bool operator==(cmCTestBinPackerAllocation const& other) const;
|
||||||
bool operator!=(const cmCTestBinPackerAllocation& other) const;
|
bool operator!=(cmCTestBinPackerAllocation const& other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool cmAllocateCTestResourcesRoundRobin(
|
bool cmAllocateCTestResourcesRoundRobin(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<cmCTestBinPackerAllocation>& allocations);
|
std::vector<cmCTestBinPackerAllocation>& allocations);
|
||||||
|
|
||||||
bool cmAllocateCTestResourcesBlock(
|
bool cmAllocateCTestResourcesBlock(
|
||||||
const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
|
std::map<std::string, cmCTestResourceAllocator::Resource> const& resources,
|
||||||
std::vector<cmCTestBinPackerAllocation>& allocations);
|
std::vector<cmCTestBinPackerAllocation>& allocations);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ bool cmCTestBuildAndTest::RunCMake(cmake* cm)
|
|||||||
args.push_back("-T" + this->BuildGeneratorToolset);
|
args.push_back("-T" + this->BuildGeneratorToolset);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* config = nullptr;
|
char const* config = nullptr;
|
||||||
if (!this->CTest->GetConfigType().empty()) {
|
if (!this->CTest->GetConfigType().empty()) {
|
||||||
config = this->CTest->GetConfigType().c_str();
|
config = this->CTest->GetConfigType().c_str();
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ public:
|
|||||||
: CM(cm)
|
: CM(cm)
|
||||||
{
|
{
|
||||||
cmSystemTools::SetMessageCallback(
|
cmSystemTools::SetMessageCallback(
|
||||||
[](const std::string& msg, const cmMessageMetadata& /* unused */) {
|
[](std::string const& msg, cmMessageMetadata const& /* unused */) {
|
||||||
std::cout << msg << std::endl;
|
std::cout << msg << std::endl;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ public:
|
|||||||
cmSystemTools::SetStderrCallback(
|
cmSystemTools::SetStderrCallback(
|
||||||
[](std::string const& m) { std::cout << m << std::flush; });
|
[](std::string const& m) { std::cout << m << std::flush; });
|
||||||
|
|
||||||
this->CM.SetProgressCallback([](const std::string& msg, float prog) {
|
this->CM.SetProgressCallback([](std::string const& msg, float prog) {
|
||||||
if (prog < 0) {
|
if (prog < 0) {
|
||||||
std::cout << msg << std::endl;
|
std::cout << msg << std::endl;
|
||||||
}
|
}
|
||||||
@@ -160,10 +160,10 @@ public:
|
|||||||
cmSystemTools::SetMessageCallback(nullptr);
|
cmSystemTools::SetMessageCallback(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCTestBuildAndTestCaptureRAII(const cmCTestBuildAndTestCaptureRAII&) =
|
cmCTestBuildAndTestCaptureRAII(cmCTestBuildAndTestCaptureRAII const&) =
|
||||||
delete;
|
delete;
|
||||||
cmCTestBuildAndTestCaptureRAII& operator=(
|
cmCTestBuildAndTestCaptureRAII& operator=(
|
||||||
const cmCTestBuildAndTestCaptureRAII&) = delete;
|
cmCTestBuildAndTestCaptureRAII const&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
int cmCTestBuildAndTest::Run()
|
int cmCTestBuildAndTest::Run()
|
||||||
@@ -247,7 +247,7 @@ int cmCTestBuildAndTest::Run()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const char* config = nullptr;
|
char const* config = nullptr;
|
||||||
if (!this->CTest->GetConfigType().empty()) {
|
if (!this->CTest->GetConfigType().empty()) {
|
||||||
config = this->CTest->GetConfigType().c_str();
|
config = this->CTest->GetConfigType().c_str();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ std::unique_ptr<cmCTestGenericHandler> cmCTestBuildCommand::InitializeHandler(
|
|||||||
: cmNonempty(ctestBuildConfiguration) ? *ctestBuildConfiguration
|
: cmNonempty(ctestBuildConfiguration) ? *ctestBuildConfiguration
|
||||||
: this->CTest->GetConfigType();
|
: this->CTest->GetConfigType();
|
||||||
|
|
||||||
const std::string& cmakeBuildAdditionalFlags = cmNonempty(args.Flags)
|
std::string const& cmakeBuildAdditionalFlags = cmNonempty(args.Flags)
|
||||||
? args.Flags
|
? args.Flags
|
||||||
: mf.GetSafeDefinition("CTEST_BUILD_FLAGS");
|
: mf.GetSafeDefinition("CTEST_BUILD_FLAGS");
|
||||||
const std::string& cmakeBuildTarget = cmNonempty(args.Target)
|
std::string const& cmakeBuildTarget = cmNonempty(args.Target)
|
||||||
? args.Target
|
? args.Target
|
||||||
: mf.GetSafeDefinition("CTEST_BUILD_TARGET");
|
: mf.GetSafeDefinition("CTEST_BUILD_TARGET");
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "cmValue.h"
|
#include "cmValue.h"
|
||||||
#include "cmXMLWriter.h"
|
#include "cmXMLWriter.h"
|
||||||
|
|
||||||
static const char* cmCTestErrorMatches[] = {
|
static char const* cmCTestErrorMatches[] = {
|
||||||
"^[Bb]us [Ee]rror", // noqa: spellcheck disable-line
|
"^[Bb]us [Ee]rror", // noqa: spellcheck disable-line
|
||||||
"^[Ss]egmentation [Vv]iolation",
|
"^[Ss]egmentation [Vv]iolation",
|
||||||
"^[Ss]egmentation [Ff]ault",
|
"^[Ss]egmentation [Ff]ault",
|
||||||
@@ -93,7 +93,7 @@ static const char* cmCTestErrorMatches[] = {
|
|||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* cmCTestErrorExceptions[] = {
|
static char const* cmCTestErrorExceptions[] = {
|
||||||
"instantiated from ",
|
"instantiated from ",
|
||||||
"candidates are:",
|
"candidates are:",
|
||||||
": warning",
|
": warning",
|
||||||
@@ -109,7 +109,7 @@ static const char* cmCTestErrorExceptions[] = {
|
|||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* cmCTestWarningMatches[] = {
|
static char const* cmCTestWarningMatches[] = {
|
||||||
"([^ :]+):([0-9]+): warning:",
|
"([^ :]+):([0-9]+): warning:",
|
||||||
"([^ :]+):([0-9]+): note:",
|
"([^ :]+):([0-9]+): note:",
|
||||||
"^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
|
"^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
|
||||||
@@ -135,7 +135,7 @@ static const char* cmCTestWarningMatches[] = {
|
|||||||
nullptr
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* cmCTestWarningExceptions[] = {
|
static char const* cmCTestWarningExceptions[] = {
|
||||||
R"(/usr/.*/X11/Xlib\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
R"(/usr/.*/X11/Xlib\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
||||||
R"(/usr/.*/X11/Xutil\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
R"(/usr/.*/X11/Xutil\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
||||||
R"(/usr/.*/X11/XResource\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
R"(/usr/.*/X11/XResource\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
|
||||||
@@ -157,7 +157,7 @@ static const char* cmCTestWarningExceptions[] = {
|
|||||||
|
|
||||||
struct cmCTestBuildCompileErrorWarningRex
|
struct cmCTestBuildCompileErrorWarningRex
|
||||||
{
|
{
|
||||||
const char* RegularExpressionString;
|
char const* RegularExpressionString;
|
||||||
int FileIndex;
|
int FileIndex;
|
||||||
int LineIndex;
|
int LineIndex;
|
||||||
};
|
};
|
||||||
@@ -281,7 +281,7 @@ int cmCTestBuildHandler::ProcessHandler()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& buildDirectory =
|
std::string const& buildDirectory =
|
||||||
this->CTest->GetCTestConfiguration("BuildDirectory");
|
this->CTest->GetCTestConfiguration("BuildDirectory");
|
||||||
if (buildDirectory.empty()) {
|
if (buildDirectory.empty()) {
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||||
@@ -501,7 +501,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
|
|||||||
launchDir.Load(this->CTestLaunchDir);
|
launchDir.Load(this->CTestLaunchDir);
|
||||||
unsigned long n = launchDir.GetNumberOfFiles();
|
unsigned long n = launchDir.GetNumberOfFiles();
|
||||||
for (unsigned long i = 0; i < n; ++i) {
|
for (unsigned long i = 0; i < n; ++i) {
|
||||||
const char* fname = launchDir.GetFile(i);
|
char const* fname = launchDir.GetFile(i);
|
||||||
if (this->IsLaunchedErrorFile(fname) && numErrorsAllowed) {
|
if (this->IsLaunchedErrorFile(fname) && numErrorsAllowed) {
|
||||||
numErrorsAllowed--;
|
numErrorsAllowed--;
|
||||||
fragments.insert(this->CTestLaunchDir + '/' + fname);
|
fragments.insert(this->CTestLaunchDir + '/' + fname);
|
||||||
@@ -611,14 +611,14 @@ void cmCTestBuildHandler::GenerateXMLFooter(cmXMLWriter& xml,
|
|||||||
this->CTest->EndXML(xml);
|
this->CTest->EndXML(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTestBuildHandler::IsLaunchedErrorFile(const char* fname)
|
bool cmCTestBuildHandler::IsLaunchedErrorFile(char const* fname)
|
||||||
{
|
{
|
||||||
// error-{hash}.xml
|
// error-{hash}.xml
|
||||||
return (cmHasLiteralPrefix(fname, "error-") &&
|
return (cmHasLiteralPrefix(fname, "error-") &&
|
||||||
cmHasLiteralSuffix(fname, ".xml"));
|
cmHasLiteralSuffix(fname, ".xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTestBuildHandler::IsLaunchedWarningFile(const char* fname)
|
bool cmCTestBuildHandler::IsLaunchedWarningFile(char const* fname)
|
||||||
{
|
{
|
||||||
// warning-{hash}.xml
|
// warning-{hash}.xml
|
||||||
return (cmHasLiteralPrefix(fname, "warning-") &&
|
return (cmHasLiteralPrefix(fname, "warning-") &&
|
||||||
@@ -635,15 +635,15 @@ class cmCTestBuildHandler::LaunchHelper
|
|||||||
public:
|
public:
|
||||||
LaunchHelper(cmCTestBuildHandler* handler);
|
LaunchHelper(cmCTestBuildHandler* handler);
|
||||||
~LaunchHelper();
|
~LaunchHelper();
|
||||||
LaunchHelper(const LaunchHelper&) = delete;
|
LaunchHelper(LaunchHelper const&) = delete;
|
||||||
LaunchHelper& operator=(const LaunchHelper&) = delete;
|
LaunchHelper& operator=(LaunchHelper const&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cmCTestBuildHandler* Handler;
|
cmCTestBuildHandler* Handler;
|
||||||
cmCTest* CTest;
|
cmCTest* CTest;
|
||||||
|
|
||||||
void WriteLauncherConfig();
|
void WriteLauncherConfig();
|
||||||
void WriteScrapeMatchers(const char* purpose,
|
void WriteScrapeMatchers(char const* purpose,
|
||||||
std::vector<std::string> const& matchers);
|
std::vector<std::string> const& matchers);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ void cmCTestBuildHandler::LaunchHelper::WriteLauncherConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
|
void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
|
||||||
const char* purpose, std::vector<std::string> const& matchers)
|
char const* purpose, std::vector<std::string> const& matchers)
|
||||||
{
|
{
|
||||||
if (matchers.empty()) {
|
if (matchers.empty()) {
|
||||||
return;
|
return;
|
||||||
@@ -716,8 +716,8 @@ void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTestBuildHandler::RunMakeCommand(const std::string& command,
|
bool cmCTestBuildHandler::RunMakeCommand(std::string const& command,
|
||||||
int* retVal, const char* dir,
|
int* retVal, char const* dir,
|
||||||
int timeout, std::ostream& ofs,
|
int timeout, std::ostream& ofs,
|
||||||
Encoding encoding)
|
Encoding encoding)
|
||||||
{
|
{
|
||||||
@@ -869,7 +869,7 @@ bool cmCTestBuildHandler::RunMakeCommand(const std::string& command,
|
|||||||
launchDir.Load(this->CTestLaunchDir);
|
launchDir.Load(this->CTestLaunchDir);
|
||||||
unsigned long n = launchDir.GetNumberOfFiles();
|
unsigned long n = launchDir.GetNumberOfFiles();
|
||||||
for (unsigned long i = 0; i < n; ++i) {
|
for (unsigned long i = 0; i < n; ++i) {
|
||||||
const char* fname = launchDir.GetFile(i);
|
char const* fname = launchDir.GetFile(i);
|
||||||
if (cmHasLiteralSuffix(fname, ".xml")) {
|
if (cmHasLiteralSuffix(fname, ".xml")) {
|
||||||
launcherXMLFound = true;
|
launcherXMLFound = true;
|
||||||
break;
|
break;
|
||||||
@@ -940,13 +940,13 @@ bool cmCTestBuildHandler::RunMakeCommand(const std::string& command,
|
|||||||
// ######################################################################
|
// ######################################################################
|
||||||
// ######################################################################
|
// ######################################################################
|
||||||
|
|
||||||
void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
|
void cmCTestBuildHandler::ProcessBuffer(char const* data, size_t length,
|
||||||
size_t& tick, size_t tick_len,
|
size_t& tick, size_t tick_len,
|
||||||
std::ostream& ofs,
|
std::ostream& ofs,
|
||||||
t_BuildProcessingQueueType* queue)
|
t_BuildProcessingQueueType* queue)
|
||||||
{
|
{
|
||||||
const std::string::size_type tick_line_len = 50;
|
std::string::size_type const tick_line_len = 50;
|
||||||
const char* ptr;
|
char const* ptr;
|
||||||
for (ptr = data; ptr < data + length; ptr++) {
|
for (ptr = data; ptr < data + length; ptr++) {
|
||||||
queue->push_back(*ptr);
|
queue->push_back(*ptr);
|
||||||
}
|
}
|
||||||
@@ -977,7 +977,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
|
|||||||
this->CurrentProcessingLine.clear();
|
this->CurrentProcessingLine.clear();
|
||||||
cm::append(this->CurrentProcessingLine, queue->begin(), it);
|
cm::append(this->CurrentProcessingLine, queue->begin(), it);
|
||||||
this->CurrentProcessingLine.push_back(0);
|
this->CurrentProcessingLine.push_back(0);
|
||||||
const char* line = this->CurrentProcessingLine.data();
|
char const* line = this->CurrentProcessingLine.data();
|
||||||
|
|
||||||
// Process the line
|
// Process the line
|
||||||
int lineType = this->ProcessSingleLine(line);
|
int lineType = this->ProcessSingleLine(line);
|
||||||
@@ -1074,7 +1074,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
|
|||||||
ofs << cm::string_view(data, length);
|
ofs << cm::string_view(data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCTestBuildHandler::ProcessSingleLine(const char* data)
|
int cmCTestBuildHandler::ProcessSingleLine(char const* data)
|
||||||
{
|
{
|
||||||
if (this->UseCTestLaunch) {
|
if (this->UseCTestLaunch) {
|
||||||
// No log scraping when using launchers.
|
// No log scraping when using launchers.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ private:
|
|||||||
|
|
||||||
//! Run command specialized for make and configure. Returns process status
|
//! Run command specialized for make and configure. Returns process status
|
||||||
// and retVal is return value or exception.
|
// and retVal is return value or exception.
|
||||||
bool RunMakeCommand(const std::string& command, int* retVal, const char* dir,
|
bool RunMakeCommand(std::string const& command, int* retVal, char const* dir,
|
||||||
int timeout, std::ostream& ofs,
|
int timeout, std::ostream& ofs,
|
||||||
Encoding encoding = cmProcessOutput::Auto);
|
Encoding encoding = cmProcessOutput::Auto);
|
||||||
|
|
||||||
@@ -86,8 +86,8 @@ private:
|
|||||||
void GenerateXMLLaunched(cmXMLWriter& xml);
|
void GenerateXMLLaunched(cmXMLWriter& xml);
|
||||||
void GenerateXMLLogScraped(cmXMLWriter& xml);
|
void GenerateXMLLogScraped(cmXMLWriter& xml);
|
||||||
void GenerateXMLFooter(cmXMLWriter& xml, cmDuration elapsed_build_time);
|
void GenerateXMLFooter(cmXMLWriter& xml, cmDuration elapsed_build_time);
|
||||||
bool IsLaunchedErrorFile(const char* fname);
|
bool IsLaunchedErrorFile(char const* fname);
|
||||||
bool IsLaunchedWarningFile(const char* fname);
|
bool IsLaunchedWarningFile(char const* fname);
|
||||||
|
|
||||||
std::string StartBuild;
|
std::string StartBuild;
|
||||||
std::string EndBuild;
|
std::string EndBuild;
|
||||||
@@ -109,10 +109,10 @@ private:
|
|||||||
|
|
||||||
using t_BuildProcessingQueueType = std::deque<char>;
|
using t_BuildProcessingQueueType = std::deque<char>;
|
||||||
|
|
||||||
void ProcessBuffer(const char* data, size_t length, size_t& tick,
|
void ProcessBuffer(char const* data, size_t length, size_t& tick,
|
||||||
size_t tick_len, std::ostream& ofs,
|
size_t tick_len, std::ostream& ofs,
|
||||||
t_BuildProcessingQueueType* queue);
|
t_BuildProcessingQueueType* queue);
|
||||||
int ProcessSingleLine(const char* data);
|
int ProcessSingleLine(char const* data);
|
||||||
|
|
||||||
t_BuildProcessingQueueType BuildProcessingQueue;
|
t_BuildProcessingQueueType BuildProcessingQueue;
|
||||||
t_BuildProcessingQueueType BuildProcessingErrorQueue;
|
t_BuildProcessingQueueType BuildProcessingErrorQueue;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ cmCTestCVS::~cmCTestCVS() = default;
|
|||||||
class cmCTestCVS::UpdateParser : public cmCTestVC::LineParser
|
class cmCTestCVS::UpdateParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UpdateParser(cmCTestCVS* cvs, const char* prefix)
|
UpdateParser(cmCTestCVS* cvs, char const* prefix)
|
||||||
: CVS(cvs)
|
: CVS(cvs)
|
||||||
{
|
{
|
||||||
this->SetLog(&cvs->Log, prefix);
|
this->SetLog(&cvs->Log, prefix);
|
||||||
@@ -106,7 +106,7 @@ class cmCTestCVS::LogParser : public cmCTestVC::LineParser
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using Revision = cmCTestCVS::Revision;
|
using Revision = cmCTestCVS::Revision;
|
||||||
LogParser(cmCTestCVS* cvs, const char* prefix, std::vector<Revision>& revs)
|
LogParser(cmCTestCVS* cvs, char const* prefix, std::vector<Revision>& revs)
|
||||||
: CVS(cvs)
|
: CVS(cvs)
|
||||||
, Revisions(revs)
|
, Revisions(revs)
|
||||||
{
|
{
|
||||||
@@ -214,7 +214,7 @@ std::string cmCTestCVS::ComputeBranchFlag(std::string const& dir)
|
|||||||
return "-b";
|
return "-b";
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
|
void cmCTestCVS::LoadRevisions(std::string const& file, char const* branchFlag,
|
||||||
std::vector<Revision>& revisions)
|
std::vector<Revision>& revisions)
|
||||||
{
|
{
|
||||||
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
|
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
|
||||||
@@ -231,7 +231,7 @@ void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
|
|||||||
void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
|
void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
|
||||||
Directory const& dir)
|
Directory const& dir)
|
||||||
{
|
{
|
||||||
const char* slash = path.empty() ? "" : "/";
|
char const* slash = path.empty() ? "" : "/";
|
||||||
xml.StartElement("Directory");
|
xml.StartElement("Directory");
|
||||||
xml.Element("Name", path);
|
xml.Element("Name", path);
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ private:
|
|||||||
std::map<std::string, Directory> Dirs;
|
std::map<std::string, Directory> Dirs;
|
||||||
|
|
||||||
std::string ComputeBranchFlag(std::string const& dir);
|
std::string ComputeBranchFlag(std::string const& dir);
|
||||||
void LoadRevisions(std::string const& file, const char* branchFlag,
|
void LoadRevisions(std::string const& file, char const* branchFlag,
|
||||||
std::vector<Revision>& revisions);
|
std::vector<Revision>& revisions);
|
||||||
void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
|
void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
|
||||||
Directory const& dir);
|
Directory const& dir);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ cmCTestConfigureCommand::InitializeHandler(HandlerArguments& arguments,
|
|||||||
} else {
|
} else {
|
||||||
cmValue cmakeGeneratorName = mf.GetDefinition("CTEST_CMAKE_GENERATOR");
|
cmValue cmakeGeneratorName = mf.GetDefinition("CTEST_CMAKE_GENERATOR");
|
||||||
if (cmNonempty(cmakeGeneratorName)) {
|
if (cmNonempty(cmakeGeneratorName)) {
|
||||||
const std::string& source_dir =
|
std::string const& source_dir =
|
||||||
this->CTest->GetCTestConfiguration("SourceDirectory");
|
this->CTest->GetCTestConfiguration("SourceDirectory");
|
||||||
if (source_dir.empty()) {
|
if (source_dir.empty()) {
|
||||||
status.SetError(
|
status.SetError(
|
||||||
@@ -61,8 +61,8 @@ cmCTestConfigureCommand::InitializeHandler(HandlerArguments& arguments,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string cmlName = mf.GetSafeDefinition("CMAKE_LIST_FILE_NAME");
|
std::string const cmlName = mf.GetSafeDefinition("CMAKE_LIST_FILE_NAME");
|
||||||
const std::string cmakelists_file = cmStrCat(
|
std::string const cmakelists_file = cmStrCat(
|
||||||
source_dir, "/", cmlName.empty() ? "CMakeLists.txt" : cmlName);
|
source_dir, "/", cmlName.empty() ? "CMakeLists.txt" : cmlName);
|
||||||
if (!cmSystemTools::FileExists(cmakelists_file)) {
|
if (!cmSystemTools::FileExists(cmakelists_file)) {
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ int cmCTestCoverageHandler::ProcessHandler()
|
|||||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet);
|
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string fullFileName = file.first;
|
std::string const fullFileName = file.first;
|
||||||
bool shouldIDoCoverage =
|
bool shouldIDoCoverage =
|
||||||
this->ShouldIDoCoverage(fullFileName, sourceDir, binaryDir);
|
this->ShouldIDoCoverage(fullFileName, sourceDir, binaryDir);
|
||||||
if (!shouldIDoCoverage) {
|
if (!shouldIDoCoverage) {
|
||||||
@@ -392,10 +392,10 @@ int cmCTestCoverageHandler::ProcessHandler()
|
|||||||
this->StartCoverageLogXML(covLogXML);
|
this->StartCoverageLogXML(covLogXML);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string fileName = cmSystemTools::GetFilenameName(fullFileName);
|
std::string const fileName = cmSystemTools::GetFilenameName(fullFileName);
|
||||||
const std::string shortFileName =
|
std::string const shortFileName =
|
||||||
this->CTest->GetShortPathToFile(fullFileName);
|
this->CTest->GetShortPathToFile(fullFileName);
|
||||||
const cmCTestCoverageHandlerContainer::SingleFileCoverageVector& fcov =
|
cmCTestCoverageHandlerContainer::SingleFileCoverageVector const& fcov =
|
||||||
file.second;
|
file.second;
|
||||||
covLogXML.StartElement("File");
|
covLogXML.StartElement("File");
|
||||||
covLogXML.Attribute("Name", fileName);
|
covLogXML.Attribute("Name", fileName);
|
||||||
@@ -609,7 +609,7 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile* mf)
|
|||||||
# define fnc_prefix(s, t) cmHasPrefix(s, t)
|
# define fnc_prefix(s, t) cmHasPrefix(s, t)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool IsFileInDir(const std::string& infile, const std::string& indir)
|
static bool IsFileInDir(std::string const& infile, std::string const& indir)
|
||||||
{
|
{
|
||||||
std::string file = cmSystemTools::CollapseFullPath(infile);
|
std::string file = cmSystemTools::CollapseFullPath(infile);
|
||||||
std::string dir = cmSystemTools::CollapseFullPath(indir);
|
std::string dir = cmSystemTools::CollapseFullPath(indir);
|
||||||
@@ -716,9 +716,9 @@ struct cmCTestCoverageHandlerLocale
|
|||||||
cmSystemTools::UnsetEnv("LC_ALL");
|
cmSystemTools::UnsetEnv("LC_ALL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmCTestCoverageHandlerLocale(const cmCTestCoverageHandlerLocale&) = delete;
|
cmCTestCoverageHandlerLocale(cmCTestCoverageHandlerLocale const&) = delete;
|
||||||
cmCTestCoverageHandlerLocale& operator=(
|
cmCTestCoverageHandlerLocale& operator=(
|
||||||
const cmCTestCoverageHandlerLocale&) = delete;
|
cmCTestCoverageHandlerLocale const&) = delete;
|
||||||
std::string lc_all;
|
std::string lc_all;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -789,7 +789,7 @@ int cmCTestCoverageHandler::HandleDelphiCoverage(
|
|||||||
return static_cast<int>(cont->TotalCoverage.size());
|
return static_cast<int>(cont->TotalCoverage.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string joinCommandLine(const std::vector<std::string>& args)
|
static std::string joinCommandLine(std::vector<std::string> const& args)
|
||||||
{
|
{
|
||||||
std::string ret;
|
std::string ret;
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
|
|||||||
std::vector<std::string> covargs = basecovargs;
|
std::vector<std::string> covargs = basecovargs;
|
||||||
covargs.push_back(fileDir);
|
covargs.push_back(fileDir);
|
||||||
covargs.push_back(f);
|
covargs.push_back(f);
|
||||||
const std::string command = joinCommandLine(covargs);
|
std::string const command = joinCommandLine(covargs);
|
||||||
|
|
||||||
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||||
command << std::endl, this->Quiet);
|
command << std::endl, this->Quiet);
|
||||||
@@ -1306,7 +1306,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
|
|||||||
std::vector<std::string> covargs =
|
std::vector<std::string> covargs =
|
||||||
cmSystemTools::ParseArguments(lcovExtraFlags);
|
cmSystemTools::ParseArguments(lcovExtraFlags);
|
||||||
covargs.insert(covargs.begin(), lcovCommand);
|
covargs.insert(covargs.begin(), lcovCommand);
|
||||||
const std::string command = joinCommandLine(covargs);
|
std::string const command = joinCommandLine(covargs);
|
||||||
|
|
||||||
// In intel compiler we have to call codecov only once in each executable
|
// In intel compiler we have to call codecov only once in each executable
|
||||||
// directory. It collects all *.dyn files to generate .dpi file.
|
// directory. It collects all *.dyn files to generate .dpi file.
|
||||||
@@ -1691,7 +1691,7 @@ std::string cmCTestCoverageHandler::FindFile(
|
|||||||
|
|
||||||
// This is a header put on each marked up source file
|
// This is a header put on each marked up source file
|
||||||
namespace {
|
namespace {
|
||||||
const char* bullseyeHelp[] = {
|
char const* bullseyeHelp[] = {
|
||||||
" Coverage produced by bullseye covbr tool: ",
|
" Coverage produced by bullseye covbr tool: ",
|
||||||
" www.bullseye.com/help/ref_covbr.html",
|
" www.bullseye.com/help/ref_covbr.html",
|
||||||
" * An arrow --> indicates incomplete coverage.",
|
" * An arrow --> indicates incomplete coverage.",
|
||||||
@@ -1838,7 +1838,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCTestCoverageHandler::RunBullseyeCommand(
|
int cmCTestCoverageHandler::RunBullseyeCommand(
|
||||||
cmCTestCoverageHandlerContainer* cont, const char* cmd, const char* arg,
|
cmCTestCoverageHandlerContainer* cont, char const* cmd, char const* arg,
|
||||||
std::string& outputFile)
|
std::string& outputFile)
|
||||||
{
|
{
|
||||||
std::string program = cmSystemTools::FindProgram(cmd);
|
std::string program = cmSystemTools::FindProgram(cmd);
|
||||||
@@ -2142,7 +2142,7 @@ void cmCTestCoverageHandler::LoadLabels()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestCoverageHandler::LoadLabels(const char* dir)
|
void cmCTestCoverageHandler::LoadLabels(char const* dir)
|
||||||
{
|
{
|
||||||
LabelSet& dirLabels = this->TargetDirs[dir];
|
LabelSet& dirLabels = this->TargetDirs[dir];
|
||||||
std::string fname = cmStrCat(dir, "/Labels.txt");
|
std::string fname = cmStrCat(dir, "/Labels.txt");
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
std::vector<std::string>& filesFullPath);
|
std::vector<std::string>& filesFullPath);
|
||||||
|
|
||||||
int RunBullseyeCommand(cmCTestCoverageHandlerContainer* cont,
|
int RunBullseyeCommand(cmCTestCoverageHandlerContainer* cont,
|
||||||
const char* cmd, const char* arg,
|
char const* cmd, char const* arg,
|
||||||
std::string& outputFile);
|
std::string& outputFile);
|
||||||
bool ParseBullsEyeCovsrcLine(std::string const& inputLine,
|
bool ParseBullsEyeCovsrcLine(std::string const& inputLine,
|
||||||
std::string& sourceFile, int& functionsCalled,
|
std::string& sourceFile, int& functionsCalled,
|
||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
|
|
||||||
// Label reading and writing methods.
|
// Label reading and writing methods.
|
||||||
void LoadLabels();
|
void LoadLabels();
|
||||||
void LoadLabels(const char* dir);
|
void LoadLabels(char const* dir);
|
||||||
void WriteXMLLabels(cmXMLWriter& xml, std::string const& source);
|
void WriteXMLLabels(cmXMLWriter& xml, std::string const& source);
|
||||||
|
|
||||||
// Label-based filtering.
|
// Label-based filtering.
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#include "cmValue.h"
|
#include "cmValue.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const bool TLS_VERIFY_DEFAULT = true;
|
bool const TLS_VERIFY_DEFAULT = true;
|
||||||
const int TLS_VERSION_DEFAULT = CURL_SSLVERSION_TLSv1_2;
|
int const TLS_VERSION_DEFAULT = CURL_SSLVERSION_TLSv1_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmCTestCurl::cmCTestCurl(cmCTest* ctest)
|
cmCTestCurl::cmCTestCurl(cmCTest* ctest)
|
||||||
@@ -49,7 +49,7 @@ size_t curlWriteMemoryCallback(void* ptr, size_t size, size_t nmemb,
|
|||||||
void* data)
|
void* data)
|
||||||
{
|
{
|
||||||
int realsize = static_cast<int>(size * nmemb);
|
int realsize = static_cast<int>(size * nmemb);
|
||||||
const char* chPtr = static_cast<char*>(ptr);
|
char const* chPtr = static_cast<char*>(ptr);
|
||||||
cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
|
cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
|
||||||
return realsize;
|
return realsize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ class cmCTestCurl
|
|||||||
public:
|
public:
|
||||||
cmCTestCurl(cmCTest*);
|
cmCTestCurl(cmCTest*);
|
||||||
~cmCTestCurl();
|
~cmCTestCurl();
|
||||||
cmCTestCurl(const cmCTestCurl&) = delete;
|
cmCTestCurl(cmCTestCurl const&) = delete;
|
||||||
cmCTestCurl& operator=(const cmCTestCurl&) = delete;
|
cmCTestCurl& operator=(cmCTestCurl const&) = delete;
|
||||||
bool UploadFile(std::string const& local_file, std::string const& url,
|
bool UploadFile(std::string const& local_file, std::string const& url,
|
||||||
std::string const& fields, std::string& response);
|
std::string const& fields, std::string& response);
|
||||||
bool HttpRequest(std::string const& url, std::string const& fields,
|
bool HttpRequest(std::string const& url, std::string const& fields,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Try to remove the binary directory once
|
// Try to remove the binary directory once
|
||||||
cmsys::Status TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath)
|
cmsys::Status TryToRemoveBinaryDirectoryOnce(std::string const& directoryPath)
|
||||||
{
|
{
|
||||||
cmsys::Directory directory;
|
cmsys::Directory directory;
|
||||||
directory.Load(directoryPath);
|
directory.Load(directoryPath);
|
||||||
@@ -48,7 +48,7 @@ cmsys::Status TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath)
|
|||||||
/*
|
/*
|
||||||
* Empty Binary Directory
|
* Empty Binary Directory
|
||||||
*/
|
*/
|
||||||
bool EmptyBinaryDirectory(const std::string& sname, std::string& err)
|
bool EmptyBinaryDirectory(std::string const& sname, std::string& err)
|
||||||
{
|
{
|
||||||
// try to avoid deleting root
|
// try to avoid deleting root
|
||||||
if (sname.size() < 2) {
|
if (sname.size() < 2) {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ cmCTestGIT::~cmCTestGIT() = default;
|
|||||||
class cmCTestGIT::OneLineParser : public cmCTestVC::LineParser
|
class cmCTestGIT::OneLineParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OneLineParser(cmCTestGIT* git, const char* prefix, std::string& l)
|
OneLineParser(cmCTestGIT* git, char const* prefix, std::string& l)
|
||||||
: Line1(l)
|
: Line1(l)
|
||||||
{
|
{
|
||||||
this->SetLog(&git->Log, prefix);
|
this->SetLog(&git->Log, prefix);
|
||||||
@@ -326,7 +326,7 @@ unsigned int cmCTestGIT::GetGitVersion()
|
|||||||
class cmCTestGIT::DiffParser : public cmCTestVC::LineParser
|
class cmCTestGIT::DiffParser : public cmCTestVC::LineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DiffParser(cmCTestGIT* git, const char* prefix)
|
DiffParser(cmCTestGIT* git, char const* prefix)
|
||||||
: LineParser('\0', false)
|
: LineParser('\0', false)
|
||||||
, GIT(git)
|
, GIT(git)
|
||||||
{
|
{
|
||||||
@@ -366,16 +366,16 @@ protected:
|
|||||||
this->DiffField = DiffFieldNone;
|
this->DiffField = DiffFieldNone;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const char* src_mode_first = this->Line.c_str() + 1;
|
char const* src_mode_first = this->Line.c_str() + 1;
|
||||||
const char* src_mode_last = this->ConsumeField(src_mode_first);
|
char const* src_mode_last = this->ConsumeField(src_mode_first);
|
||||||
const char* dst_mode_first = this->ConsumeSpace(src_mode_last);
|
char const* dst_mode_first = this->ConsumeSpace(src_mode_last);
|
||||||
const char* dst_mode_last = this->ConsumeField(dst_mode_first);
|
char const* dst_mode_last = this->ConsumeField(dst_mode_first);
|
||||||
const char* src_sha1_first = this->ConsumeSpace(dst_mode_last);
|
char const* src_sha1_first = this->ConsumeSpace(dst_mode_last);
|
||||||
const char* src_sha1_last = this->ConsumeField(src_sha1_first);
|
char const* src_sha1_last = this->ConsumeField(src_sha1_first);
|
||||||
const char* dst_sha1_first = this->ConsumeSpace(src_sha1_last);
|
char const* dst_sha1_first = this->ConsumeSpace(src_sha1_last);
|
||||||
const char* dst_sha1_last = this->ConsumeField(dst_sha1_first);
|
char const* dst_sha1_last = this->ConsumeField(dst_sha1_first);
|
||||||
const char* status_first = this->ConsumeSpace(dst_sha1_last);
|
char const* status_first = this->ConsumeSpace(dst_sha1_last);
|
||||||
const char* status_last = this->ConsumeField(status_first);
|
char const* status_last = this->ConsumeField(status_first);
|
||||||
if (status_first != status_last) {
|
if (status_first != status_last) {
|
||||||
this->CurChange.Action = *status_first;
|
this->CurChange.Action = *status_first;
|
||||||
this->DiffField = DiffFieldSrc;
|
this->DiffField = DiffFieldSrc;
|
||||||
@@ -410,14 +410,14 @@ protected:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* ConsumeSpace(const char* c)
|
char const* ConsumeSpace(char const* c)
|
||||||
{
|
{
|
||||||
while (*c && cmIsSpace(*c)) {
|
while (*c && cmIsSpace(*c)) {
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
const char* ConsumeField(const char* c)
|
char const* ConsumeField(char const* c)
|
||||||
{
|
{
|
||||||
while (*c && !cmIsSpace(*c)) {
|
while (*c && !cmIsSpace(*c)) {
|
||||||
++c;
|
++c;
|
||||||
@@ -448,7 +448,7 @@ protected:
|
|||||||
class cmCTestGIT::CommitParser : public cmCTestGIT::DiffParser
|
class cmCTestGIT::CommitParser : public cmCTestGIT::DiffParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CommitParser(cmCTestGIT* git, const char* prefix)
|
CommitParser(cmCTestGIT* git, char const* prefix)
|
||||||
: DiffParser(git, prefix)
|
: DiffParser(git, prefix)
|
||||||
{
|
{
|
||||||
this->Separator = SectionSep[this->Section];
|
this->Separator = SectionSep[this->Section];
|
||||||
@@ -475,29 +475,29 @@ private:
|
|||||||
long TimeZone = 0;
|
long TimeZone = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ParsePerson(const char* str, Person& person)
|
void ParsePerson(char const* str, Person& person)
|
||||||
{
|
{
|
||||||
// Person Name <person@domain.com> 1234567890 +0000
|
// Person Name <person@domain.com> 1234567890 +0000
|
||||||
const char* c = str;
|
char const* c = str;
|
||||||
while (*c && cmIsSpace(*c)) {
|
while (*c && cmIsSpace(*c)) {
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* name_first = c;
|
char const* name_first = c;
|
||||||
while (*c && *c != '<') {
|
while (*c && *c != '<') {
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
const char* name_last = c;
|
char const* name_last = c;
|
||||||
while (name_last != name_first && cmIsSpace(*(name_last - 1))) {
|
while (name_last != name_first && cmIsSpace(*(name_last - 1))) {
|
||||||
--name_last;
|
--name_last;
|
||||||
}
|
}
|
||||||
person.Name.assign(name_first, name_last - name_first);
|
person.Name.assign(name_first, name_last - name_first);
|
||||||
|
|
||||||
const char* email_first = *c ? ++c : c;
|
char const* email_first = *c ? ++c : c;
|
||||||
while (*c && *c != '>') {
|
while (*c && *c != '>') {
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
const char* email_last = *c ? c++ : c;
|
char const* email_last = *c ? c++ : c;
|
||||||
person.EMail.assign(email_first, email_last - email_first);
|
person.EMail.assign(email_first, email_last - email_first);
|
||||||
|
|
||||||
person.Time = strtoul(c, const_cast<char**>(&c), 10);
|
person.Time = strtoul(c, const_cast<char**>(&c), 10);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ cmCTestGenericHandler::cmCTestGenericHandler(cmCTest* ctest)
|
|||||||
cmCTestGenericHandler::~cmCTestGenericHandler() = default;
|
cmCTestGenericHandler::~cmCTestGenericHandler() = default;
|
||||||
|
|
||||||
bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
|
bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
|
||||||
const char* name,
|
char const* name,
|
||||||
cmGeneratedFileStream& xofs)
|
cmGeneratedFileStream& xofs)
|
||||||
{
|
{
|
||||||
if (!name) {
|
if (!name) {
|
||||||
@@ -54,7 +54,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTestGenericHandler::StartLogFile(const char* name,
|
bool cmCTestGenericHandler::StartLogFile(char const* name,
|
||||||
cmGeneratedFileStream& xofs)
|
cmGeneratedFileStream& xofs)
|
||||||
{
|
{
|
||||||
if (!name) {
|
if (!name) {
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ public:
|
|||||||
void SetCMakeInstance(cmake* cm) { this->CMake = cm; }
|
void SetCMakeInstance(cmake* cm) { this->CMake = cm; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool StartResultingXML(cmCTest::Part part, const char* name,
|
bool StartResultingXML(cmCTest::Part part, char const* name,
|
||||||
cmGeneratedFileStream& xofs);
|
cmGeneratedFileStream& xofs);
|
||||||
bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
|
bool StartLogFile(char const* name, cmGeneratedFileStream& xofs);
|
||||||
|
|
||||||
bool AppendXML = false;
|
bool AppendXML = false;
|
||||||
bool Quiet = false;
|
bool Quiet = false;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user