summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenericGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-15 14:22:51 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-15 14:22:51 (GMT)
commite48dc064022611e2fd86d5756c97e61bdb663822 (patch)
tree1b70072e81290e0436aa3189275720340633bed8 /Source/CPack/cmCPackGenericGenerator.cxx
parent1aecb478d60b5fa9c40addea9ff5cf9faf186469 (diff)
downloadCMake-e48dc064022611e2fd86d5756c97e61bdb663822.zip
CMake-e48dc064022611e2fd86d5756c97e61bdb663822.tar.gz
CMake-e48dc064022611e2fd86d5756c97e61bdb663822.tar.bz2
ENH: Allow multiple install directories
Diffstat (limited to 'Source/CPack/cmCPackGenericGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenericGenerator.cxx55
1 files changed, 32 insertions, 23 deletions
diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx
index 4ceea02..e32d0f8 100644
--- a/Source/CPack/cmCPackGenericGenerator.cxx
+++ b/Source/CPack/cmCPackGenericGenerator.cxx
@@ -229,31 +229,40 @@ int cmCPackGenericGenerator::InstallProject()
}
}
}
- const char* binaryDir = this->GetOption("CPACK_BINARY_DIR");
- if ( binaryDir )
- {
- std::string installFile = binaryDir;
- installFile += "/cmake_install.cmake";
- cmake cm;
- cmGlobalGenerator gg;
- gg.SetCMakeInstance(&cm);
- 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 )
+ const char* binaryDirectories = this->GetOption("CPACK_BINARY_DIR");
+ if ( binaryDirectories )
+ {
+ std::vector<std::string> binaryDirectoriesVector;
+ cmSystemTools::ExpandListArgument(binaryDirectories,
+ binaryDirectoriesVector);
+ std::vector<std::string>::iterator it;
+ for ( it = binaryDirectoriesVector.begin();
+ it != binaryDirectoriesVector.end();
+ ++it )
{
- mf->AddDefinition("BUILD_TYPE", buildConfig);
- }
+ std::string installFile = it->c_str();
+ installFile += "/cmake_install.cmake";
+ cmake cm;
+ cmGlobalGenerator gg;
+ gg.SetCMakeInstance(&cm);
+ 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());
- if ( cmSystemTools::GetErrorOccuredFlag() )
- {
- res = 0;
+ res = mf->ReadListFile(0, installFile.c_str());
+ if ( cmSystemTools::GetErrorOccuredFlag() )
+ {
+ res = 0;
+ }
}
}
if ( !movable )