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

Method AddGlobalTarget_EditCache

Source/cmGlobalGenerator.cxx:3102–3140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3100}
3101
3102void cmGlobalGenerator::AddGlobalTarget_EditCache(
3103 std::vector<GlobalTargetInfo>& targets) const
3104{
3105 char const* editCacheTargetName = this->GetEditCacheTargetName();
3106 if (!editCacheTargetName) {
3107 return;
3108 }
3109 GlobalTargetInfo gti;
3110 gti.Name = editCacheTargetName;
3111 gti.PerConfig = cmTarget::PerConfig::No;
3112 cmCustomCommandLine singleLine;
3113
3114 // Use generator preference for the edit_cache rule if it is defined.
3115 std::string edit_cmd = this->GetEditCacheCommand();
3116 if (!edit_cmd.empty()) {
3117 singleLine.push_back(std::move(edit_cmd));
3118 if (this->GetCMakeInstance()->GetIgnoreCompileWarningAsError()) {
3119 singleLine.push_back("--compile-no-warning-as-error");
3120 }
3121 if (this->GetCMakeInstance()->GetIgnoreLinkWarningAsError()) {
3122 singleLine.push_back("--link-no-warning-as-error");
3123 }
3124 singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
3125 singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
3126 gti.Message = "Running CMake cache editor...";
3127 gti.UsesTerminal = true;
3128 } else {
3129 singleLine.push_back(cmSystemTools::GetCMakeCommand());
3130 singleLine.push_back("-E");
3131 singleLine.push_back("echo");
3132 singleLine.push_back("No interactive CMake dialog available.");
3133 gti.Message = "No interactive CMake dialog available...";
3134 gti.UsesTerminal = false;
3135 gti.StdPipesUTF8 = true;
3136 }
3137 gti.CommandLines.push_back(std::move(singleLine));
3138
3139 targets.push_back(std::move(gti));
3140}
3141
3142void cmGlobalGenerator::AddGlobalTarget_RebuildCache(
3143 std::vector<GlobalTargetInfo>& targets) const

Callers 1

Calls 8

GetEditCacheCommandMethod · 0.95
GetCMakeInstanceMethod · 0.95
moveFunction · 0.85
push_backMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected