| 1415 | } |
| 1416 | |
| 1417 | char 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 | |
| 1450 | char const* cmCPackGenerator::GetPackagingInstallPrefix() |
| 1451 | { |
no test coverage detected