summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-20 13:25:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-20 13:25:36 (GMT)
commit6f656d6b58886a07c773fb83ec6f1a9633204af5 (patch)
tree984218ce4e4910b7473421d4f9a2d6925745998b /Source/cmInstallGenerator.cxx
parent35ea23a618a83902a83659a1f422a0f3af90c249 (diff)
parent99ff75455ece5ec4add771a2de93b237ab858d08 (diff)
downloadCMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.zip
CMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.tar.gz
CMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.tar.bz2
Merge topic 'install-script-all-components'
99ff75455e install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6140
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r--Source/cmInstallGenerator.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 98e3766..cf5f45e 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -11,12 +11,13 @@
cmInstallGenerator::cmInstallGenerator(
std::string destination, std::vector<std::string> const& configurations,
std::string component, MessageLevel message, bool exclude_from_all,
- cmListFileBacktrace backtrace)
+ bool all_components, cmListFileBacktrace backtrace)
: cmScriptGenerator("CMAKE_INSTALL_CONFIG_NAME", configurations)
, Destination(std::move(destination))
, Component(std::move(component))
, Message(message)
, ExcludeFromAll(exclude_from_all)
+ , AllComponents(all_components)
, Backtrace(std::move(backtrace))
{
}
@@ -160,15 +161,20 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
Indent indent;
// Begin this block of installation.
- std::string component_test =
- this->CreateComponentTest(this->Component, this->ExcludeFromAll);
- os << indent << "if(" << component_test << ")\n";
+ if (!this->AllComponents) {
+ std::string component_test =
+ this->CreateComponentTest(this->Component, this->ExcludeFromAll);
+ os << indent << "if(" << component_test << ")\n";
+ }
// Generate the script possibly with per-configuration code.
- this->GenerateScriptConfigs(os, indent.Next());
+ this->GenerateScriptConfigs(os,
+ this->AllComponents ? indent : indent.Next());
// End this block of installation.
- os << indent << "endif()\n\n";
+ if (!this->AllComponents) {
+ os << indent << "endif()\n\n";
+ }
}
bool cmInstallGenerator::InstallsForConfig(const std::string& config)