summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallFilesCommand.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-05-24 17:37:54 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-05-24 17:37:54 (GMT)
commit59bdb879e8355537a30aa5a39b72ad54146d2c9b (patch)
tree23fc51c3b277658428f693a3b615abe1f5243581 /Source/cmInstallFilesCommand.cxx
parent1e3dde2ddb20457d6a5ca3399d3add46f37c2516 (diff)
parentb71e731b9b91f9f79ab49838baae5bb5ab42c30e (diff)
downloadCMake-59bdb879e8355537a30aa5a39b72ad54146d2c9b.zip
CMake-59bdb879e8355537a30aa5a39b72ad54146d2c9b.tar.gz
CMake-59bdb879e8355537a30aa5a39b72ad54146d2c9b.tar.bz2
Merge topic 'MakeDefaultInstallComponentNameConfigurable'
b71e731 -add docs for ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} 7ced073 make default install component name configurable b6fba35 -strip trailing whitespace
Diffstat (limited to 'Source/cmInstallFilesCommand.cxx')
-rw-r--r--Source/cmInstallFilesCommand.cxx32
1 files changed, 17 insertions, 15 deletions
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index 0ec3030..cc62c4b 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -34,7 +34,7 @@ bool cmInstallFilesCommand
if((args.size() > 1) && (args[1] == "FILES"))
{
- this->IsFilesForm = true;
+ this->IsFilesForm = true;
for(std::vector<std::string>::const_iterator s = args.begin()+2;
s != args.end(); ++s)
{
@@ -53,45 +53,46 @@ bool cmInstallFilesCommand
this->FinalArgs.push_back(*s);
}
}
-
+
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
- ->AddInstallComponent("Unspecified");
+ ->AddInstallComponent(this->Makefile->GetSafeDefinition(
+ "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"));
return true;
}
-void cmInstallFilesCommand::FinalPass()
+void cmInstallFilesCommand::FinalPass()
{
// No final pass for "FILES" form of arguments.
if(this->IsFilesForm)
{
return;
}
-
+
std::string testf;
std::string ext = this->FinalArgs[0];
-
+
// two different options
if (this->FinalArgs.size() > 1)
{
// now put the files into the list
std::vector<std::string>::iterator s = this->FinalArgs.begin();
++s;
- // for each argument, get the files
+ // for each argument, get the files
for (;s != this->FinalArgs.end(); ++s)
{
// replace any variables
std::string temps = *s;
if (cmSystemTools::GetFilenamePath(temps).size() > 0)
{
- testf = cmSystemTools::GetFilenamePath(temps) + "/" +
+ testf = cmSystemTools::GetFilenamePath(temps) + "/" +
cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext;
}
else
{
testf = cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext;
}
-
+
// add to the result
this->Files.push_back(this->FindInstallSource(testf.c_str()));
}
@@ -102,9 +103,9 @@ void cmInstallFilesCommand::FinalPass()
std::string regex = this->FinalArgs[0].c_str();
cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(),
regex.c_str(), files);
-
+
std::vector<std::string>::iterator s = files.begin();
- // for each argument, get the files
+ // for each argument, get the files
for (;s != files.end(); ++s)
{
this->Files.push_back(this->FindInstallSource(s->c_str()));
@@ -128,13 +129,14 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
// Use a file install generator.
const char* no_permissions = "";
const char* no_rename = "";
- const char* no_component = "Unspecified";
+ std::string no_component = this->Makefile->GetSafeDefinition(
+ "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME");
std::vector<std::string> no_configurations;
this->Makefile->AddInstallGenerator(
new cmInstallFilesGenerator(this->Files,
destination.c_str(), false,
no_permissions, no_configurations,
- no_component, no_rename));
+ no_component.c_str(), no_rename));
}
@@ -151,7 +153,7 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const
// This is a full path.
return name;
}
-
+
// This is a relative path.
std::string tb = this->Makefile->GetCurrentOutputDirectory();
tb += "/";
@@ -159,7 +161,7 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const
std::string ts = this->Makefile->GetCurrentDirectory();
ts += "/";
ts += name;
-
+
if(cmSystemTools::FileExists(tb.c_str()))
{
// The file exists in the binary tree. Use it.