MCPcopy Index your code
hub / github.com/Kitware/CMake / AddCommandsToBuildPhase

Method AddCommandsToBuildPhase

Source/cmGlobalXCodeGenerator.cxx:2372–2394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2370}
2371
2372void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
2373 cmXCodeObject* buildphase, cmGeneratorTarget* target,
2374 std::vector<cmCustomCommand> const& commands, char const* name)
2375{
2376 std::string dir = cmStrCat(
2377 this->CurrentLocalGenerator->GetCurrentBinaryDirectory(), "/CMakeScripts");
2378 cmSystemTools::MakeDirectory(dir);
2379 std::string makefile =
2380 cmStrCat(dir, '/', target->GetName(), '_', name, ".make");
2381
2382 for (auto const& currentConfig : this->CurrentConfigurationTypes) {
2383 this->CreateCustomRulesMakefile(makefile.c_str(), target, commands,
2384 currentConfig);
2385 }
2386
2387 std::string cdir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
2388 cdir = cmSystemTools::ConvertToOutputPath(cdir);
2389 std::string makecmd = cmStrCat(
2390 "make -C ", cdir, " -f ", cmSystemTools::ConvertToOutputPath(makefile),
2391 "$CONFIGURATION OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all");
2392 buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
2393 buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
2394}
2395
2396void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
2397 char const* makefileBasename, cmGeneratorTarget* target,

Callers 1

Calls 6

CreateStringMethod · 0.95
c_strMethod · 0.80
cmStrCatFunction · 0.70
GetNameMethod · 0.45
AddAttributeMethod · 0.45

Tested by

no test coverage detected