FindQt — CMake 4.1.2 Documentation

# FindQt

Deprecated since version 3.14: This module is available only if policy `CMP0084` is not set to `NEW`. It supports only Qt3 and Qt4. For Qt5 or later versions see `cmake-qt(7)`.

This module finds an installed version of Qt3 or Qt4. Qt is a cross-platform application development framework for creating graphical user interfaces and applications.

Use this module only if the project can work with both Qt3 and Qt4 versions. If a specific version is required, use `FindQt4` or `FindQt3` module directly.

Behavior:

- If multiple Qt versions are found, the user must set the preferred major Qt version with the `DESIRED_QT_VERSION` variable.

- If only one Qt version is found, then the `DESIRED_QT_VERSION` is set automatically.

- Once the `DESIRED_QT_VERSION` variable is set, the corresponding `FindQt3` or `FindQt4` module is included.

## Result Variables

This module sets the following variables:

`QT4_INSTALLED`

  `TRUE` if Qt4 is found.

`QT3_INSTALLED`

  `TRUE` if Qt3 is found.

## Hints

`QT_REQUIRED`

  If this variable is set to `TRUE` before calling `find_package(Qt)`, CMake will raise an error if neither Qt3 nor Qt4 is found.

`DESIRED_QT_VERSION`

  Specifies the Qt major version to use. Can be either `3`, `4`, or empty, to search for version automatically.

## Examples

Finding Qt3 or Qt4 version:

    find_package(Qt)