summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-09 15:10:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-09 15:10:15 (GMT)
commit3b8c0fbfd787fc21137b0e2f511e7c91b3e70227 (patch)
treee26136e90d9b8de322979130c584093051ba2f1b /Source/cmInstallCommand.cxx
parent8aec0f955a5e6a11cea6004a31fbe88760db939f (diff)
parent586e56d0ef8c9bda2e5c24371ad7bb0b95a4395f (diff)
downloadCMake-3b8c0fbfd787fc21137b0e2f511e7c91b3e70227.zip
CMake-3b8c0fbfd787fc21137b0e2f511e7c91b3e70227.tar.gz
CMake-3b8c0fbfd787fc21137b0e2f511e7c91b3e70227.tar.bz2
Merge topic 'install-EXCLUDE_FROM_ALL'
586e56d0 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL' d321c196 Tests: Add cases for install() command EXCLUDE_FROM_ALL option 18ce97c4 install: Add EXCLUDE_FROM_ALL option (#14921)
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx31
1 files changed, 27 insertions, 4 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 2d78a41..26a1485 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -33,6 +33,7 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target,
impLib, args.GetPermissions().c_str(),
args.GetConfigurations(), args.GetComponent().c_str(),
message,
+ args.GetExcludeFromAll(),
args.GetOptional() || forceOpt);
}
@@ -48,7 +49,8 @@ static cmInstallFilesGenerator* CreateInstallFilesGenerator(
programs, args.GetPermissions().c_str(),
args.GetConfigurations(), args.GetComponent().c_str(),
message,
- args.GetRename().c_str(), args.GetOptional());
+ args.GetExcludeFromAll(), args.GetRename().c_str(),
+ args.GetOptional());
}
@@ -117,6 +119,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
int componentCount = 0;
bool doing_script = false;
bool doing_code = false;
+ bool exclude_from_all = false;
// Scan the args once for COMPONENT. Only allow one.
//
@@ -128,6 +131,10 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
++i;
component = args[i];
}
+ if(args[i] == "EXCLUDE_FROM_ALL")
+ {
+ exclude_from_all = true;
+ }
}
if(componentCount>1)
@@ -175,7 +182,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
}
this->Makefile->AddInstallGenerator(
new cmInstallScriptGenerator(script.c_str(), false,
- component.c_str()));
+ component.c_str(), exclude_from_all));
}
else if(doing_code)
{
@@ -183,7 +190,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
std::string code = args[i];
this->Makefile->AddInstallGenerator(
new cmInstallScriptGenerator(code.c_str(), true,
- component.c_str()));
+ component.c_str(), exclude_from_all));
}
}
@@ -949,6 +956,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
Doing doing = DoingDirs;
bool in_match_mode = false;
bool optional = false;
+ bool exclude_from_all = false;
bool message_never = false;
std::vector<std::string> dirs;
const char* destination = 0;
@@ -1130,6 +1138,19 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Switch to setting the component property.
doing = DoingComponent;
}
+ else if(args[i] == "EXCLUDE_FROM_ALL")
+ {
+ if(in_match_mode)
+ {
+ std::ostringstream e;
+ e << args[0] << " does not allow \""
+ << args[i] << "\" after PATTERN or REGEX.";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ exclude_from_all = true;
+ doing = DoingNone;
+ }
else if(doing == DoingDirs)
{
// Convert this directory to a full path.
@@ -1273,6 +1294,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
configurations,
component.c_str(),
message,
+ exclude_from_all,
literal_args.c_str(),
optional));
@@ -1403,7 +1425,8 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
exportSet,
ica.GetDestination().c_str(),
ica.GetPermissions().c_str(), ica.GetConfigurations(),
- ica.GetComponent().c_str(), message, fname.c_str(),
+ ica.GetComponent().c_str(), message,
+ ica.GetExcludeFromAll(), fname.c_str(),
name_space.GetCString(), exportOld.IsEnabled());
this->Makefile->AddInstallGenerator(exportGenerator);