ECMQueryQt — Extra CMake Modules 5.106.0 documentation

# ECMQueryQt

This module can be used to query the installation paths used by Qt.

For Qt5 this uses `qmake`, and for Qt6 this used `qtpaths` (the latter has built-in support to query the paths of a target platform when cross-compiling).

This module defines the following function:

    ecm_query_qt(<result_variable> <qt_variable> [TRY])

Passing `TRY` will result in the method not making the build fail if the executable used for querying has not been found, but instead simply print a warning message and return an empty string.

Example usage:

    include(ECMQueryQt)
    ecm_query_qt(bin_dir QT_INSTALL_BINS)

If the call succeeds `${bin_dir}` will be set to `<prefix>/path/to/bin/dir` (e.g. `/usr/lib64/qt/bin/`).

Since: 5.93