CMake Variable Reference
Qt modules loaded with
find_package set various variables.
Note: You rarely need to access these variables directly. Common tasks like linking against a module should be done through the library targets each module defines.
find_package(Qt5 COMPONENTS Widgets), when successful, makes the following variables available:
|A list of compile definitions to use when building against the library.|
|A list of definitions to use when building against the library.|
|A string of flags to use when building executables against the library.|
|A boolean that describes whether the module was found successfully.|
|A list of include directories to use when building against the library.|
|The name of the imported target for the module: |
|A list of private include directories to use when building against the library and using private Qt API.|
|A string containing the module's version.|
For all packages found with
find_package, equivalents of these variables are available; they are case-sensitive.
Additionally, there are also variables that don't relate to a particular package, but to the Qt installation itself.
|An integer that controls the Qt version that |
If set to
If not set, the first
|A string that holds the infix used in library names, when Qt is configured with |
|Since Qt 5.15, modules define not only commands that start with |
|Since Qt 5.15, modules define not only targets that start with |
|On Unix, a boolean that describes whether Qt libraries and plugins were compiled with |