diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:48:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-24 14:49:03 (GMT) |
commit | b4a103bdecc437d37580d0ab540f6014006d661c (patch) | |
tree | ef9d1523fa05640247512e5b54aa37720f41d9ae /Source/cmQtAutoGenInitializer.cxx | |
parent | 956aa541c12ad311165c6a99b389c4ce3a291651 (diff) | |
parent | 1265c65b330c3ba25136c6fa75fc93945c4ebec2 (diff) | |
download | CMake-b4a103bdecc437d37580d0ab540f6014006d661c.zip CMake-b4a103bdecc437d37580d0ab540f6014006d661c.tar.gz CMake-b4a103bdecc437d37580d0ab540f6014006d661c.tar.bz2 |
Merge topic 'autouic-headers-ninja'
1265c65b33 AUTOUIC: Collect ui header files for Ninja generator
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5803
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index d4138d9..450a0cd 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -938,6 +938,30 @@ bool cmQtAutoGenInitializer::InitScanFiles() if (!uicOpts.empty()) { this->Uic.UiFiles.emplace_back(fullPath, cmExpandedList(uicOpts)); } + + auto uiHeaderRelativePath = cmSystemTools::RelativePath( + this->LocalGen->GetCurrentSourceDirectory(), + cmSystemTools::GetFilenamePath(fullPath)); + + auto uiHeaderFilePath = cmStrCat( + '/', uiHeaderRelativePath, '/', "ui_"_s, + cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s); + + ConfigString uiHeader; + uiHeader.Default = + cmStrCat(this->Dir.Build, "/include"_s, uiHeaderFilePath); + auto uiHeaderGenex = uiHeader.Default; + if (this->MultiConfig) { + uiHeaderGenex = cmStrCat(this->Dir.Build, "/include_$<CONFIG>"_s, + uiHeaderFilePath); + for (std::string const& cfg : this->ConfigsList) { + uiHeader.Config[cfg] = cmStrCat(this->Dir.Build, "/include_"_s, + cfg, uiHeaderFilePath); + } + } + + this->Uic.UiHeaders.emplace_back( + std::make_pair(uiHeader, uiHeaderGenex)); } else { // Register skipped .ui file this->Uic.SkipUi.insert(fullPath); @@ -1091,6 +1115,13 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() autogenByproducts.push_back(this->Moc.CompilationFileGenex); } + if (this->Uic.Enabled) { + for (const auto& file : this->Uic.UiHeaders) { + this->AddGeneratedSource(file.first, this->Uic); + autogenByproducts.push_back(file.second); + } + } + // Compose target comment std::string autogenComment; { |