Coverage Report

Created: 2026-07-14 07:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmExportBuildCMakeConfigGenerator.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 "cmExportBuildFileGenerator.h"
11
#include "cmExportCMakeConfigGenerator.h"
12
13
class cmDiagnosticContext;
14
15
/** \class cmExportBuildCMakeConfigGenerator
16
 * \brief Generate a file exporting targets from a build tree.
17
 *
18
 * cmExportBuildCMakeConfigGenerator generates a file exporting targets from
19
 * a build tree.  This exports the targets to CMake's native package
20
 * configuration format.  A single file exports information for all
21
 * configurations built.
22
 *
23
 * This is used to implement the export() command.
24
 */
25
class cmExportBuildCMakeConfigGenerator
26
  : public cmExportCMakeConfigGenerator
27
  , public cmExportBuildFileGenerator
28
{
29
public:
30
  cmExportBuildCMakeConfigGenerator(cmDiagnosticContext context);
31
32
  /** Set whether to append generated code to the output file.  */
33
0
  void SetAppendMode(bool append) { this->AppendMode = append; }
34
35
protected:
36
  // Implement virtual methods from the superclass.
37
  bool GenerateMainFile(std::ostream& os) override;
38
  void GenerateImportTargetsConfig(std::ostream& os, std::string const& config,
39
                                   std::string const& suffix) override;
40
41
  std::string GetFileSetDirectories(cmGeneratorTarget* gte,
42
                                    cmGeneratorFileSet const* fileSet,
43
                                    cmTargetExport const* te) override;
44
  std::string GetFileSetFiles(cmGeneratorTarget* gte,
45
                              cmGeneratorFileSet const* fileSet,
46
                              cmTargetExport const* te) override;
47
48
  void GenerateCxxModuleConfigInformation(std::string const&,
49
                                          std::ostream&) const override;
50
  bool GenerateImportCxxModuleConfigTargetInclusion(std::string const&,
51
                                                    std::string) const;
52
};