cmCPackGenerator: Avoid crash on undefined CMAKE_MAKE_PROGRAM
Since commit 6557382d
(stringapi: Use strings for program
paths, 2014-02-24), cmGlobalGenerator::GenerateBuildCommand
takes the make program path as a std::string. Fix the lookup
in cmCPackGenerator::InstallProjectViaInstallCMakeProjects to
use GetSafeDefinition for CMAKE_MAKE_PROGRAM to avoid possible
construction of std::string from a NULL.
Reported-by: Richard Wirth <richard@califax.de>
This commit is contained in:
parent
c491cb1eb4
commit
3bae343f62
|
@ -637,8 +637,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|||
if ( globalGenerator->GetPreinstallTargetName() )
|
||||
{
|
||||
globalGenerator->FindMakeProgram(this->MakefileMap);
|
||||
const char* cmakeMakeProgram
|
||||
= this->MakefileMap->GetDefinition("CMAKE_MAKE_PROGRAM");
|
||||
std::string cmakeMakeProgram
|
||||
= this->MakefileMap->GetSafeDefinition("CMAKE_MAKE_PROGRAM");
|
||||
std::vector<std::string> buildCommand;
|
||||
globalGenerator->GenerateBuildCommand(buildCommand, cmakeMakeProgram,
|
||||
installProjectName, installDirectory,
|
||||
|
|
Loading…
Reference in New Issue