MCPcopy Create free account
hub / github.com/Kitware/CMake / InitializeInternal

Method InitializeInternal

Source/CPack/cmCPackRPMGenerator.cxx:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23cmCPackRPMGenerator::~cmCPackRPMGenerator() = default;
24
25int cmCPackRPMGenerator::InitializeInternal()
26{
27 this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
28 if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
29 this->SetOption("CPACK_SET_DESTDIR", "I_ON");
30 }
31 /* Replace space in CPACK_PACKAGE_NAME in order to avoid
32 * rpmbuild scream on unwanted space in filename issue
33 * Moreover RPM file do not usually embed space in filename
34 */
35 if (this->GetOption("CPACK_PACKAGE_NAME")) {
36 std::string packageName = this->GetOption("CPACK_PACKAGE_NAME");
37 std::replace(packageName.begin(), packageName.end(), ' ', '-');
38 this->SetOption("CPACK_PACKAGE_NAME", packageName);
39 }
40 /* same for CPACK_PACKAGE_FILE_NAME */
41 if (this->GetOption("CPACK_PACKAGE_FILE_NAME")) {
42 std::string packageName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
43 std::replace(packageName.begin(), packageName.end(), ' ', '-');
44 this->SetOption("CPACK_PACKAGE_FILE_NAME", packageName);
45 }
46 return this->Superclass::InitializeInternal();
47}
48
49void cmCPackRPMGenerator::AddGeneratedPackageNames()
50{

Callers

nothing calls this directly

Calls 6

cmIsOffFunction · 0.85
SetOptionIfNotSetMethod · 0.45
GetOptionMethod · 0.45
SetOptionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected