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