summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallScriptGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2007-10-15 11:08:15 (GMT)
committerDavid Cole <david.cole@kitware.com>2007-10-15 11:08:15 (GMT)
commitc8e832dcf5d1477192e19bf521f684c953d7751d (patch)
treed7a828f9c03d484a1689483454674d7f635e13ca /Source/cmInstallScriptGenerator.cxx
parentfa513be6579b1b5074418aa1fe099e91eb0c8c55 (diff)
downloadCMake-c8e832dcf5d1477192e19bf521f684c953d7751d.zip
CMake-c8e832dcf5d1477192e19bf521f684c953d7751d.tar.gz
CMake-c8e832dcf5d1477192e19bf521f684c953d7751d.tar.bz2
BUG: Fix #5868 - add COMPONENT handling to the SCRIPT and CODE signatures of the INSTALL command.
Diffstat (limited to 'Source/cmInstallScriptGenerator.cxx')
-rw-r--r--Source/cmInstallScriptGenerator.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index ca4cbbb..b7e63de 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -18,8 +18,9 @@
//----------------------------------------------------------------------------
cmInstallScriptGenerator
-::cmInstallScriptGenerator(const char* script, bool code):
- cmInstallGenerator(0, std::vector<std::string>(), 0),
+::cmInstallScriptGenerator(const char* script, bool code,
+ const char* component) :
+ cmInstallGenerator(0, std::vector<std::string>(), component),
Script(script), Code(code)
{
}
@@ -33,12 +34,19 @@ cmInstallScriptGenerator
//----------------------------------------------------------------------------
void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
{
+ Indent indent;
+ std::string component_test =
+ this->CreateComponentTest(this->Component.c_str());
+ os << indent << "IF(" << component_test << ")\n";
+
if(this->Code)
{
- os << this->Script << "\n";
+ os << indent.Next() << this->Script << "\n";
}
else
{
- os << "INCLUDE(\"" << this->Script << "\")\n";
+ os << indent.Next() << "INCLUDE(\"" << this->Script << "\")\n";
}
+
+ os << indent << "ENDIF(" << component_test << ")\n\n";
}