2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-02-19 20:25:27 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-02-19 20:25:27 +00:00
|
|
|
|
2009-09-28 15:43:28 +00: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 20:25:27 +00:00
|
|
|
#ifndef cmInstallGenerator_h
|
|
|
|
#define cmInstallGenerator_h
|
|
|
|
|
2012-02-27 16:26:38 +00:00
|
|
|
#include "cmInstallType.h"
|
2009-03-16 14:39:56 +00:00
|
|
|
#include "cmScriptGenerator.h"
|
2006-02-19 20:25:27 +00:00
|
|
|
|
|
|
|
class cmLocalGenerator;
|
|
|
|
|
|
|
|
/** \class cmInstallGenerator
|
|
|
|
* \brief Support class for generating install scripts.
|
|
|
|
*
|
|
|
|
*/
|
2009-03-16 14:39:56 +00:00
|
|
|
class cmInstallGenerator: public cmScriptGenerator
|
2006-02-19 20:25:27 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-07-02 18:56:57 +00:00
|
|
|
cmInstallGenerator(const char* destination,
|
|
|
|
std::vector<std::string> const& configurations,
|
|
|
|
const char* component);
|
2006-02-19 20:25:27 +00:00
|
|
|
virtual ~cmInstallGenerator();
|
|
|
|
|
2008-01-28 13:38:36 +00:00
|
|
|
void AddInstallRule(
|
2012-02-27 16:26:38 +00:00
|
|
|
std::ostream& os, cmInstallType type,
|
2007-06-28 20:11:18 +00:00
|
|
|
std::vector<std::string> const& files,
|
|
|
|
bool optional = false,
|
2006-08-17 18:48:54 +00:00
|
|
|
const char* permissions_file = 0,
|
|
|
|
const char* permissions_dir = 0,
|
2006-08-21 20:55:03 +00:00
|
|
|
const char* rename = 0,
|
2007-07-02 15:02:52 +00:00
|
|
|
const char* literal_args = 0,
|
2009-03-16 14:39:56 +00:00
|
|
|
Indent const& indent = Indent()
|
2006-05-05 18:57:19 +00:00
|
|
|
);
|
2006-02-19 20:25:27 +00:00
|
|
|
|
2007-07-02 18:56:57 +00:00
|
|
|
const char* GetDestination() const
|
|
|
|
{ return this->Destination.c_str(); }
|
2008-01-28 13:38:36 +00: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 20:25:27 +00:00
|
|
|
protected:
|
2007-07-02 18:56:57 +00:00
|
|
|
virtual void GenerateScript(std::ostream& os);
|
2006-02-19 20:25:27 +00:00
|
|
|
|
2007-07-02 18:56:57 +00:00
|
|
|
std::string CreateComponentTest(const char* component);
|
|
|
|
|
|
|
|
// Information shared by most generator types.
|
|
|
|
std::string Destination;
|
|
|
|
std::string Component;
|
2006-02-19 20:25:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|