summaryrefslogtreecommitdiff
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-25 09:13:53 -0400
committerBrad King <brad.king@kitware.com>2014-06-25 09:18:27 -0400
commit3bae343f62e050da78476811234e1f8a055f5d04 (patch)
treea140ce7cb73774b5cc53496ed0382b50adc913b7 /Source/CPack/cmCPackGenerator.cxx
parentc491cb1eb4030d70e7a04bcda5021ebd0e5ca88d (diff)
downloadcmake-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.cxx4
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,