mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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:
@@ -122,6 +122,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
|
||||
// Use a file install generator.
|
||||
const char* no_permissions = "";
|
||||
const char* no_rename = "";
|
||||
bool no_exclude_from_all = false;
|
||||
std::string no_component = this->Makefile->GetSafeDefinition(
|
||||
"CMAKE_INSTALL_DEFAULT_COMPONENT_NAME");
|
||||
std::vector<std::string> no_configurations;
|
||||
@@ -131,7 +132,8 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
|
||||
new cmInstallFilesGenerator(this->Files,
|
||||
destination.c_str(), false,
|
||||
no_permissions, no_configurations,
|
||||
no_component.c_str(), message, no_rename));
|
||||
no_component.c_str(), message,
|
||||
no_exclude_from_all, no_rename));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user