summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2010-11-15 19:54:19 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2010-11-15 19:54:19 (GMT)
commit66e86b4770dcda3b5e79776c4cda6e60646189f1 (patch)
tree8c3ba93992572f2f5200a3a1c442acbbbcec36ff /Source/CPack
parent2c84d169b36b1b8713517a8d8799b82dbf59725a (diff)
downloadCMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.zip
CMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.tar.gz
CMake-66e86b4770dcda3b5e79776c4cda6e60646189f1.tar.bz2
CPack fix kwstyle breakage and make CPackRPM backward compatible
backward compatible= No componentized RPM unless requested using CPACK_RPM_COMP0NENT_INSTALL
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx30
-rw-r--r--Source/CPack/cmCPackRPMGenerator.h2
3 files changed, 28 insertions, 8 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index d9f2b47..92e5b6a 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -741,7 +741,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
* - Because it was already used for component install
* in order to put things in subdirs...
*/
- cmSystemTools::PutEnv((std::string("DESTDIR=")+tempInstallDirectory).c_str());
+ cmSystemTools::PutEnv(
+ (std::string("DESTDIR=")+tempInstallDirectory).c_str()
+ );
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl);
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index a06b626..34e93d3 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -44,7 +44,7 @@ int cmCPackRPMGenerator::PackageFiles()
<< toplevel << std::endl);
/* Are we in the component packaging case */
- if (!this->ComponentGroups.empty())
+ if (SupportsComponentInstallation() & (!this->ComponentGroups.empty()))
{
/* Reset package file name list it will be populated during the
* component packaging run*/
@@ -57,8 +57,12 @@ int cmCPackRPMGenerator::PackageFiles()
compIt!=this->Components.end(); ++compIt )
{
std::string localToplevel(initialTopLevel);
- std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel.c_str()));
- std::string outputFileName(std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(toplevel.c_str())
+ );
+ std::string outputFileName(
+ std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")
+ )
+"-"+compIt->first + this->GetOutputExtension());
localToplevel += "/"+ compIt->first;
@@ -68,12 +72,14 @@ int cmCPackRPMGenerator::PackageFiles()
/* replace proposed CPACK_OUTPUT_FILE_NAME */
this->SetOption("CPACK_OUTPUT_FILE_NAME",outputFileName.c_str());
/* replace the TEMPORARY package file name */
- this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",packageFileName.c_str());
+ this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",
+ packageFileName.c_str());
this->SetOption("CPACK_RPM_PACKAGE_COMPONENT",compIt->first.c_str());
if (!this->ReadListFile("CPackRPM.cmake"))
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error while execution CPackRPM.cmake" << std::endl);
retval = 0;
}
@@ -86,7 +92,8 @@ int cmCPackRPMGenerator::PackageFiles()
{
if (!this->ReadListFile("CPackRPM.cmake"))
{
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Error while execution CPackRPM.cmake" << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error while execution CPackRPM.cmake" << std::endl);
retval = 0;
}
}
@@ -99,4 +106,15 @@ int cmCPackRPMGenerator::PackageFiles()
return retval;
}
+bool cmCPackRPMGenerator::SupportsComponentInstallation() const
+ {
+ if (IsSet("CPACK_RPM_COMPONENT_INSTALL"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
diff --git a/Source/CPack/cmCPackRPMGenerator.h b/Source/CPack/cmCPackRPMGenerator.h
index 9063ea7..57d5cca 100644
--- a/Source/CPack/cmCPackRPMGenerator.h
+++ b/Source/CPack/cmCPackRPMGenerator.h
@@ -39,7 +39,7 @@ protected:
virtual int InitializeInternal();
virtual int PackageFiles();
virtual const char* GetOutputExtension() { return ".rpm"; }
- virtual bool SupportsComponentInstallation() const {return true;}
+ virtual bool SupportsComponentInstallation() const;
};