Handles various common platform-specific tasks associated with a Qt project.
Note: This command is in technology preview and may change in future releases.
The command is defined in the Core
component of the Qt6
package, which can be loaded like so:
find_package(Qt6 REQUIRED COMPONENTS Core)
This command was introduced in Qt 6.3.
qt_finalize_project()
If versionless commands are disabled, use qt6_finalize_project()
instead. It supports the same set of arguments as this command.
Some targets that are created using Qt commands require additional actions at the end of CMake configuring phase. Depending on the platform, the function typically:
With CMake version 3.19 or later, you don't need to call this command since it consists of sub-commands that are ordinarily invoked at the end of CMAKE_SOURCE_DIR
directory scope processing.
Warning: If your Android project is built using a CMake version lower than 3.19, make sure that you call qt6_finalize_project() at the end of a top-level CMakeLists.txt.
For projects that use a CMake version lower than 3.19, you need to call qt_finalize_project
manually. This example shows the typical use of the function:
cmake_minimum_required(VERSIONS 3.16) project(MyProject LANGUAGES CXX) find_package(Qt6 REQUIRED COMPONENTS Core) qt_add_executable(MyApp main.cpp) add_subdirectory(mylib) qt_finalize_project()
See also QT_NO_COLLECT_BUILD_TREE_APK_DEPS.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: