Find the make program for the generator, required for try compiles
| 414 | |
| 415 | // Find the make program for the generator, required for try compiles |
| 416 | bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) |
| 417 | { |
| 418 | if (this->FindMakeProgramFile.empty()) { |
| 419 | cmSystemTools::Error( |
| 420 | "Generator implementation error, " |
| 421 | "all generators must specify this->FindMakeProgramFile"); |
| 422 | return false; |
| 423 | } |
| 424 | if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) { |
| 425 | std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile); |
| 426 | if (!setMakeProgram.empty()) { |
| 427 | mf->ReadListFile(setMakeProgram); |
| 428 | } |
| 429 | } |
| 430 | if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) { |
| 431 | std::ostringstream err; |
| 432 | err << "CMake was unable to find a build program corresponding to \"" |
| 433 | << this->GetName() |
| 434 | << "\". CMAKE_MAKE_PROGRAM is not set. You " |
| 435 | "probably need to select a different build tool."; |
| 436 | cmSystemTools::Error(err.str()); |
| 437 | cmSystemTools::SetFatalErrorOccurred(); |
| 438 | return false; |
| 439 | } |
| 440 | std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); |
| 441 | // if there are spaces in the make program use short path |
| 442 | // but do not short path the actual program name, as |
| 443 | // this can cause trouble with VSExpress |
| 444 | if (makeProgram.find(' ') != std::string::npos) { |
| 445 | std::string dir; |
| 446 | std::string file; |
| 447 | cmSystemTools::SplitProgramPath(makeProgram, dir, file); |
| 448 | std::string saveFile = file; |
| 449 | cmSystemTools::GetShortPath(makeProgram, makeProgram); |
| 450 | cmSystemTools::SplitProgramPath(makeProgram, dir, file); |
| 451 | makeProgram = cmStrCat(dir, '/', saveFile); |
| 452 | mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", makeProgram, "make program", |
| 453 | cmStateEnums::FILEPATH); |
| 454 | } |
| 455 | return true; |
| 456 | } |
| 457 | |
| 458 | bool cmGlobalGenerator::CheckLanguages( |
| 459 | std::vector<std::string> const& /* languages */, cmMakefile* /* mf */) const |
no test coverage detected