mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
Autogen: For Qt5 pass all implicit include directories to moc
For Qt4 it was not possible to pass all compiler implicit include directories to moc because it couldn't handle some system headers. For reference see commit753b905ec8, commitd2536579d5and [QTBUG-28045](https://bugreports.qt.io/browse/QTBUG-28045). For Qt5's moc the problem does not persist anymore so we can (and should) pass all implicit include directories to moc. Fixes #18041
This commit is contained in:
@@ -380,13 +380,15 @@ bool cmQtAutoGenInitializer::InitMoc()
|
||||
|
||||
// Moc includes
|
||||
{
|
||||
auto GetIncludeDirs = [this,
|
||||
localGen](std::string const& cfg) -> std::string {
|
||||
bool const appendImplicit = (this->QtVersionMajor == "5");
|
||||
auto GetIncludeDirs =
|
||||
[this, localGen, appendImplicit](std::string const& cfg) -> std::string {
|
||||
// Get the include dirs for this target, without stripping the implicit
|
||||
// include dirs off, see
|
||||
// https://gitlab.kitware.com/cmake/cmake/issues/13667
|
||||
std::vector<std::string> dirs;
|
||||
localGen->GetIncludeDirectories(dirs, this->Target, "CXX", cfg, false);
|
||||
localGen->GetIncludeDirectories(dirs, this->Target, "CXX", cfg, false,
|
||||
appendImplicit);
|
||||
return cmJoin(dirs, ";");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user