summaryrefslogtreecommitdiff
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-05-13 15:44:37 +0200
committerAlex Neundorf <neundorf@kde.org>2012-05-14 22:19:12 +0200
commit7ced0732e875ab7cf4797ef33bd4b897bc41eb53 (patch)
tree8686f60bb78535f916ba5dfeec553cc9b2095cef /Source/cmInstallCommand.cxx
parentb6fba35411053e334072a1203493140c67f3d30a (diff)
downloadcmake-7ced0732e875ab7cf4797ef33bd4b897bc41eb53.tar.gz
make default install component name configurable
Until now an unnamed component was always named "Unspecified". Now this name is taken from the new cmake variable CMAKE_INSTALL_DEFAULT_COMPONENT_NAME, which is initialized to "Unspecified". But it can now be set to something project-specific, per directory Alex
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index d8522ee1e4..401673460f 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -55,6 +55,13 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->EnableInstallTarget();
+ this->DefaultComponentName = this->Makefile->GetSafeDefinition(
+ "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME");
+ if (this->DefaultComponentName.empty())
+ {
+ this->DefaultComponentName = "Unspecified";
+ }
+
// Switch among the command modes.
if(args[0] == "SCRIPT")
{
@@ -95,7 +102,7 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
//----------------------------------------------------------------------------
bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
{
- std::string component("Unspecified");
+ std::string component = this->DefaultComponentName;
int componentCount = 0;
bool doing_script = false;
bool doing_code = false;
@@ -222,7 +229,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// ARCHIVE, RUNTIME etc. (see above)
// These generic args also contain the targets and the export stuff
std::vector<std::string> unknownArgs;
- cmInstallCommandArguments genericArgs;
+ cmInstallCommandArguments genericArgs(this->DefaultComponentName);
cmCAStringVector targetList(&genericArgs.Parser, "TARGETS");
cmCAString exports(&genericArgs.Parser,"EXPORT", &genericArgs.ArgumentGroup);
targetList.Follows(0);
@@ -230,14 +237,14 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs);
bool success = genericArgs.Finalize();
- cmInstallCommandArguments archiveArgs;
- cmInstallCommandArguments libraryArgs;
- cmInstallCommandArguments runtimeArgs;
- cmInstallCommandArguments frameworkArgs;
- cmInstallCommandArguments bundleArgs;
- cmInstallCommandArguments privateHeaderArgs;
- cmInstallCommandArguments publicHeaderArgs;
- cmInstallCommandArguments resourceArgs;
+ cmInstallCommandArguments archiveArgs(this->DefaultComponentName);
+ cmInstallCommandArguments libraryArgs(this->DefaultComponentName);
+ cmInstallCommandArguments runtimeArgs(this->DefaultComponentName);
+ cmInstallCommandArguments frameworkArgs(this->DefaultComponentName);
+ cmInstallCommandArguments bundleArgs(this->DefaultComponentName);
+ cmInstallCommandArguments privateHeaderArgs(this->DefaultComponentName);
+ cmInstallCommandArguments publicHeaderArgs(this->DefaultComponentName);
+ cmInstallCommandArguments resourceArgs(this->DefaultComponentName);
// now parse the args for specific parts of the target (e.g. LIBRARY,
// RUNTIME, ARCHIVE etc.
@@ -788,7 +795,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
{
// This is the FILES mode.
bool programs = (args[0] == "PROGRAMS");
- cmInstallCommandArguments ica;
+ cmInstallCommandArguments ica(this->DefaultComponentName);
cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES");
files.Follows(0);
ica.ArgumentGroup.Follows(&files);
@@ -865,7 +872,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
std::string permissions_file;
std::string permissions_dir;
std::vector<std::string> configurations;
- std::string component = "Unspecified";
+ std::string component = this->DefaultComponentName;
std::string literal_args;
for(unsigned int i=1; i < args.size(); ++i)
{
@@ -1179,7 +1186,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
{
// This is the EXPORT mode.
- cmInstallCommandArguments ica;
+ cmInstallCommandArguments ica(this->DefaultComponentName);
cmCAString exp(&ica.Parser, "EXPORT");
cmCAString name_space(&ica.Parser, "NAMESPACE", &ica.ArgumentGroup);
cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);