Priority: P3: Somewhat important
Affects Version/s: 6.2.2, 6.3.0 Alpha
Fix Version/s: None
Component/s: Build System: CMake
We ship a few different types of executables with Qt, but we currently don't categorize all of them correctly and some executable categories are missing / can't be handled quite correctly by the APIs that we provide (qt_internal_add_app / qt_internal_add_tool).
We should try to come up with a proper model and re-categorize all existing tools as needed.
Summary after discussing internally:
TLDR: Add a new NO_REQUIRE_HOST_TOOL option to qt_internal_add_tool and re-visit each executable that it uses the proper options.
We seem to have executables with four parameters:
- user-facing vs. internal
- maybe built when cross-compiling
- maybe creates a target in host Qt that can be imported in target Qt
- maybe required in host Qt when building target Qt
Currently, from "creates a target in host Qt that can be imported in
target Qt" implies "is required in host Qt". We might want to have
executables that create targets in the host Qt but that are not
required in the target Qt (platform-specific executables like windeployqt)
Executables that are supposed to be called by the user are called
"user-facing". These are placed in INSTALL_BINDIR.
Executables that are not user-facing are placed in INSTALL_LIBEXECDIR.
- built when cross-compiling
- does not create a target in host Qt that can be imported in target Qt
- not required in host Qt when building target Qt
changing the defaults:
can be made internal by placing in INSTALL_LIBEXECDIR
Example: sdpscanner in qtconnectivity
- built when cross-compiling: always true?
except iOS where we use qt_exclude_tool_directories_from_default_target
for Assistant App, but Assistant will become a tool so not needed there
- does not create a target in host Qt that can be imported in target
Qt: always true
- not required when building Qt: always true
- not built when cross-compiling
- creates a target in host Qt that can be imported in target Qt
- required in host Qt when building target Qt
changing the defaults:
- internal: can be marked as USER_FACING
- built when cross-compiling: can be changed for all tools with
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON, individual tools can be
skipped for cross-compilation by conditionally adding their
subdirectory (windeployqt case)
- creates a target in host Qt that can be imported in target Qt:
cannot be changed
- required in host Qt when building target Qt:
can be changed via new (to be implemented) NO_REQUIRE_HOST_TOOL
option (better naming pending) for cases like windeployqt
"tools" and "apps" are just "default parameter sets" for creating Qt executables,
which can be further customized to meet specific needs.
One particularly interesting set of tools are those that are only cross-compiled when
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING is ON, these intended to be used on the target platform
as developer tools when building Qt projects (Assistant, Designer, deployqt tools,
qmllint, qmlformat, etc)