diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2011-02-22 22:49:49 (GMT) |
---|---|---|
committer | Eric NOULARD <eric.noulard@gmail.com> | 2011-02-22 22:49:49 (GMT) |
commit | 4deb308e82b8f9e56ce41eba211f330ff66902a3 (patch) | |
tree | 2c502c55b9eb04976fd926e98e1744999cd5ec92 /Source/CPack/cmCPackGenerator.cxx | |
parent | 8c450f6287e45fa737de7d09a4f29ee7f4fdc9dd (diff) | |
download | CMake-4deb308e82b8f9e56ce41eba211f330ff66902a3.zip CMake-4deb308e82b8f9e56ce41eba211f330ff66902a3.tar.gz CMake-4deb308e82b8f9e56ce41eba211f330ff66902a3.tar.bz2 |
CPack Authorize DISPLAY_NAME usage in component package
Second (last) part fix of feature request #11814
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 41 |
1 files changed, 41 insertions, 0 deletions
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 |