FindQt3

Finds Qt3, a cross-platform application development framework for creating graphical user interfaces and applications:

find_package(Qt3 [<version>] [...])

備註

This module is for Qt version 3. As of Qt version 5, the Qt upstream also provides an exported configuration to find Qt. New code should follow the cmake-qt(7) instead of using this module.

結果變數

該模組定義了以下變數:

Qt3_FOUND

在 3.3 版被加入.

Boolean indicating whether (the requested version of) Qt3 was found.

QT_FOUND

Same as Qt3_FOUND. Boolean indicating whether (the requested version of) Qt3 was found. This variable is provided for compatibility with other Qt find modules.

Qt3_VERSION

在 4.2 版被加入.

The version of Qt3 that was found.

QT_LIBRARIES

Libraries needed to link against for using Qt3.

QT_DEFINITIONS

A list of compile definitions to use when compiling code that uses Qt3.

快取變數

The following cache variables may also be set:

QT_INCLUDE_DIR

The directory containing qt.h and other Qt3 header files.

The following cache variables may also be set but are not meant for general use:

QT_MOC_EXECUTABLE

Path to the moc tool.

QT_UIC_EXECUTABLE

Path to the uic tool.

QT_QT_LIBRARY

Path to the Qt3 library.

QT_QTMAIN_LIBRARY

Path to the qtmain library. This is only required by Qt3 on Windows.

提示

QT_MT_REQUIRED

To search for the multithreaded version of Qt3, set this variable to TRUE before looking for Qt3.

已棄用的變數

The following variables are provided for backward compatibility:

QT_VERSION_STRING

在 4.2 版之後被棄用: Use Qt3_VERSION, which has the same value.

The version of Qt3 that was found.

範例

Finding Qt3 on the system:

find_package(Qt3)
if(Qt3_FOUND)
  target_link_libraries(foo PRIVATE ${QT_LIBRARIES})
  target_include_directories(foo PRIVATE ${QT_INCLUDE_DIR})
  target_compile_definitions(foo PRIVATE ${QT_DEFINITIONS})
endif()

Looking for the multithreaded version of Qt3:

set(QT_MT_REQUIRED TRUE)
find_package(Qt3)