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.
This commit is contained in:
Nick Lewis
2016-02-01 10:01:39 +00:00
committed by Brad King
parent bfd1b3aaba
commit 18ce97c4a2
19 changed files with 113 additions and 41 deletions
+5 -2
View File
@@ -36,7 +36,8 @@ public:
cmInstallGenerator(const char* destination,
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message);
MessageLevel message,
bool exclude_from_all);
virtual ~cmInstallGenerator();
void AddInstallRule(
@@ -67,12 +68,14 @@ public:
protected:
virtual void GenerateScript(std::ostream& os);
std::string CreateComponentTest(const char* component);
std::string CreateComponentTest(const char* component,
bool exclude_from_all);
// Information shared by most generator types.
std::string Destination;
std::string Component;
MessageLevel Message;
bool ExcludeFromAll;
};
#endif