2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2006-02-19 23:25:27 +03:00
|
|
|
#include "cmInstallScriptGenerator.h"
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
cmInstallScriptGenerator
|
2007-10-15 15:08:15 +04:00
|
|
|
::cmInstallScriptGenerator(const char* script, bool code,
|
|
|
|
const char* component) :
|
|
|
|
cmInstallGenerator(0, std::vector<std::string>(), component),
|
2006-04-13 06:04:50 +04:00
|
|
|
Script(script), Code(code)
|
2006-02-19 23:25:27 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
cmInstallScriptGenerator
|
|
|
|
::~cmInstallScriptGenerator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
|
|
|
|
{
|
2007-10-15 15:08:15 +04:00
|
|
|
Indent indent;
|
|
|
|
std::string component_test =
|
|
|
|
this->CreateComponentTest(this->Component.c_str());
|
|
|
|
os << indent << "IF(" << component_test << ")\n";
|
|
|
|
|
2006-04-13 06:04:50 +04:00
|
|
|
if(this->Code)
|
|
|
|
{
|
2007-10-15 15:08:15 +04:00
|
|
|
os << indent.Next() << this->Script << "\n";
|
2006-04-13 06:04:50 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-10-15 15:08:15 +04:00
|
|
|
os << indent.Next() << "INCLUDE(\"" << this->Script << "\")\n";
|
2006-04-13 06:04:50 +04:00
|
|
|
}
|
2007-10-15 15:08:15 +04:00
|
|
|
|
|
|
|
os << indent << "ENDIF(" << component_test << ")\n\n";
|
2006-02-19 23:25:27 +03:00
|
|
|
}
|