summaryrefslogtreecommitdiff
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-02-14 02:21:12 (GMT)
committerAnas Nashif <anas.nashif@intel.com>2013-02-14 02:21:12 (GMT)
commitef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (patch)
tree6501b44707b5c6a88fa5f817adee1a3ffcb0012d /Source/CPack/cmCPackGenerator.cxx
parent035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (diff)
downloadcmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.zip
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.gz
cmake-ef8aa19c33e83ff019595fd7f8fdc29c35c336a3.tar.bz2
Imported Upstream version 2.8.10.2upstream/2.8.10.2
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx90
1 files changed, 45 insertions, 45 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0177653..e964696 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -105,7 +105,7 @@ int cmCPackGenerator::PrepareNames()
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
return 0;
}
- std::string outName = pfname;
+ std::string outName = pfname;
tempDirectory += "/" + outName;
if(!this->GetOutputExtension())
{
@@ -149,7 +149,7 @@ int cmCPackGenerator::PrepareNames()
if ( !cmSystemTools::FileExists(descFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find description file name: ["
+ "Cannot find description file name: ["
<< descFileName << "]" << std::endl);
return 0;
}
@@ -207,7 +207,7 @@ int cmCPackGenerator::InstallProject()
if ( !cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< (tempInstallDirectory ? tempInstallDirectory : "(NULL}")
<< std::endl);
return 0;
@@ -584,7 +584,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
!(this->IsSet("CPACK_MONOLITHIC_INSTALL")))
{
// Determine the installation types for this project (if provided).
- std::string installTypesVar = "CPACK_"
+ std::string installTypesVar = "CPACK_"
+ cmSystemTools::UpperCase(installComponent) + "_INSTALL_TYPES";
const char *installTypes = this->GetOption(installTypesVar.c_str());
if (installTypes && *installTypes)
@@ -596,16 +596,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
installTypeIt != installTypesVector.end();
++installTypeIt)
{
- this->GetInstallationType(installProjectName.c_str(),
+ this->GetInstallationType(installProjectName.c_str(),
installTypeIt->c_str());
}
}
// Determine the set of components that will be used in this project
- std::string componentsVar
+ std::string componentsVar
= "CPACK_COMPONENTS_" + cmSystemTools::UpperCase(installComponent);
const char *components = this->GetOption(componentsVar.c_str());
- if (components && *components)
+ if (components && *components)
{
cmSystemTools::ExpandListArgument(components, componentsVector);
std::vector<std::string>::iterator compIt;
@@ -688,10 +688,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if (componentInstall)
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- Install component: " << installComponent
+ "- Install component: " << installComponent
<< std::endl);
}
-
+
cmake cm;
cm.AddCMakePaths();
cm.SetProgressCallback(cmCPackGeneratorProgress, this);
@@ -758,7 +758,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
"- Using DESTDIR + CPACK_INSTALL_PREFIX... (mf->AddDefinition)"
<< std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
+ "- Setting CMAKE_INSTALL_PREFIX to '" << dir << "'"
<< std::endl);
// Make sure that DESTDIR + CPACK_INSTALL_PREFIX directory
@@ -792,7 +792,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if ( !cmsys::SystemTools::MakeDirectory(dir.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< dir << std::endl);
return 0;
}
@@ -806,7 +806,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
tempInstallDirectory.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
+ "Problem creating temporary directory: "
<< tempInstallDirectory << std::endl);
return 0;
}
@@ -832,7 +832,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
installComponent.c_str());
}
- // strip on TRUE, ON, 1, one or several file names, but not on
+ // strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
if (!cmSystemTools::IsOff(this->GetOption("CPACK_STRIP_FILES")))
{
@@ -855,7 +855,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// If CPack was asked to warn on ABSOLUTE INSTALL DESTINATION
// then forward request to cmake_install.cmake script
- if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ if (this->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -865,7 +865,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// then ask cmake_install.cmake script to error out
// as soon as it occurs (before installing file)
if (!SupportsAbsoluteDestination() ||
- this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ this->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -905,7 +905,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
localFileName =
cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
localFileName =
- localFileName.substr(localFileName.find('/')+1,
+ localFileName.substr(localFileName.find_first_not_of('/'),
std::string::npos);
Components[installComponent].Files.push_back(localFileName);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
@@ -1024,7 +1024,7 @@ int cmCPackGenerator::DoPackage()
= this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if ( cmSystemTools::FileExists(toplevelDirectory) )
{
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Remove toplevel directory: "
<< toplevelDirectory << std::endl);
if ( !cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory) )
@@ -1153,10 +1153,10 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf)
// set the running generator name
this->SetOption("CPACK_GENERATOR", this->Name.c_str());
// Load the project specific config file
- const char* config =
+ const char* config =
this->GetOption("CPACK_PROJECT_CONFIG_FILE");
if(config)
- {
+ {
mf->ReadListFile(config);
}
int result = this->InitializeInternal();
@@ -1193,13 +1193,13 @@ bool cmCPackGenerator::IsOn(const char* name) const
//----------------------------------------------------------------------
const char* cmCPackGenerator::GetOption(const char* op) const
-{
+{
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
- {
- cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Warning, GetOption return NULL for: "
- << op
+ << op
<< std::endl);
}
return ret;
@@ -1222,7 +1222,7 @@ int cmCPackGenerator::SetCMakeRoot()
return 1;
}
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Could not find CMAKE_ROOT !!!"
+ "Could not find CMAKE_ROOT !!!"
<< std::endl
<< "CMake has most likely not been installed correctly."
<< std::endl
@@ -1516,14 +1516,14 @@ cmCPackGenerator::GetInstallationType(const char *projectName,
(void) projectName;
bool hasInstallationType = this->InstallationTypes.count(name) != 0;
cmCPackInstallationType *installType = &this->InstallationTypes[name];
- if (!hasInstallationType)
+ if (!hasInstallationType)
{
// Define the installation type
- std::string macroPrefix = "CPACK_INSTALL_TYPE_"
+ std::string macroPrefix = "CPACK_INSTALL_TYPE_"
+ cmsys::SystemTools::UpperCase(name);
installType->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1546,13 +1546,13 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
{
bool hasComponent = this->Components.count(name) != 0;
cmCPackComponent *component = &this->Components[name];
- if (!hasComponent)
+ if (!hasComponent)
{
// Define the component
- std::string macroPrefix = "CPACK_COMPONENT_"
+ std::string macroPrefix = "CPACK_COMPONENT_"
+ cmsys::SystemTools::UpperCase(name);
component->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1562,7 +1562,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
{
component->DisplayName = component->Name;
}
- component->IsHidden
+ component->IsHidden
= this->IsSet((macroPrefix + "_HIDDEN").c_str());
component->IsRequired
= this->IsSet((macroPrefix + "_REQUIRED").c_str());
@@ -1572,7 +1572,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
= this->IsSet((macroPrefix + "_DOWNLOADED").c_str())
|| cmSystemTools::IsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
- const char* archiveFile = this->GetOption((macroPrefix +
+ const char* archiveFile = this->GetOption((macroPrefix +
"_ARCHIVE_FILE").c_str());
if (archiveFile && *archiveFile)
{
@@ -1580,7 +1580,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
}
const char* groupName = this->GetOption((macroPrefix + "_GROUP").c_str());
- if (groupName && *groupName)
+ if (groupName && *groupName)
{
component->Group = GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
@@ -1598,15 +1598,15 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
}
// Determine the installation types.
- const char *installTypes
+ const char *installTypes
= this->GetOption((macroPrefix + "_INSTALL_TYPES").c_str());
- if (installTypes && *installTypes)
+ if (installTypes && *installTypes)
{
std::vector<std::string> installTypesVector;
cmSystemTools::ExpandListArgument(installTypes, installTypesVector);
std::vector<std::string>::iterator installTypesIt;
- for (installTypesIt = installTypesVector.begin();
- installTypesIt != installTypesVector.end();
+ for (installTypesIt = installTypesVector.begin();
+ installTypesIt != installTypesVector.end();
++installTypesIt)
{
component->InstallationTypes.push_back(
@@ -1616,16 +1616,16 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
// Determine the component dependencies.
const char *depends = this->GetOption((macroPrefix + "_DEPENDS").c_str());
- if (depends && *depends)
+ if (depends && *depends)
{
std::vector<std::string> dependsVector;
cmSystemTools::ExpandListArgument(depends, dependsVector);
std::vector<std::string>::iterator dependIt;
- for (dependIt = dependsVector.begin();
- dependIt != dependsVector.end();
+ for (dependIt = dependsVector.begin();
+ dependIt != dependsVector.end();
++dependIt)
{
- cmCPackComponent *child = GetComponent(projectName,
+ cmCPackComponent *child = GetComponent(projectName,
dependIt->c_str());
component->Dependencies.push_back(child);
child->ReverseDependencies.push_back(component);
@@ -1640,15 +1640,15 @@ cmCPackComponentGroup*
cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
{
(void) projectName;
- std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
+ std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
+ cmsys::SystemTools::UpperCase(name);
bool hasGroup = this->ComponentGroups.count(name) != 0;
cmCPackComponentGroup *group = &this->ComponentGroups[name];
- if (!hasGroup)
+ if (!hasGroup)
{
// Define the group
group->Name = name;
- const char* displayName
+ const char* displayName
= this->GetOption((macroPrefix + "_DISPLAY_NAME").c_str());
if (displayName && *displayName)
{
@@ -1669,7 +1669,7 @@ cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
= this->IsSet((macroPrefix + "_BOLD_TITLE").c_str());
group->IsExpandedByDefault
= this->IsSet((macroPrefix + "_EXPANDED").c_str());
- const char* parentGroupName
+ const char* parentGroupName
= this->GetOption((macroPrefix + "_PARENT_GROUP").c_str());
if (parentGroupName && *parentGroupName)
{