1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallScriptGenerator.cxx,v $
6 Date: $Date: 2007-10-15 11:08:10 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmInstallScriptGenerator.h"
19 //----------------------------------------------------------------------------
20 cmInstallScriptGenerator
21 ::cmInstallScriptGenerator(const char* script
, bool code
,
22 const char* component
) :
23 cmInstallGenerator(0, std::vector
<std::string
>(), component
),
24 Script(script
), Code(code
)
28 //----------------------------------------------------------------------------
29 cmInstallScriptGenerator
30 ::~cmInstallScriptGenerator()
34 //----------------------------------------------------------------------------
35 void cmInstallScriptGenerator::GenerateScript(std::ostream
& os
)
38 std::string component_test
=
39 this->CreateComponentTest(this->Component
.c_str());
40 os
<< indent
<< "IF(" << component_test
<< ")\n";
44 os
<< indent
.Next() << this->Script
<< "\n";
48 os
<< indent
.Next() << "INCLUDE(\"" << this->Script
<< "\")\n";
51 os
<< indent
<< "ENDIF(" << component_test
<< ")\n\n";