mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
Merge topic 'Autogen_Config'
bb670d96Autogen: Generators: Remove space3f86032bAutogen: Generators: Rename requiresMocing methodf24e1d37Autogen: Generators: Fix clang-tidy readability-else-after-returnf27c5852Autogen: Initializer: Add old settings file to clean filesd7d2cb48Autogen: Generators: Save the UIC/RCC settings that were actually used721997a7Autogen: Generators: Dedicated generateAll variables for MOC/UIC/RCC9f47d326Autogen: Generators: Save the MOC settings that were actually used597124baAutogen: Generators: Add function to read makefile definitions config aware2b400b24Autogen: Generators: Move moc/uic/rcc executable test to generate methodedf0b8a5Autogen: Generators: Rename GenerateFoo methods to FooGenerate06430919Autogen: Generators: Use FileAbsentOrOlder for UIC testsca179f2aAutogen: Generators: Use FileAbsentOrOlder for MOC tests119791aeAutogen: Generators: Introduce FileAbsentOrOlder function95e4cfc5Autogen: Generators: Simplify (and fix) JoinExts function6c55755bAutogen: Generators: Make class static method a source static function1491ab1cAutogen: Generators: Make class static method a source static function ...
This commit is contained in:
@@ -674,6 +674,14 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|||||||
const std::string qtMajorVersion = GetQtMajorVersion(target);
|
const std::string qtMajorVersion = GetQtMajorVersion(target);
|
||||||
std::vector<std::string> autogenOutputFiles;
|
std::vector<std::string> autogenOutputFiles;
|
||||||
|
|
||||||
|
// Remove old settings on cleanup
|
||||||
|
{
|
||||||
|
std::string fname = GetAutogenTargetFilesDir(target);
|
||||||
|
fname += "/AutogenOldSettings.cmake";
|
||||||
|
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fname.c_str(),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
// Create autogen target build directory and add it to the clean files
|
// Create autogen target build directory and add it to the clean files
|
||||||
cmSystemTools::MakeDirectory(autogenBuildDir);
|
cmSystemTools::MakeDirectory(autogenBuildDir);
|
||||||
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
|
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
|
||||||
|
|||||||
+406
-301
File diff suppressed because it is too large
Load Diff
+41
-43
@@ -22,32 +22,26 @@ public:
|
|||||||
bool Run(const std::string& targetDirectory, const std::string& config);
|
bool Run(const std::string& targetDirectory, const std::string& config);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// - Configuration
|
||||||
bool ReadAutogenInfoFile(cmMakefile* makefile,
|
bool ReadAutogenInfoFile(cmMakefile* makefile,
|
||||||
const std::string& targetDirectory,
|
const std::string& targetDirectory,
|
||||||
const std::string& config);
|
const std::string& config);
|
||||||
void ReadOldMocDefinitionsFile(cmMakefile* makefile,
|
|
||||||
const std::string& targetDirectory);
|
|
||||||
bool WriteOldMocDefinitionsFile(const std::string& targetDirectory);
|
|
||||||
|
|
||||||
std::string MakeCompileSettingsString(cmMakefile* makefile);
|
std::string MocSettingsStringCompose();
|
||||||
|
std::string UicSettingsStringCompose();
|
||||||
|
std::string RccSettingsStringCompose();
|
||||||
|
void OldSettingsReadFile(cmMakefile* makefile,
|
||||||
|
const std::string& targetDirectory);
|
||||||
|
bool OldSettingsWriteFile(const std::string& targetDirectory);
|
||||||
|
|
||||||
|
// - Init and run
|
||||||
|
void Init();
|
||||||
bool RunAutogen(cmMakefile* makefile);
|
bool RunAutogen(cmMakefile* makefile);
|
||||||
|
|
||||||
bool GenerateMocFiles(
|
// - Content analysis
|
||||||
const std::map<std::string, std::string>& includedMocs,
|
bool MocRequired(const std::string& text, std::string& macroName);
|
||||||
const std::map<std::string, std::string>& notIncludedMocs);
|
bool MocSkipTest(const std::string& absFilename);
|
||||||
bool GenerateMoc(const std::string& sourceFile,
|
bool UicSkipTest(const std::string& absFilename);
|
||||||
const std::string& mocFileName,
|
|
||||||
const std::string& subDirPrefix);
|
|
||||||
|
|
||||||
bool GenerateUiFiles(
|
|
||||||
const std::map<std::string, std::vector<std::string> >& includedUis);
|
|
||||||
bool GenerateUi(const std::string& realName, const std::string& uiInputFile,
|
|
||||||
const std::string& uiOutputFile);
|
|
||||||
|
|
||||||
bool GenerateQrcFiles();
|
|
||||||
bool GenerateQrc(const std::string& qrcInputFile,
|
|
||||||
const std::string& qrcOutputFile, bool unique_n);
|
|
||||||
|
|
||||||
bool ParseSourceFile(
|
bool ParseSourceFile(
|
||||||
const std::string& absFilename,
|
const std::string& absFilename,
|
||||||
@@ -55,6 +49,7 @@ private:
|
|||||||
std::map<std::string, std::string>& includedMocs,
|
std::map<std::string, std::string>& includedMocs,
|
||||||
std::map<std::string, std::vector<std::string> >& includedUis,
|
std::map<std::string, std::vector<std::string> >& includedUis,
|
||||||
bool relaxed);
|
bool relaxed);
|
||||||
|
|
||||||
void SearchHeadersForSourceFile(
|
void SearchHeadersForSourceFile(
|
||||||
const std::string& absFilename,
|
const std::string& absFilename,
|
||||||
const std::vector<std::string>& headerExtensions,
|
const std::vector<std::string>& headerExtensions,
|
||||||
@@ -68,8 +63,6 @@ private:
|
|||||||
std::map<std::string, std::string>& notIncludedMocs,
|
std::map<std::string, std::string>& notIncludedMocs,
|
||||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||||
|
|
||||||
bool requiresMocing(const std::string& text, std::string& macroName);
|
|
||||||
|
|
||||||
void ParseContentForUic(
|
void ParseContentForUic(
|
||||||
const std::string& fileName, const std::string& contentsString,
|
const std::string& fileName, const std::string& contentsString,
|
||||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||||
@@ -80,18 +73,27 @@ private:
|
|||||||
std::map<std::string, std::string>& includedMocs,
|
std::map<std::string, std::string>& includedMocs,
|
||||||
bool relaxed);
|
bool relaxed);
|
||||||
|
|
||||||
void ParseForUic(
|
// - Moc file generation
|
||||||
const std::string& fileName,
|
bool MocGenerateAll(
|
||||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
const std::map<std::string, std::string>& includedMocs,
|
||||||
|
const std::map<std::string, std::string>& notIncludedMocs);
|
||||||
|
bool MocGenerateFile(const std::string& sourceFile,
|
||||||
|
const std::string& mocFileName,
|
||||||
|
const std::string& subDirPrefix);
|
||||||
|
|
||||||
void Init();
|
// - Uic file generation
|
||||||
|
bool UicGenerateAll(
|
||||||
|
const std::map<std::string, std::vector<std::string> >& includedUis);
|
||||||
|
bool UicGenerateFile(const std::string& realName,
|
||||||
|
const std::string& uiInputFile,
|
||||||
|
const std::string& uiOutputFile);
|
||||||
|
|
||||||
bool MocSkipTest(const std::string& absFilename);
|
// - Qrc file generation
|
||||||
bool UicSkipTest(const std::string& absFilename);
|
bool QrcGenerateAll();
|
||||||
|
bool QrcGenerateFile(const std::string& qrcInputFile,
|
||||||
bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
|
const std::string& qrcOutputFile, bool unique_n);
|
||||||
std::multimap<std::string, std::string>& collisions);
|
|
||||||
|
|
||||||
|
// - Logging
|
||||||
void LogErrorNameCollision(
|
void LogErrorNameCollision(
|
||||||
const std::string& message,
|
const std::string& message,
|
||||||
const std::multimap<std::string, std::string>& collisions);
|
const std::multimap<std::string, std::string>& collisions);
|
||||||
@@ -101,17 +103,11 @@ private:
|
|||||||
void LogError(const std::string& message);
|
void LogError(const std::string& message);
|
||||||
void LogCommand(const std::vector<std::string>& command);
|
void LogCommand(const std::vector<std::string>& command);
|
||||||
|
|
||||||
|
// - Utility
|
||||||
|
bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
|
||||||
|
std::multimap<std::string, std::string>& collisions);
|
||||||
bool MakeParentDirectory(const std::string& filename);
|
bool MakeParentDirectory(const std::string& filename);
|
||||||
|
|
||||||
std::string JoinExts(const std::vector<std::string>& lst);
|
|
||||||
|
|
||||||
static void MergeUicOptions(std::vector<std::string>& opts,
|
|
||||||
const std::vector<std::string>& fileOpts,
|
|
||||||
bool isQt5);
|
|
||||||
|
|
||||||
bool InputFilesNewerThanQrc(const std::string& qrcFile,
|
|
||||||
const std::string& rccOutput);
|
|
||||||
|
|
||||||
// - Target names
|
// - Target names
|
||||||
std::string OriginTargetName;
|
std::string OriginTargetName;
|
||||||
std::string AutogenTargetName;
|
std::string AutogenTargetName;
|
||||||
@@ -139,17 +135,17 @@ private:
|
|||||||
std::list<std::string> MocIncludes;
|
std::list<std::string> MocIncludes;
|
||||||
std::list<std::string> MocDefinitions;
|
std::list<std::string> MocDefinitions;
|
||||||
std::vector<std::string> MocOptions;
|
std::vector<std::string> MocOptions;
|
||||||
|
std::string MocSettingsString;
|
||||||
// - Uic
|
// - Uic
|
||||||
std::vector<std::string> SkipUic;
|
std::vector<std::string> SkipUic;
|
||||||
std::vector<std::string> UicTargetOptions;
|
std::vector<std::string> UicTargetOptions;
|
||||||
std::map<std::string, std::string> UicOptions;
|
std::map<std::string, std::string> UicOptions;
|
||||||
|
std::string UicSettingsString;
|
||||||
// - Rcc
|
// - Rcc
|
||||||
std::vector<std::string> RccSources;
|
std::vector<std::string> RccSources;
|
||||||
std::map<std::string, std::string> RccOptions;
|
std::map<std::string, std::string> RccOptions;
|
||||||
std::map<std::string, std::vector<std::string> > RccInputs;
|
std::map<std::string, std::vector<std::string> > RccInputs;
|
||||||
// - Settings
|
std::string RccSettingsString;
|
||||||
std::string CurrentCompileSettingsStr;
|
|
||||||
std::string OldCompileSettingsStr;
|
|
||||||
// - Utility
|
// - Utility
|
||||||
cmFilePathChecksum fpathCheckSum;
|
cmFilePathChecksum fpathCheckSum;
|
||||||
cmsys::RegularExpression RegExpQObject;
|
cmsys::RegularExpression RegExpQObject;
|
||||||
@@ -163,7 +159,9 @@ private:
|
|||||||
bool RunMocFailed;
|
bool RunMocFailed;
|
||||||
bool RunUicFailed;
|
bool RunUicFailed;
|
||||||
bool RunRccFailed;
|
bool RunRccFailed;
|
||||||
bool GenerateAll;
|
bool GenerateMocAll;
|
||||||
|
bool GenerateUicAll;
|
||||||
|
bool GenerateRccAll;
|
||||||
bool MocRelaxedMode;
|
bool MocRelaxedMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user