2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2006-02-19 23:25:27 +03:00
|
|
|
#ifndef cmInstallGenerator_h
|
|
|
|
#define cmInstallGenerator_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2012-02-27 20:26:38 +04:00
|
|
|
#include "cmInstallType.h"
|
2009-03-16 17:39:56 +03:00
|
|
|
#include "cmScriptGenerator.h"
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2006-02-19 23:25:27 +03:00
|
|
|
class cmLocalGenerator;
|
2014-06-24 19:18:43 +04:00
|
|
|
class cmMakefile;
|
2006-02-19 23:25:27 +03:00
|
|
|
|
|
|
|
/** \class cmInstallGenerator
|
|
|
|
* \brief Support class for generating install scripts.
|
|
|
|
*
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
class cmInstallGenerator : public cmScriptGenerator
|
2006-02-19 23:25:27 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-06-24 18:45:07 +04:00
|
|
|
enum MessageLevel
|
|
|
|
{
|
|
|
|
MessageDefault,
|
2014-06-24 19:18:43 +04:00
|
|
|
MessageAlways,
|
|
|
|
MessageLazy,
|
|
|
|
MessageNever
|
2014-06-24 18:45:07 +04:00
|
|
|
};
|
|
|
|
|
2007-07-02 22:56:57 +04:00
|
|
|
cmInstallGenerator(const char* destination,
|
|
|
|
std::vector<std::string> const& configurations,
|
2016-05-16 17:34:04 +03:00
|
|
|
const char* component, MessageLevel message,
|
2016-02-01 13:01:39 +03:00
|
|
|
bool exclude_from_all);
|
2016-06-27 22:25:27 +03:00
|
|
|
~cmInstallGenerator() CM_OVERRIDE;
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2016-06-27 23:44:16 +03:00
|
|
|
void AddInstallRule(
|
|
|
|
std::ostream& os, std::string const& dest, cmInstallType type,
|
|
|
|
std::vector<std::string> const& files, bool optional = false,
|
|
|
|
const char* permissions_file = CM_NULLPTR,
|
|
|
|
const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR,
|
|
|
|
const char* literal_args = CM_NULLPTR, Indent const& indent = Indent());
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
/** Get the install destination as it should appear in the
|
|
|
|
installation script. */
|
2015-02-11 19:48:02 +03:00
|
|
|
std::string ConvertToAbsoluteDestination(std::string const& dest) const;
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
/** Test if this generator installs something for a given configuration. */
|
2014-02-10 07:48:34 +04:00
|
|
|
bool InstallsForConfig(const std::string& config);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2014-06-24 19:40:26 +04:00
|
|
|
/** Select message level from CMAKE_INSTALL_MESSAGE or 'never'. */
|
|
|
|
static MessageLevel SelectMessageLevel(cmMakefile* mf, bool never = false);
|
2014-06-24 19:18:43 +04:00
|
|
|
|
2015-07-28 20:49:16 +03:00
|
|
|
virtual void Compute(cmLocalGenerator*) {}
|
|
|
|
|
2006-02-19 23:25:27 +03:00
|
|
|
protected:
|
2016-06-27 22:25:27 +03:00
|
|
|
void GenerateScript(std::ostream& os) CM_OVERRIDE;
|
2006-02-19 23:25:27 +03:00
|
|
|
|
2016-02-01 13:01:39 +03:00
|
|
|
std::string CreateComponentTest(const char* component,
|
|
|
|
bool exclude_from_all);
|
2007-07-02 22:56:57 +04:00
|
|
|
|
|
|
|
// Information shared by most generator types.
|
|
|
|
std::string Destination;
|
|
|
|
std::string Component;
|
2014-06-24 18:45:07 +04:00
|
|
|
MessageLevel Message;
|
2016-02-01 13:01:39 +03:00
|
|
|
bool ExcludeFromAll;
|
2006-02-19 23:25:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|