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

Method GetInstallPath

Source/CPack/cmCPackGenerator.cxx:1417–1448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1415}
1416
1417char const* cmCPackGenerator::GetInstallPath()
1418{
1419 if (!this->InstallPath.empty()) {
1420 return this->InstallPath.c_str();
1421 }
1422#if defined(_WIN32) && !defined(__CYGWIN__)
1423 std::string prgfiles;
1424 std::string sysDrive;
1425 if (cmsys::SystemTools::GetEnv("ProgramFiles", prgfiles)) {
1426 this->InstallPath = prgfiles;
1427 } else if (cmsys::SystemTools::GetEnv("SystemDrive", sysDrive)) {
1428 this->InstallPath = cmStrCat(sysDrive, "/Program Files");
1429 } else {
1430 this->InstallPath = "c:/Program Files";
1431 }
1432 this->InstallPath += "/";
1433 this->InstallPath += this->GetOption("CPACK_PACKAGE_NAME");
1434 this->InstallPath += "-";
1435 this->InstallPath += this->GetOption("CPACK_PACKAGE_VERSION");
1436#elif defined(__HAIKU__)
1437 char dir[B_PATH_NAME_LENGTH];
1438 if (find_directory(B_SYSTEM_DIRECTORY, -1, false, dir, sizeof(dir)) ==
1439 B_OK) {
1440 this->InstallPath = dir;
1441 } else {
1442 this->InstallPath = "/boot/system";
1443 }
1444#else
1445 this->InstallPath = "/usr/local/";
1446#endif
1447 return this->InstallPath.c_str();
1448}
1449
1450char const* cmCPackGenerator::GetPackagingInstallPrefix()
1451{

Callers 3

PrepareNamesMethod · 0.95
CreateIfAnyMethod · 0.80

Calls 4

GetOptionMethod · 0.95
c_strMethod · 0.80
cmStrCatFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected