summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.h
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-04-06 02:14:35 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-20 12:59:07 (GMT)
commit0903531964cff8888dd1cbf2a9c82ac6bb9a522f (patch)
tree2cf7d844d3ee291ecb5ba77547bddb0a490aa150 /Source/cmQtAutoGenerators.h
parent135611176c5d4958b9b5a36c63fada8a9e4fb1ef (diff)
downloadCMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.zip
CMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.tar.gz
CMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.tar.bz2
Autogen: Pass explicit predefines header to moc if possible
Qt is relying on whoever calls moc to include a file with the predefined values that will be used by the compiler, otherwise moc takes wrong paths and weird things happen. Instead, generate an include file and feed it to all mocs to make sure it's generating correct code. Co-Author: Sebastian Holtermann <sebholt@xwmw.org> Fixes: #16640
Diffstat (limited to 'Source/cmQtAutoGenerators.h')
-rw-r--r--Source/cmQtAutoGenerators.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index ee046de..cb6f45a 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -142,8 +142,8 @@ private:
const char* basePrefix,
const char* baseSuffix) const;
bool MakeParentDirectory(const std::string& filename) const;
- bool RunCommand(const std::vector<std::string>& command,
- std::string& output) const;
+ bool RunCommand(const std::vector<std::string>& command, std::string& output,
+ bool verbose = true) const;
bool FindHeader(std::string& header, const std::string& testBasePath) const;
@@ -176,6 +176,8 @@ private:
// - Moc
std::string MocCppFilenameRel;
std::string MocCppFilenameAbs;
+ std::string MocPredefsFileRel;
+ std::string MocPredefsFileAbs;
std::vector<std::string> MocSkipList;
std::vector<std::string> MocIncludePaths;
std::vector<std::string> MocIncludes;
@@ -197,6 +199,8 @@ private:
MacroFilter MacroFilters[2];
cmsys::RegularExpression RegExpMocInclude;
cmsys::RegularExpression RegExpUicInclude;
+ // - moc_predefs
+ std::vector<std::string> MocPredefsCmd;
// - Flags
bool IncludeProjectDirsBefore;
bool Verbose;