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
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2019-09-30 14:46:28 +00:00
|
|
|
#include "cmInstallType.h"
|
|
|
|
#include "cmScriptGenerator.h"
|
|
|
|
|
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
|
|
|
{
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2020-01-21 16:00:00 +00:00
|
|
|
cmInstallGenerator(std::string destination,
|
2007-07-02 18:56:57 +00:00
|
|
|
std::vector<std::string> const& configurations,
|
2020-01-21 16:00:00 +00:00
|
|
|
std::string 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
|
|
|
|
2019-01-23 19:30:01 +00:00
|
|
|
cmInstallGenerator(cmInstallGenerator const&) = delete;
|
|
|
|
cmInstallGenerator& operator=(cmInstallGenerator const&) = delete;
|
|
|
|
|
2018-10-02 20:38:26 +00:00
|
|
|
virtual bool HaveInstall();
|
|
|
|
virtual void CheckCMP0082(bool& haveSubdirectoryInstall,
|
|
|
|
bool& haveInstallAfterSubdirectory);
|
|
|
|
|
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
|
|
|
|
2019-03-15 15:01:59 +00:00
|
|
|
virtual bool Compute(cmLocalGenerator*) { return true; }
|
2015-07-28 17:49:16 +00:00
|
|
|
|
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
|
|
|
|
2020-01-21 16:00:00 +00:00
|
|
|
std::string CreateComponentTest(const std::string& component,
|
2016-02-01 10:01:39 +00:00
|
|
|
bool exclude_from_all);
|
2007-07-02 18:56:57 +00:00
|
|
|
|
|
|
|
// Information shared by most generator types.
|
2020-01-21 16:00:00 +00:00
|
|
|
std::string const Destination;
|
|
|
|
std::string const Component;
|
|
|
|
MessageLevel const Message;
|
|
|
|
bool const ExcludeFromAll;
|
2006-02-19 20:25:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|