| 280 | } |
| 281 | |
| 282 | void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) |
| 283 | { |
| 284 | std::vector<std::string> commands; |
| 285 | |
| 286 | // Get the name of the executable to generate. |
| 287 | cmGeneratorTarget::Names targetNames = |
| 288 | this->GeneratorTarget->GetExecutableNames(this->GetConfigName()); |
| 289 | |
| 290 | // Construct the full path version of the names. |
| 291 | std::string outpath = |
| 292 | this->GeneratorTarget->GetDirectory(this->GetConfigName()); |
| 293 | if (this->GeneratorTarget->IsAppBundleOnApple()) { |
| 294 | this->OSXBundleGenerator->CreateAppBundle(targetNames.Output, outpath, |
| 295 | this->GetConfigName()); |
| 296 | } |
| 297 | outpath += '/'; |
| 298 | std::string outpathImp; |
| 299 | if (relink) { |
| 300 | outpath = cmStrCat(this->Makefile->GetCurrentBinaryDirectory(), |
| 301 | "/CMakeFiles/CMakeRelink.dir"); |
| 302 | cmSystemTools::MakeDirectory(outpath); |
| 303 | outpath += '/'; |
| 304 | if (!targetNames.ImportLibrary.empty()) { |
| 305 | outpathImp = outpath; |
| 306 | } |
| 307 | } else { |
| 308 | cmSystemTools::MakeDirectory(outpath); |
| 309 | if (!targetNames.ImportLibrary.empty()) { |
| 310 | outpathImp = this->GeneratorTarget->GetDirectory( |
| 311 | this->GetConfigName(), cmStateEnums::ImportLibraryArtifact); |
| 312 | cmSystemTools::MakeDirectory(outpathImp); |
| 313 | outpathImp += '/'; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | std::string compilePdbOutputPath = |
| 318 | this->GeneratorTarget->GetCompilePDBDirectory(this->GetConfigName()); |
| 319 | cmSystemTools::MakeDirectory(compilePdbOutputPath); |
| 320 | |
| 321 | std::string pdbOutputPath = |
| 322 | this->GeneratorTarget->GetPDBDirectory(this->GetConfigName()); |
| 323 | cmSystemTools::MakeDirectory(pdbOutputPath); |
| 324 | pdbOutputPath += '/'; |
| 325 | |
| 326 | std::string targetFullPath = outpath + targetNames.Output; |
| 327 | std::string targetFullPathReal = outpath + targetNames.Real; |
| 328 | std::string targetFullPathPDB = pdbOutputPath + targetNames.PDB; |
| 329 | std::string targetFullPathImport = outpathImp + targetNames.ImportLibrary; |
| 330 | std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat( |
| 331 | targetFullPathPDB, cmOutputConverter::SHELL); |
| 332 | // Convert to the output path to use in constructing commands. |
| 333 | std::string targetOutPath = this->LocalGenerator->ConvertToOutputFormat( |
| 334 | this->LocalGenerator->MaybeRelativeToCurBinDir(targetFullPath), |
| 335 | cmOutputConverter::SHELL); |
| 336 | std::string targetOutPathReal = this->LocalGenerator->ConvertToOutputFormat( |
| 337 | this->LocalGenerator->MaybeRelativeToCurBinDir(targetFullPathReal), |
| 338 | cmOutputConverter::SHELL); |
| 339 | std::string targetOutPathImport = |
no test coverage detected