Commit b962b9cf authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'autouic-source-group-fixes'

e8ddc1e2 Autogen: Fix a bug in setting the UIC source group
7f0151dc Help: Document the AUTOUIC_SOURCE_GROUP property
f6c47dd0

 Help: Fix a typo in the AUTOGEN_SOURCE_GROUP help
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Alexey Edelev's avatarAlexey Edelev <alexey.edelev@qt.io>
Merge-request: !5978
parents a8b6b542 e8ddc1e2
......@@ -92,6 +92,7 @@ syn keyword cmakeProperty contained
\ AUTOUIC_EXECUTABLE
\ AUTOUIC_OPTIONS
\ AUTOUIC_SEARCH_PATHS
\ AUTOUIC_SOURCE_GROUP
\ BINARY_DIR
\ BUILDSYSTEM_TARGETS
\ BUILD_RPATH
......
......@@ -21,6 +21,7 @@ Properties of Global Scope
/prop_gbl/AUTOMOC_SOURCE_GROUP
/prop_gbl/AUTOMOC_TARGETS_FOLDER
/prop_gbl/AUTORCC_SOURCE_GROUP
/prop_gbl/AUTOUIC_SOURCE_GROUP
/prop_gbl/CMAKE_C_KNOWN_FEATURES
/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES
/prop_gbl/CMAKE_CXX_KNOWN_FEATURES
......
......@@ -3,15 +3,16 @@ AUTOGEN_SOURCE_GROUP
.. versionadded:: 3.9
Name of the :command:`source_group` for :prop_tgt:`AUTOMOC` and
:prop_tgt:`AUTORCC` generated files.
Name of the :command:`source_group` for :prop_tgt:`AUTOMOC`,
:prop_tgt:`AUTORCC` and :prop_tgt:`AUTOUIC` generated files.
Files generated by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTORCC` are not always
known at configure time and therefore can't be passed to
:command:`source_group`.
:prop_gbl:`AUTOGEN_SOURCE_GROUP` an be used instead to generate or select
a source group for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTORCC` generated files.
Files generated by :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTORCC` and
:prop_tgt:`AUTOUIC` are not always known at configure time and therefore can't
be passed to :command:`source_group`.
:prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used instead to generate or select
a source group for :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTORCC` and
:prop_tgt:`AUTOUIC` generated files.
For :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTORCC` specific overrides see
:prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP`
respectively.
For :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTORCC` and :prop_tgt:`AUTOUIC` specific
overrides see :prop_gbl:`AUTOMOC_SOURCE_GROUP`, :prop_gbl:`AUTORCC_SOURCE_GROUP`
and :prop_gbl:`AUTOUIC_SOURCE_GROUP` respectively.
AUTOUIC_SOURCE_GROUP
--------------------
.. versionadded:: 3.21
Name of the :command:`source_group` for :prop_tgt:`AUTOUIC` generated files.
When set this is used instead of :prop_gbl:`AUTOGEN_SOURCE_GROUP` for
files generated by :prop_tgt:`AUTOUIC`.
......@@ -32,9 +32,10 @@ The :ref:`Makefile Generators` will remove ``GENERATED`` files during
``make clean``.
Generated sources may be hidden in some IDE tools, while in others they might
be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMOC`
or :prop_tgt:`AUTORCC` functionality, the :prop_gbl:`AUTOGEN_SOURCE_GROUP`,
:prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP` target
be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMOC`,
:prop_tgt:`AUTORCC` or :prop_tgt:`AUTOUIC` functionality, the
:prop_gbl:`AUTOGEN_SOURCE_GROUP`, :prop_gbl:`AUTOMOC_SOURCE_GROUP`,
:prop_gbl:`AUTORCC_SOURCE_GROUP` and :prop_gbl:`AUTOUIC_SOURCE_GROUP` target
properties may influence where the generated sources are grouped in the project's
file lists.
......
......@@ -943,8 +943,14 @@ bool cmQtAutoGenInitializer::InitScanFiles()
this->LocalGen->GetCurrentSourceDirectory(),
cmSystemTools::GetFilenamePath(fullPath));
// Avoid creating a path containing adjacent slashes
if (!uiHeaderRelativePath.empty() &&
uiHeaderRelativePath.back() != '/') {
uiHeaderRelativePath += '/';
}
auto uiHeaderFilePath = cmStrCat(
'/', uiHeaderRelativePath, '/', "ui_"_s,
'/', uiHeaderRelativePath, "ui_"_s,
cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s);
ConfigString uiHeader;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment