cmQtAutoGeneratorRcc.h 2.49 KB
Newer Older
1
2
3
4
5
6
7
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmQtAutoGeneratorRcc_h
#define cmQtAutoGeneratorRcc_h

#include "cmConfigure.h" // IWYU pragma: keep

8
#include "cmFileLock.h"
9
#include "cmQtAutoGenerator.h"
10
#include "cm_uv.h"
11
12
13
14
15
16

#include <string>
#include <vector>

class cmMakefile;

17
// @brief AUTORCC generator
18
class cmQtAutoGeneratorRcc : public cmQtAutoGenerator
19
20
21
22
{
  CM_DISABLE_COPY(cmQtAutoGeneratorRcc)
public:
  cmQtAutoGeneratorRcc();
23
  ~cmQtAutoGeneratorRcc() override;
24
25

private:
26
  // -- Types
27

28
  /// @brief Processing stage
29
  enum class StageT : unsigned char
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  {
    SETTINGS_READ,
    TEST_QRC_RCC_FILES,
    TEST_RESOURCES_READ,
    TEST_RESOURCES,
    TEST_INFO_FILE,
    GENERATE,
    GENERATE_RCC,
    GENERATE_WRAPPER,
    SETTINGS_WRITE,
    FINISH,
    END
  };

  // -- Abstract processing interface
  bool Init(cmMakefile* makefile) override;
  bool Process() override;
  // -- Process stage
  static void UVPollStage(uv_async_t* handle);
  void PollStage();
  void SetStage(StageT stage);
  // -- Settings file
52
  bool SettingsFileRead();
53
54
55
56
57
58
59
60
61
62
63
64
  void SettingsFileWrite();
  // -- Tests
  bool TestQrcRccFiles();
  bool TestResourcesRead();
  bool TestResources();
  void TestInfoFile();
  // -- Generation
  void GenerateParentDir();
  bool GenerateRcc();
  void GenerateWrapper();

  // -- Utility
65
66
  bool IsMultiConfig() const { return MultiConfig_; }
  std::string MultiConfigOutput() const;
67
68
69
70
71
  bool StartProcess(std::string const& workingDirectory,
                    std::vector<std::string> const& command,
                    bool mergedOutput);

private:
72
  // -- Config settings
73
  bool MultiConfig_;
74
  // -- Directories
75
  std::string AutogenBuildDir_;
76
  std::string IncludeDir_;
77
  // -- Qt environment
78
79
  std::string RccExecutable_;
  std::vector<std::string> RccListOptions_;
80
  // -- Job
81
82
  std::string LockFile_;
  cmFileLock LockFileLock_;
83
84
85
  std::string QrcFile_;
  std::string QrcFileName_;
  std::string QrcFileDir_;
86
87
88
89
  std::string RccPathChecksum_;
  std::string RccFileName_;
  std::string RccFileOutput_;
  std::string RccFilePublic_;
90
91
92
93
94
95
96
97
  std::vector<std::string> Options_;
  std::vector<std::string> Inputs_;
  // -- Subprocess
  ProcessResultT ProcessResult_;
  std::unique_ptr<ReadOnlyProcessT> Process_;
  // -- Settings file
  std::string SettingsFile_;
  std::string SettingsString_;
98
  bool SettingsChanged_;
99
100
101
102
103
  // -- libuv loop
  StageT Stage_;
  bool Error_;
  bool Generate_;
  bool BuildFileChanged_;
104
105
106
};

#endif