diff options
author | Brad King <brad.king@kitware.com> | 2014-06-25 09:13:53 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-25 09:18:27 -0400 |
commit | 3bae343f62e050da78476811234e1f8a055f5d04 (patch) | |
tree | a140ce7cb73774b5cc53496ed0382b50adc913b7 /Source/CPack/cmCPackGenerator.cxx | |
parent | c491cb1eb4030d70e7a04bcda5021ebd0e5ca88d (diff) | |
download | cmake-3bae343f62e050da78476811234e1f8a055f5d04.tar.gz |
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>
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 91f92c5554..9336bedeca 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -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, |