install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS

In a per-component installation the generated installation scripts
are invoked once for each component.

Per default custom installation script code added by install(CODE|SCRIPT)
only runs for one specific component in this context.

The new ALL_COMPONENTS option allows custom script code to be run once
for each component being installed.
This commit is contained in:
Nils Gladitz
2021-05-19 10:15:16 +02:00
parent 82fd8b6ba3
commit 99ff75455e
25 changed files with 133 additions and 20 deletions

View File

@@ -33,7 +33,8 @@ public:
cmInstallGenerator(std::string destination,
std::vector<std::string> const& configurations,
std::string component, MessageLevel message,
bool exclude_from_all, cmListFileBacktrace backtrace);
bool exclude_from_all, bool all_components,
cmListFileBacktrace backtrace);
~cmInstallGenerator() override;
cmInstallGenerator(cmInstallGenerator const&) = delete;
@@ -65,6 +66,7 @@ public:
std::string const& GetComponent() const { return this->Component; }
bool GetExcludeFromAll() const { return this->ExcludeFromAll; }
bool GetAllComponentsFlag() const { return this->AllComponents; }
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
@@ -79,5 +81,6 @@ protected:
std::string const Component;
MessageLevel const Message;
bool const ExcludeFromAll;
bool const AllComponents;
cmListFileBacktrace const Backtrace;
};