summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-07-02 15:02:52 (GMT)
committerBrad King <brad.king@kitware.com>2007-07-02 15:02:52 (GMT)
commitc83ae4673d1bdf72bf27eb6e60c877b1156a672a (patch)
tree53d89845aec8f5fbf25bf45317bed251658cf128 /Source/cmInstallGenerator.h
parentc8b263c674d9c75232b4317b57259b1bbff88016 (diff)
downloadCMake-c83ae4673d1bdf72bf27eb6e60c877b1156a672a.zip
CMake-c83ae4673d1bdf72bf27eb6e60c877b1156a672a.tar.gz
CMake-c83ae4673d1bdf72bf27eb6e60c877b1156a672a.tar.bz2
ENH: Improved indentation of generated cmake_install.cmake code.
Diffstat (limited to 'Source/cmInstallGenerator.h')
-rw-r--r--Source/cmInstallGenerator.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index 717f12b..9cd42f8 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -21,6 +21,32 @@
class cmLocalGenerator;
+class cmInstallGeneratorIndent
+{
+public:
+ cmInstallGeneratorIndent(): Level(0) {}
+ cmInstallGeneratorIndent(int level): Level(level) {}
+ void Write(std::ostream& os) const
+ {
+ for(int i=0; i < this->Level; ++i)
+ {
+ os << " ";
+ }
+ }
+ cmInstallGeneratorIndent Next(int step = 2) const
+ {
+ return cmInstallGeneratorIndent(this->Level + step);
+ }
+private:
+ int Level;
+};
+inline std::ostream& operator<<(std::ostream& os,
+ cmInstallGeneratorIndent const& indent)
+{
+ indent.Write(os);
+ return os;
+}
+
/** \class cmInstallGenerator
* \brief Support class for generating install scripts.
*
@@ -46,7 +72,8 @@ public:
= std::vector<std::string>(),
const char* component = 0,
const char* rename = 0,
- const char* literal_args = 0
+ const char* literal_args = 0,
+ cmInstallGeneratorIndent const& indent = cmInstallGeneratorIndent()
);
const char* GetDestination() const {return this->Destination.c_str();}