[Cmake-commits] CMake branch, next, updated. v2.8.4-989-ged5bad8
Eric Noulard
eric.noulard at gmail.com
Tue Feb 22 18:03:38 EST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via ed5bad815d43106784547ebda938b4d58c257b47 (commit)
via 4deb308e82b8f9e56ce41eba211f330ff66902a3 (commit)
via 8c450f6287e45fa737de7d09a4f29ee7f4fdc9dd (commit)
from 1929bb27a92aeb99edf25684d0a0583ea0090d8b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed5bad815d43106784547ebda938b4d58c257b47
commit ed5bad815d43106784547ebda938b4d58c257b47
Merge: 1929bb2 4deb308
Author: Eric Noulard <eric.noulard at gmail.com>
AuthorDate: Tue Feb 22 18:03:36 2011 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 22 18:03:36 2011 -0500
Merge topic 'CPack-ChangeComponentNamingScheme' into next
4deb308 CPack Authorize DISPLAY_NAME usage in component package
8c450f6 CPack remove "-ALL" suffix for ALL-IN-ONE packages
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4deb308e82b8f9e56ce41eba211f330ff66902a3
commit 4deb308e82b8f9e56ce41eba211f330ff66902a3
Author: Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Tue Feb 22 23:49:49 2011 +0100
Commit: Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Tue Feb 22 23:49:49 2011 +0100
CPack Authorize DISPLAY_NAME usage in component package
Second (last) part fix of feature request #11814
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index ff88412..3c670a1 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -121,9 +121,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
<< std::endl);
// Begin the archive for this group
std::string packageFileName= std::string(toplevel);
- packageFileName += "/"
- +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
- +"-"+compGIt->first + this->GetOutputExtension();
+ packageFileName += "/"+
+ GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
+ compGIt->first,
+ true)
+ + this->GetOutputExtension();
// open a block in order to automatically close archive
// at the end of the block
{
@@ -154,9 +156,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
std::string packageFileName = std::string(toplevel);
localToplevel += "/"+ compIt->first;
- packageFileName += "/"
- +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
- +"-"+compIt->first + this->GetOutputExtension();
+ packageFileName += "/"+
+ GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
+ compIt->first,
+ false)
+ + this->GetOutputExtension();
{
DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
// Add the files of this component to the archive
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 69d9b8c..4cb4f36 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1309,10 +1309,51 @@ int cmCPackGenerator::PrepareGroupingKind()
return 1;
}
+//----------------------------------------------------------------------
std::string cmCPackGenerator::GetComponentInstallDirNameSuffix(
const std::string& componentName) {
return componentName;
}
+//----------------------------------------------------------------------
+std::string cmCPackGenerator::GetComponentPackageFileName(
+ const std::string& initialPackageFileName,
+ const std::string& groupOrComponentName,
+ bool isGroupName) {
+
+ /*
+ * the default behavior is to use the
+ * component [group] name as a suffix
+ */
+ std::string suffix="-"+groupOrComponentName;
+ /* check if we should use DISPLAY name */
+ std::string dispNameVar = "CPACK_"+Name+"_USE_DISPLAY_NAME_IN_FILENAME";
+ if (IsOn(dispNameVar.c_str()))
+ {
+ /* the component Group case */
+ if (isGroupName)
+ {
+ std::string groupDispVar = "CPACK_COMPONENT_GROUP_"
+ + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
+ const char* groupDispName = GetOption(groupDispVar.c_str());
+ if (groupDispName)
+ {
+ suffix = "-"+std::string(groupDispName);
+ }
+ }
+ /* the [single] component case */
+ else
+ {
+ std::string dispVar = "CPACK_COMPONENT_"
+ + cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
+ const char* dispName = GetOption(dispVar.c_str());
+ if(dispName)
+ {
+ suffix = "-"+std::string(dispName);
+ }
+ }
+ }
+ return initialPackageFileName + suffix;
+}
//----------------------------------------------------------------------
bool cmCPackGenerator::SupportsComponentInstallation() const
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index d4b1b16..0497d1c 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -145,6 +145,19 @@ protected:
const std::string& componentName);
/**
+ * CPack specific generator may mangle CPACK_PACKAGE_FILE_NAME
+ * with CPACK_COMPONENT_xxxx_<NAME>_DISPLAY_NAME if
+ * CPACK_<GEN>_USE_DISPLAY_NAME_IN_FILENAME is ON.
+ * @param[in] initialPackageFileName
+ * @param[in] groupOrComponentName
+ * @param[in] isGroupName
+ */
+ virtual std::string GetComponentPackageFileName(
+ const std::string& initialPackageFileName,
+ const std::string& groupOrComponentName,
+ bool isGroupName);
+
+ /**
* Package the list of files and/or components which
* has been prepared by the beginning of DoPackage.
* @pre @ref toplevel has been filled-in
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 995adf6..5803959 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -60,8 +60,10 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
cmSystemTools::GetParentDirectory(toplevel.c_str())
);
std::string outputFileName(
- std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
- +"-"+compGIt->first + this->GetOutputExtension()
+ GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
+ compGIt->first,
+ true)
+ + this->GetOutputExtension()
);
localToplevel += "/"+ compGIt->first;
@@ -98,9 +100,10 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
cmSystemTools::GetParentDirectory(toplevel.c_str())
);
std::string outputFileName(
- std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")
- )
- +"-"+compIt->first + this->GetOutputExtension());
+ GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
+ compIt->first,
+ false)
+ + this->GetOutputExtension());
localToplevel += "/"+ compIt->first;
/* replace the TEMP DIRECTORY with the component one */
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c450f6287e45fa737de7d09a4f29ee7f4fdc9dd
commit 8c450f6287e45fa737de7d09a4f29ee7f4fdc9dd
Author: Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Tue Feb 22 22:56:26 2011 +0100
Commit: Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Tue Feb 22 22:56:26 2011 +0100
CPack remove "-ALL" suffix for ALL-IN-ONE packages
First part fix of feature request 11814
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index febf205..ff88412 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -177,7 +177,7 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponent)
packageFileNames.push_back(std::string(toplevel));
packageFileNames[0] += "/"
+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
- +"-ALL" + this->GetOutputExtension();
+ + this->GetOutputExtension();
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging all groups in one package..."
"(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)"
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 2d675c1..995adf6 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -158,7 +158,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(bool allComponent)
);
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
- +"-ALL"+ this->GetOutputExtension()
+ + this->GetOutputExtension()
);
// all GROUP in one vs all COMPONENT in one
localToplevel += "/"+compInstDirName;
-----------------------------------------------------------------------
Summary of changes:
Source/CPack/cmCPackArchiveGenerator.cxx | 18 ++++++++-----
Source/CPack/cmCPackGenerator.cxx | 41 ++++++++++++++++++++++++++++++
Source/CPack/cmCPackGenerator.h | 13 +++++++++
Source/CPack/cmCPackRPMGenerator.cxx | 15 ++++++----
4 files changed, 74 insertions(+), 13 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list