2006-02-19 23:25:27 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#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
|
|
|
}
|