ENH: Allow multiple install directories
This commit is contained in:
parent
1aecb478d6
commit
e48dc06402
|
@ -229,31 +229,40 @@ int cmCPackGenericGenerator::InstallProject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const char* binaryDir = this->GetOption("CPACK_BINARY_DIR");
|
const char* binaryDirectories = this->GetOption("CPACK_BINARY_DIR");
|
||||||
if ( binaryDir )
|
if ( binaryDirectories )
|
||||||
{
|
{
|
||||||
std::string installFile = binaryDir;
|
std::vector<std::string> binaryDirectoriesVector;
|
||||||
installFile += "/cmake_install.cmake";
|
cmSystemTools::ExpandListArgument(binaryDirectories,
|
||||||
cmake cm;
|
binaryDirectoriesVector);
|
||||||
cmGlobalGenerator gg;
|
std::vector<std::string>::iterator it;
|
||||||
gg.SetCMakeInstance(&cm);
|
for ( it = binaryDirectoriesVector.begin();
|
||||||
std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
it != binaryDirectoriesVector.end();
|
||||||
lg->SetGlobalGenerator(&gg);
|
++it )
|
||||||
cmMakefile *mf = lg->GetMakefile();
|
|
||||||
if ( movable )
|
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_INSTALL_PREFIX", tempInstallDirectory);
|
std::string installFile = it->c_str();
|
||||||
}
|
installFile += "/cmake_install.cmake";
|
||||||
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
|
cmake cm;
|
||||||
if ( buildConfig && *buildConfig )
|
cmGlobalGenerator gg;
|
||||||
{
|
gg.SetCMakeInstance(&cm);
|
||||||
mf->AddDefinition("BUILD_TYPE", buildConfig);
|
std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||||
}
|
lg->SetGlobalGenerator(&gg);
|
||||||
|
cmMakefile *mf = lg->GetMakefile();
|
||||||
|
if ( movable )
|
||||||
|
{
|
||||||
|
mf->AddDefinition("CMAKE_INSTALL_PREFIX", tempInstallDirectory);
|
||||||
|
}
|
||||||
|
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
|
||||||
|
if ( buildConfig && *buildConfig )
|
||||||
|
{
|
||||||
|
mf->AddDefinition("BUILD_TYPE", buildConfig);
|
||||||
|
}
|
||||||
|
|
||||||
res = mf->ReadListFile(0, installFile.c_str());
|
res = mf->ReadListFile(0, installFile.c_str());
|
||||||
if ( cmSystemTools::GetErrorOccuredFlag() )
|
if ( cmSystemTools::GetErrorOccuredFlag() )
|
||||||
{
|
{
|
||||||
res = 0;
|
res = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !movable )
|
if ( !movable )
|
||||||
|
|
Loading…
Reference in New Issue