Coverage Report

Created: 2026-02-09 06:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmInstallScriptGenerator.h
Line
Count
Source
1
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2
   file LICENSE.rst or https://cmake.org/licensing for details.  */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <iosfwd>
8
#include <string>
9
10
#include "cmInstallGenerator.h"
11
#include "cmListFileCache.h"
12
13
class cmLocalGenerator;
14
15
/** \class cmInstallScriptGenerator
16
 * \brief Generate target installation rules.
17
 */
18
class cmInstallScriptGenerator : public cmInstallGenerator
19
{
20
public:
21
  cmInstallScriptGenerator(
22
    std::string script, bool code, std::string const& component,
23
    bool exclude_from_all, bool all_components,
24
    cmListFileBacktrace backtrace = cmListFileBacktrace());
25
  ~cmInstallScriptGenerator() override;
26
27
  bool Compute(cmLocalGenerator* lg) override;
28
29
0
  bool IsCode() const { return this->Code; }
30
31
  std::string GetScript(std::string const& config) const;
32
33
protected:
34
  void GenerateScriptActions(std::ostream& os, Indent indent) override;
35
  void GenerateScriptForConfig(std::ostream& os, std::string const& config,
36
                               Indent indent) override;
37
  void AddScriptInstallRule(std::ostream& os, Indent indent,
38
                            std::string const& script) const;
39
40
  std::string const Script;
41
  bool const Code;
42
  cmLocalGenerator* LocalGenerator;
43
  bool AllowGenex = false;
44
};