2016-09-27 15:01:08 -04:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2018-01-17 17:21:57 +01:00
|
|
|
#ifndef cmQtAutoGenInitializer_h
|
|
|
|
#define cmQtAutoGenInitializer_h
|
2015-09-26 19:05:00 +02:00
|
|
|
|
2017-04-11 22:00:21 +02:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-11-18 15:08:08 +01:00
|
|
|
#include "cmQtAutoGen.h"
|
2017-08-26 13:59:57 +02:00
|
|
|
|
2017-11-18 15:08:08 +01:00
|
|
|
#include <map>
|
|
|
|
#include <set>
|
2017-08-26 13:59:57 +02:00
|
|
|
#include <string>
|
2017-11-18 15:08:08 +01:00
|
|
|
#include <vector>
|
2016-09-01 20:05:48 +02:00
|
|
|
|
2015-10-05 19:21:30 +02:00
|
|
|
class cmGeneratorTarget;
|
2015-09-26 19:05:00 +02:00
|
|
|
|
2018-01-03 16:59:40 +01:00
|
|
|
/// @brief Initializes the QtAutoGen generators
|
2018-01-17 17:21:57 +01:00
|
|
|
class cmQtAutoGenInitializer : public cmQtAutoGen
|
2015-09-26 19:05:00 +02:00
|
|
|
{
|
|
|
|
public:
|
2017-08-26 13:59:57 +02:00
|
|
|
static std::string GetQtMajorVersion(cmGeneratorTarget const* target);
|
|
|
|
static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
|
2017-09-12 10:08:10 +02:00
|
|
|
std::string const& qtVersionMajor);
|
2017-08-26 13:59:57 +02:00
|
|
|
|
2017-11-18 15:08:08 +01:00
|
|
|
class Qrc
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Qrc()
|
|
|
|
: Generated(false)
|
|
|
|
, Unique(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::string QrcFile;
|
|
|
|
std::string QrcName;
|
|
|
|
std::string PathChecksum;
|
|
|
|
std::string InfoFile;
|
|
|
|
std::string SettingsFile;
|
|
|
|
std::string RccFile;
|
|
|
|
bool Generated;
|
|
|
|
bool Unique;
|
|
|
|
std::vector<std::string> Options;
|
|
|
|
std::vector<std::string> Resources;
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2018-01-17 17:21:57 +01:00
|
|
|
cmQtAutoGenInitializer(cmGeneratorTarget* target, bool mocEnabled,
|
|
|
|
bool uicEnabled, bool rccEnabled,
|
|
|
|
std::string const& qtVersionMajor);
|
2017-11-18 15:08:08 +01:00
|
|
|
|
|
|
|
void InitCustomTargets();
|
|
|
|
void SetupCustomTargets();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SetupCustomTargetsMoc();
|
|
|
|
void SetupCustomTargetsUic();
|
|
|
|
|
|
|
|
std::vector<std::string> AddGeneratedSource(std::string const& filename,
|
2018-01-03 16:59:40 +01:00
|
|
|
GeneratorT genType);
|
2017-11-18 15:08:08 +01:00
|
|
|
|
|
|
|
bool QtVersionGreaterOrEqual(unsigned long requestMajor,
|
|
|
|
unsigned long requestMinor) const;
|
|
|
|
|
2018-01-03 16:59:40 +01:00
|
|
|
bool RccListInputs(std::string const& fileName,
|
|
|
|
std::vector<std::string>& files,
|
|
|
|
std::string& errorMessage);
|
|
|
|
|
2017-11-18 15:08:08 +01:00
|
|
|
private:
|
|
|
|
cmGeneratorTarget* Target;
|
|
|
|
bool MocEnabled;
|
|
|
|
bool UicEnabled;
|
|
|
|
bool RccEnabled;
|
2017-11-19 12:22:49 +01:00
|
|
|
// Qt
|
2017-11-18 15:08:08 +01:00
|
|
|
std::string QtVersionMajor;
|
|
|
|
std::string QtVersionMinor;
|
2017-11-19 12:22:49 +01:00
|
|
|
std::string RccExecutable;
|
|
|
|
std::vector<std::string> RccListOptions;
|
2017-11-18 15:08:08 +01:00
|
|
|
// Configurations
|
|
|
|
std::string ConfigDefault;
|
|
|
|
std::vector<std::string> ConfigsList;
|
2018-01-03 16:59:40 +01:00
|
|
|
MultiConfigT MultiConfig;
|
2017-11-18 15:08:08 +01:00
|
|
|
// Names
|
|
|
|
std::string AutogenTargetName;
|
|
|
|
std::string AutogenFolder;
|
|
|
|
std::string AutogenInfoFile;
|
|
|
|
std::string AutogenSettingsFile;
|
|
|
|
// Directories
|
|
|
|
std::string DirInfo;
|
|
|
|
std::string DirBuild;
|
|
|
|
std::string DirWork;
|
|
|
|
// Sources
|
|
|
|
std::vector<std::string> Headers;
|
|
|
|
std::vector<std::string> Sources;
|
|
|
|
std::set<std::string> MocSkip;
|
|
|
|
std::set<std::string> UicSkip;
|
|
|
|
std::map<std::string, std::string> ConfigMocIncludes;
|
|
|
|
std::map<std::string, std::string> ConfigMocDefines;
|
|
|
|
std::map<std::string, std::string> ConfigUicOptions;
|
|
|
|
std::vector<Qrc> Qrcs;
|
2015-09-26 19:05:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|