1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmInstallScriptGenerator.h"
14 //----------------------------------------------------------------------------
15 cmInstallScriptGenerator
16 ::cmInstallScriptGenerator(const char* script, bool code,
17 const char* component) :
18 cmInstallGenerator(0, std::vector<std::string>(), component),
19 Script(script), Code(code)
23 //----------------------------------------------------------------------------
24 cmInstallScriptGenerator
25 ::~cmInstallScriptGenerator()
29 //----------------------------------------------------------------------------
30 void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
33 std::string component_test =
34 this->CreateComponentTest(this->Component.c_str());
35 os << indent << "IF(" << component_test << ")\n";
39 os << indent.Next() << this->Script << "\n";
43 os << indent.Next() << "INCLUDE(\"" << this->Script << "\")\n";
46 os << indent << "ENDIF(" << component_test << ")\n\n";