summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommandArguments.cxx
diff options
context:
space:
mode:
authorNick Lewis <nick.lewis@amag.com>2016-02-01 10:01:39 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-04 14:16:56 (GMT)
commit18ce97c4a20b7da4e11006ad80f17cb55e128db1 (patch)
tree411ffa3d6c2fa573a2b69be606810859b72d729f /Source/cmInstallCommandArguments.cxx
parentbfd1b3aabaa9a2ec46ca6ebfa50d56dfa8846fb3 (diff)
downloadCMake-18ce97c4a20b7da4e11006ad80f17cb55e128db1.zip
CMake-18ce97c4a20b7da4e11006ad80f17cb55e128db1.tar.gz
CMake-18ce97c4a20b7da4e11006ad80f17cb55e128db1.tar.bz2
install: Add EXCLUDE_FROM_ALL option (#14921)
Let us take an example of a project that has some tests in a component that need to be installed into a dedicated test package. The user expectation is that the result could be achieved by typing the following: make make tests make install DESTDIR=/testpkgs make install-tests However this results in test components in the default installation as well as the testpkg. Add an EXCLUDE_FROM_ALL option to the install() command to tell it that the installation rule should not be included unless its component is explicitly specified for installation.
Diffstat (limited to 'Source/cmInstallCommandArguments.cxx')
-rw-r--r--Source/cmInstallCommandArguments.cxx30
1 files changed, 22 insertions, 8 deletions
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 236ca1f..6ded365 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -27,14 +27,15 @@ cmInstallCommandArguments::cmInstallCommandArguments(
const std::string& defaultComponent)
:Parser()
,ArgumentGroup()
-,Destination (&Parser, "DESTINATION" , &ArgumentGroup)
-,Component (&Parser, "COMPONENT" , &ArgumentGroup)
-,Rename (&Parser, "RENAME" , &ArgumentGroup)
-,Permissions (&Parser, "PERMISSIONS" , &ArgumentGroup)
-,Configurations(&Parser, "CONFIGURATIONS", &ArgumentGroup)
-,Optional (&Parser, "OPTIONAL" , &ArgumentGroup)
-,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup)
-,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup)
+,Destination (&Parser, "DESTINATION" , &ArgumentGroup)
+,Component (&Parser, "COMPONENT" , &ArgumentGroup)
+,ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup)
+,Rename (&Parser, "RENAME" , &ArgumentGroup)
+,Permissions (&Parser, "PERMISSIONS" , &ArgumentGroup)
+,Configurations(&Parser, "CONFIGURATIONS" , &ArgumentGroup)
+,Optional (&Parser, "OPTIONAL" , &ArgumentGroup)
+,NamelinkOnly (&Parser, "NAMELINK_ONLY" , &ArgumentGroup)
+,NamelinkSkip (&Parser, "NAMELINK_SKIP" , &ArgumentGroup)
,GenericArguments(0)
,DefaultComponentName(defaultComponent)
{
@@ -110,6 +111,19 @@ bool cmInstallCommandArguments::GetOptional() const
return false;
}
+bool cmInstallCommandArguments::GetExcludeFromAll() const
+{
+ if (this->ExcludeFromAll.IsEnabled())
+ {
+ return true;
+ }
+ if (this->GenericArguments!=0)
+ {
+ return this->GenericArguments->GetExcludeFromAll();
+ }
+ return false;
+}
+
bool cmInstallCommandArguments::GetNamelinkOnly() const
{
if (this->NamelinkOnly.IsEnabled())