2017-02-28 11:08:26 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2017-08-26 11:59:57 +00:00
|
|
|
#ifndef cmQtAutoGen_h
|
|
|
|
#define cmQtAutoGen_h
|
2017-02-28 11:08:26 +00:00
|
|
|
|
2017-08-25 18:39:02 +00:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-04-11 19:42:35 +00:00
|
|
|
|
2017-02-28 11:08:26 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2017-08-26 11:59:57 +00:00
|
|
|
/** \class cmQtAutoGen
|
|
|
|
* \brief Class used as namespace for QtAutogen related types and functions
|
|
|
|
*/
|
|
|
|
class cmQtAutoGen
|
2017-02-28 11:08:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-09-12 08:08:10 +00:00
|
|
|
static std::string const listSep;
|
2017-02-28 11:08:26 +00:00
|
|
|
|
2017-09-12 08:10:31 +00:00
|
|
|
enum Generator
|
2017-03-15 09:42:37 +00:00
|
|
|
{
|
2017-08-26 11:59:57 +00:00
|
|
|
GEN, // General
|
2017-03-15 09:42:37 +00:00
|
|
|
MOC,
|
|
|
|
UIC,
|
|
|
|
RCC
|
|
|
|
};
|
|
|
|
|
2017-09-12 08:08:10 +00:00
|
|
|
enum MultiConfig
|
|
|
|
{
|
|
|
|
SINGLE, // Single configuration
|
|
|
|
WRAP, // Multi configuration using wrapper files
|
|
|
|
FULL // Full multi configuration using per config sources
|
|
|
|
};
|
|
|
|
|
2017-02-28 11:08:26 +00:00
|
|
|
public:
|
2017-08-26 11:59:57 +00:00
|
|
|
/// @brief Returns the generator name
|
2017-09-12 08:08:10 +00:00
|
|
|
static std::string const& GeneratorName(Generator genType);
|
2017-08-26 11:59:57 +00:00
|
|
|
/// @brief Returns the generator name in upper case
|
2017-09-12 08:10:31 +00:00
|
|
|
static std::string GeneratorNameUpper(Generator genType);
|
2017-08-26 11:59:57 +00:00
|
|
|
|
2017-09-12 08:08:10 +00:00
|
|
|
/// @brief Returns the multi configuration name string
|
|
|
|
static std::string const& MultiConfigName(MultiConfig config);
|
|
|
|
/// @brief Returns the multi configuration type
|
|
|
|
static MultiConfig MultiConfigType(std::string const& name);
|
|
|
|
|
2017-03-02 13:06:02 +00:00
|
|
|
/// @brief Returns a the string escaped and enclosed in quotes
|
2017-09-12 08:08:10 +00:00
|
|
|
static std::string Quoted(std::string const& text);
|
|
|
|
|
|
|
|
/// @brief Appends the suffix to the filename before the last dot
|
|
|
|
static std::string AppendFilenameSuffix(std::string const& filename,
|
|
|
|
std::string const& suffix);
|
2017-03-02 13:06:02 +00:00
|
|
|
|
2017-08-30 21:13:10 +00:00
|
|
|
/// @brief Merges newOpts into baseOpts
|
|
|
|
static void UicMergeOptions(std::vector<std::string>& baseOpts,
|
2017-09-12 08:08:10 +00:00
|
|
|
std::vector<std::string> const& newOpts,
|
2017-08-30 21:13:10 +00:00
|
|
|
bool isQt5);
|
|
|
|
|
|
|
|
/// @brief Merges newOpts into baseOpts
|
|
|
|
static void RccMergeOptions(std::vector<std::string>& baseOpts,
|
2017-09-12 08:08:10 +00:00
|
|
|
std::vector<std::string> const& newOpts,
|
2017-08-30 21:13:10 +00:00
|
|
|
bool isQt5);
|
|
|
|
|
2017-02-28 11:08:26 +00:00
|
|
|
/// @brief Reads the resource files list from from a .qrc file
|
|
|
|
/// @arg fileName Must be the absolute path of the .qrc file
|
2017-11-19 11:22:49 +00:00
|
|
|
/// @return True if the rcc file was successfully read
|
|
|
|
static bool RccListInputs(std::string const& rccCommand,
|
|
|
|
std::vector<std::string> const& rccListOptions,
|
2017-09-12 08:08:10 +00:00
|
|
|
std::string const& fileName,
|
2017-03-02 13:06:02 +00:00
|
|
|
std::vector<std::string>& files,
|
2017-08-22 21:42:36 +00:00
|
|
|
std::string* errorMessage = nullptr);
|
2017-02-28 11:08:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|