IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

qt_finalize_project

Handles various common platform-specific tasks associated with a Qt project.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

qt_finalize_project

Handles various common platform-specific tasks associated with a Qt project.

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:

 
Sélectionnez
find_package(Qt6 REQUIRED COMPONENTS Core)

This command was introduced in Qt 6.3.

Synopsis

 
Sélectionnez
qt_finalize_project()

If versionless commands are disabled, use qt6_finalize_project() instead. It supports the same set of arguments as this command.

Description

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:

  • Walks the build tree.

  • Resolves dependencies.

  • Applies any extra deployment steps.

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.

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.

Examples

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:

 
Sélectionnez
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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+