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).
Finds an installed version of Qt3 or Qt4:
find_package(Qt [...])
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_VERSIONvariable. - If only one Qt version is found, then the
DESIRED_QT_VERSIONis set automatically. - Once the
DESIRED_QT_VERSIONvariable is set, the correspondingFindQt3orFindQt4module is included.
Result Variables
This module defines the following variables:
-
QT4_INSTALLED -
TRUEif Qt4 was found. -
QT3_INSTALLED -
TRUEif Qt3 was found.
Hints
-
QT_REQUIRED -
If this variable is set to
TRUEbefore callingfind_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)
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/module/FindQt.html