summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-25 13:13:53 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-25 13:18:27 (GMT)
commit3bae343f62e050da78476811234e1f8a055f5d04 (patch)
treea140ce7cb73774b5cc53496ed0382b50adc913b7
parentc491cb1eb4030d70e7a04bcda5021ebd0e5ca88d (diff)
downloadCMake-3bae343f62e050da78476811234e1f8a055f5d04.zip
CMake-3bae343f62e050da78476811234e1f8a055f5d04.tar.gz
CMake-3bae343f62e050da78476811234e1f8a055f5d04.tar.bz2
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>
-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 91f92c5..9336bed 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,