- Qt 6.5
- Qt WebEngine
- qt_add_webengine_dictionary
- Qt 6.5.3 Reference Documentation

# qt_add_webengine_dictionary

This command was introduced in Qt 6.3.

## Synopsis

     qt_add_webengine_dictionary(
         [TARGET]
         [SOURCE]
         [OUTPUT_DIRECTORY]
     )

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

## Description

A spell checker in Qt Web Engine needs dictionaries in a specific binary format. This CMake command converts dictionaries from the Hunspell project. into the `bdict` binary format. It creates a `qtwebengine_dictionaries` target, which your project can use as a dependency. This way your project can easily add dictionaries for the spell checker. Refer to the spell checker example for more details.

## Arguments

`TARGET` is an optinal argument and specifies the name of the application target that should depend on `qtwebengine_dictionaries` target. In other words it is used to define a build dependency to create the binary format of dictionaries before building `TARGET`.

`SOURCE` is the absolute path to the Hunspell project dictionary for which a corresponding binary format (`.bdict`) will be created.

`OUTPUT_DIRECTORY` is an optional argument and specifies the directory where the binary format of the dictionary will be created. If not specified, `CMAKE_CURRENT_BINARY_DIR` will be used as `OUTPUT_DIRECTORY`.

Note: The `qtwebengine_dictionaries` directory or `<CONFIG>/qtwebengine_dictionaries` directories in the case of the multi-config generator is appended to OUTPUT_DIRECTORY. This helps to utilize dictionaries, as the `webengine_dictionaries` directory is the default search location.