summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-03-30 18:33:48 (GMT)
committerBrad King <brad.king@kitware.com>2006-03-30 18:33:48 (GMT)
commit08b14163ee2cc9cced08d80b2c81b29c83072229 (patch)
treeaabd429ef1d4d93a39429f192e5b56b5b0feb6b4 /Source/cmFileCommand.cxx
parent3cf3fc510febc42af0db07c71c7c3925724b3201 (diff)
downloadCMake-08b14163ee2cc9cced08d80b2c81b29c83072229.zip
CMake-08b14163ee2cc9cced08d80b2c81b29c83072229.tar.gz
CMake-08b14163ee2cc9cced08d80b2c81b29c83072229.tar.bz2
ENH: Added named component installation implementation. Installation behavior should be unchanged unless -DCOMPONENT=<name> is specified when cmake_install.cmake is invoked.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 588111b..408eec0 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -329,6 +329,7 @@ bool cmFileCommand::HandleInstallCommand(
const char* destdir = cmSystemTools::GetEnv("DESTDIR");
+ std::set<cmStdString> components;
std::vector<std::string> files;
int itype = cmTarget::INSTALL_FILES;
@@ -367,6 +368,7 @@ bool cmFileCommand::HandleInstallCommand(
bool in_files = false;
bool in_properties = false;
bool in_permissions = false;
+ bool in_components = false;
bool use_given_permissions = false;
mode_t permissions = 0;
bool optional = false;
@@ -380,6 +382,7 @@ bool cmFileCommand::HandleInstallCommand(
in_files = false;
in_properties = false;
in_permissions = false;
+ in_components = false;
}
else if ( *cstr == "TYPE" && i < args.size()-1 )
{
@@ -393,6 +396,7 @@ bool cmFileCommand::HandleInstallCommand(
in_properties = false;
in_files = false;
in_permissions = false;
+ in_components = false;
}
else if ( *cstr == "RENAME" && i < args.size()-1 )
{
@@ -401,12 +405,14 @@ bool cmFileCommand::HandleInstallCommand(
in_properties = false;
in_files = false;
in_permissions = false;
+ in_components = false;
}
else if ( *cstr == "PROPERTIES" )
{
in_properties = true;
in_files = false;
in_permissions = false;
+ in_components = false;
}
else if ( *cstr == "PERMISSIONS" )
{
@@ -414,12 +420,21 @@ bool cmFileCommand::HandleInstallCommand(
in_properties = false;
in_files = false;
in_permissions = true;
+ in_components = false;
+ }
+ else if ( *cstr == "COMPONENTS" )
+ {
+ in_properties = false;
+ in_files = false;
+ in_permissions = false;
+ in_components = true;
}
else if ( *cstr == "FILES" && !in_files)
{
in_files = true;
in_properties = false;
in_permissions = false;
+ in_components = false;
}
else if ( in_properties && i < args.size()-1 )
{
@@ -430,6 +445,10 @@ bool cmFileCommand::HandleInstallCommand(
{
files.push_back(*cstr);
}
+ else if ( in_components )
+ {
+ components.insert(*cstr);
+ }
else if(in_permissions && args[i] == "OWNER_READ")
{
permissions |= mode_owner_read;
@@ -488,6 +507,19 @@ bool cmFileCommand::HandleInstallCommand(
return false;
}
+ // Check for component-specific installation.
+ const char* cmake_install_component =
+ this->Makefile->GetDefinition("CMAKE_INSTALL_COMPONENT");
+ if(cmake_install_component && *cmake_install_component)
+ {
+ // This install rule applies only if it is associated with the
+ // current component.
+ if(components.find(cmake_install_component) == components.end())
+ {
+ return true;
+ }
+ }
+
int destDirLength = 0;
if ( destdir && *destdir )
{