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

Method InstallProjectViaInstallCMakeProjects

Source/CPack/cmCPackGenerator.cxx:568–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
569 bool setDestDir, std::string const& baseTempInstallDirectory,
570 mode_t const* default_dir_mode)
571{
572 cmValue cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
573 cmValue cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
574 std::string absoluteDestFiles;
575 if (cmNonempty(cmakeProjects)) {
576 if (!cmakeGenerator) {
577 cmCPackLogger(cmCPackLog::LOG_ERROR,
578 "CPACK_INSTALL_CMAKE_PROJECTS is specified, but "
579 "CPACK_CMAKE_GENERATOR is not. CPACK_CMAKE_GENERATOR "
580 "is required to install the project."
581 << std::endl);
582 return 0;
583 }
584 cmList cmakeProjectsList{ cmakeProjects };
585 cmList::iterator it;
586 for (it = cmakeProjectsList.begin(); it != cmakeProjectsList.end(); ++it) {
587 if (it + 1 == cmakeProjectsList.end() ||
588 it + 2 == cmakeProjectsList.end() ||
589 it + 3 == cmakeProjectsList.end()) {
590 cmCPackLogger(
591 cmCPackLog::LOG_ERROR,
592 "Not enough items on list: CPACK_INSTALL_CMAKE_PROJECTS. "
593 "CPACK_INSTALL_CMAKE_PROJECTS should hold quadruplet of install "
594 "directory, install project name, install component, and install "
595 "subdirectory."
596 << std::endl);
597 return 0;
598 }
599 std::string installDirectory = *it;
600 ++it;
601 std::string installProjectName = *it;
602 ++it;
603 cmCPackInstallCMakeProject project;
604
605 project.Directory = installDirectory;
606 project.ProjectName = installProjectName;
607 project.Component = *it;
608 ++it;
609 project.SubDirectory = *it;
610
611 cmList componentsList;
612
613 bool componentInstall = false;
614 /*
615 * We do a component install iff
616 * - the CPack generator support component
617 * - the user did not request Monolithic install
618 * (this works at CPack time too)
619 */
620 if (this->SupportsComponentInstallation() &&
621 !(this->IsOn("CPACK_MONOLITHIC_INSTALL"))) {
622 // Determine the installation types for this project (if provided).
623 std::string installTypesVar = "CPACK_" +
624 cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
625 cmValue installTypes = this->GetOption(installTypesVar);

Callers 1

InstallProjectMethod · 0.95

Calls 15

GetOptionMethod · 0.95
IsOnMethod · 0.95
GetInstallationTypeMethod · 0.95
GetComponentMethod · 0.95
RunPreinstallTargetMethod · 0.95
InstallCMakeProjectMethod · 0.95
SetOptionMethod · 0.95
cmNonemptyFunction · 0.85
moveFunction · 0.85
push_backMethod · 0.80
assignMethod · 0.80

Tested by

no test coverage detected