diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-11-16 08:59:03 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-11-19 11:51:30 (GMT) |
commit | b2a0b549bb9fea678517a52caf333eae009901dd (patch) | |
tree | a19e2b6ed59897a505f5e2b8caaddeed3de4dcf8 /Source/cmQtAutoGeneratorRcc.h | |
parent | 85ae0ba796c26b9ba2f7025e267d3f438db388c6 (diff) | |
download | CMake-b2a0b549bb9fea678517a52caf333eae009901dd.zip CMake-b2a0b549bb9fea678517a52caf333eae009901dd.tar.gz CMake-b2a0b549bb9fea678517a52caf333eae009901dd.tar.bz2 |
Autogen: Introduce standalone RCC generator class
Introduces the standalone RCC generator class `cmQtAutoGeneratorRcc`.
Every instance of `cmQtAutoGeneratorRcc` class handles the
`rcc` invocation for a single `.qrc` file.
The class will be used in the future to allow parallel `.qrc` file
processing by calling `cmake -E cmake_autorcc <INFO_FILE> <CONFIG>`.
Diffstat (limited to 'Source/cmQtAutoGeneratorRcc.h')
-rw-r--r-- | Source/cmQtAutoGeneratorRcc.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h new file mode 100644 index 0000000..4539461 --- /dev/null +++ b/Source/cmQtAutoGeneratorRcc.h @@ -0,0 +1,90 @@ +/* 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 + +#include "cmFilePathChecksum.h" +#include "cmQtAutoGen.h" + +#include <string> +#include <vector> + +class cmMakefile; + +class cmQtAutoGeneratorRcc +{ + CM_DISABLE_COPY(cmQtAutoGeneratorRcc) +public: + cmQtAutoGeneratorRcc(); + bool Run(std::string const& infoFile, std::string const& config); + +private: + // -- Initialization & settings + bool InfoFileRead(cmMakefile* makefile); + void SettingsFileRead(cmMakefile* makefile); + bool SettingsFileWrite(); + // -- Central processing + bool Process(cmMakefile* makefile); + bool RccGenerate(); + // -- Log info + void LogBold(std::string const& message) const; + void LogInfo(cmQtAutoGen::Generator genType, + std::string const& message) const; + // -- Log warning + void LogWarning(cmQtAutoGen::Generator genType, + std::string const& message) const; + void LogFileWarning(cmQtAutoGen::Generator genType, + std::string const& filename, + std::string const& message) const; + // -- Log error + void LogError(cmQtAutoGen::Generator genType, + std::string const& message) const; + void LogFileError(cmQtAutoGen::Generator genType, + std::string const& filename, + std::string const& message) const; + void LogCommandError(cmQtAutoGen::Generator genType, + std::string const& message, + std::vector<std::string> const& command, + std::string const& output) const; + // -- Utility + bool MakeParentDirectory(cmQtAutoGen::Generator genType, + std::string const& filename) const; + bool FileDiffers(std::string const& filename, std::string const& content); + bool FileWrite(cmQtAutoGen::Generator genType, std::string const& filename, + std::string const& content); + bool RunCommand(std::vector<std::string> const& command, + std::string& output) const; + + // -- Info settings + std::string InfoFile; + std::string InfoDir; + std::string InfoConfig; + // -- Config settings + std::string ConfigSuffix; + cmQtAutoGen::MultiConfig MultiConfig; + // -- Settings + bool Verbose; + bool ColorOutput; + bool SettingsChanged; + std::string SettingsFile; + std::string SettingsString; + // -- Directories + std::string ProjectSourceDir; + std::string ProjectBinaryDir; + std::string CurrentSourceDir; + std::string CurrentBinaryDir; + std::string AutogenBuildDir; + cmFilePathChecksum FilePathChecksum; + // -- Qt environment + std::string QtMajorVersion; + std::string RccExecutable; + // -- Job + std::string QrcFile; + std::string RccFile; + std::vector<std::string> Options; + std::vector<std::string> Inputs; +}; + +#endif |