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.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#ifndef cmInstallGenerator_h
|
|
|
|
#define cmInstallGenerator_h
|
|
|
|
|
2009-03-16 17:39:56 +03:00
|
|
|
#include "cmScriptGenerator.h"
|
2006-02-19 23:25:27 +03:00
|
|
|
|
|
|
|
class cmLocalGenerator;
|
|
|
|
|
|
|
|
/** \class cmInstallGenerator
|
|
|
|
* \brief Support class for generating install scripts.
|
|
|
|
*
|
|
|
|
*/
|
2009-03-16 17:39:56 +03:00
|
|
|
class cmInstallGenerator: public cmScriptGenerator
|
2006-02-19 23:25:27 +03:00
|
|
|
{
|
|
|
|
public:
|
2007-07-02 22:56:57 +04:00
|
|
|
cmInstallGenerator(const char* destination,
|
|
|
|
std::vector<std::string> const& configurations,
|
|
|
|
const char* component);
|
2006-02-19 23:25:27 +03:00
|
|
|
virtual ~cmInstallGenerator();
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
void AddInstallRule(
|
|
|
|
std::ostream& os, int type,
|
2007-06-29 00:11:18 +04:00
|
|
|
std::vector<std::string> const& files,
|
|
|
|
bool optional = false,
|
2006-08-17 22:48:54 +04:00
|
|
|
const char* permissions_file = 0,
|
|
|
|
const char* permissions_dir = 0,
|
2006-08-22 00:55:03 +04:00
|
|
|
const char* rename = 0,
|
2007-07-02 19:02:52 +04:00
|
|
|
const char* literal_args = 0,
|
2009-03-16 17:39:56 +03:00
|
|
|
Indent const& indent = Indent()
|
2006-05-05 22:57:19 +04:00
|
|
|
);
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2007-07-02 22:56:57 +04:00
|
|
|
const char* GetDestination() const
|
|
|
|
{ return this->Destination.c_str(); }
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
/** Get the install destination as it should appear in the
|
|
|
|
installation script. */
|
|
|
|
std::string GetInstallDestination() const;
|
|
|
|
|
|
|
|
/** Test if this generator installs something for a given configuration. */
|
|
|
|
bool InstallsForConfig(const char*);
|
|
|
|
|
2006-02-19 23:25:27 +03:00
|
|
|
protected:
|
2007-07-02 22:56:57 +04:00
|
|
|
virtual void GenerateScript(std::ostream& os);
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2007-07-02 22:56:57 +04:00
|
|
|
std::string CreateComponentTest(const char* component);
|
|
|
|
|
|
|
|
// Information shared by most generator types.
|
|
|
|
std::string Destination;
|
|
|
|
std::string Component;
|
2006-02-19 23:25:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|