diff options
author | David Cole <david.cole@kitware.com> | 2007-10-15 11:08:15 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2007-10-15 11:08:15 (GMT) |
commit | c8e832dcf5d1477192e19bf521f684c953d7751d (patch) | |
tree | d7a828f9c03d484a1689483454674d7f635e13ca /Source/cmInstallScriptGenerator.cxx | |
parent | fa513be6579b1b5074418aa1fe099e91eb0c8c55 (diff) | |
download | CMake-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.cxx | 16 |
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"; } |