| 2370 | } |
| 2371 | |
| 2372 | void 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 | |
| 2396 | void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( |
| 2397 | char const* makefileBasename, cmGeneratorTarget* target, |
no test coverage detected