summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-01 17:19:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-01 17:19:37 (GMT)
commit4a821a47f700e12534d4ce16203ad2a4404ffe64 (patch)
tree9ada5eaa47f6603fa366b76932444c16f76b1fec /Source
parent9d456ec71ae0dfc4db5260d256c6b9570d5dd8cb (diff)
parent93a3ec8b7705c6edfa08a59a789d193fcb4cf4c1 (diff)
downloadCMake-4a821a47f700e12534d4ce16203ad2a4404ffe64.zip
CMake-4a821a47f700e12534d4ce16203ad2a4404ffe64.tar.gz
CMake-4a821a47f700e12534d4ce16203ad2a4404ffe64.tar.bz2
Merge topic 'cpack-fix-preinstall-tool'
93a3ec8b CPack: Fix make tool selection during preinstall (#15483)
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index ee255af..67005ef 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -655,26 +655,19 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmSystemTools::SetForceUnixPaths(globalGenerator->GetForceUnixPaths());
// Does this generator require pre-install?
- if ( globalGenerator->GetPreinstallTargetName() )
+ if (const char* preinstall = globalGenerator->GetPreinstallTargetName())
{
- globalGenerator->FindMakeProgram(this->MakefileMap);
- std::string cmakeMakeProgram
- = this->MakefileMap->GetSafeDefinition("CMAKE_MAKE_PROGRAM");
- std::vector<std::string> buildCommand;
- globalGenerator->GenerateBuildCommand(buildCommand, cmakeMakeProgram,
- installProjectName, installDirectory,
- globalGenerator->GetPreinstallTargetName(),
- buildConfig, false, false);
- std::string buildCommandStr =
- cmSystemTools::PrintSingleCommand(buildCommand);
+ std::string buildCommand =
+ globalGenerator->GenerateCMakeBuildCommand(
+ preinstall, buildConfig, "", false);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "- Install command: " << buildCommandStr << std::endl);
+ "- Install command: " << buildCommand << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Run preinstall target for: " << installProjectName << std::endl);
std::string output;
int retVal = 1;
bool resB =
- cmSystemTools::RunSingleCommand(buildCommand,
+ cmSystemTools::RunSingleCommand(buildCommand.c_str(),
&output,
&retVal,
installDirectory.c_str(),
@@ -684,12 +677,12 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/PreinstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << buildCommandStr << std::endl
+ ofs << "# Run command: " << buildCommand << std::endl
<< "# Directory: " << installDirectory << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running install command: " << buildCommandStr
+ "Problem running install command: " << buildCommand
<< std::endl
<< "Please check " << tmpFile << " for errors"
<< std::endl);