14bbbdcb |
1 | #qt |
2 | |
05ed7ed8 |
3 | # Qt is searched manually first (just determine root) |
4 | message (STATUS "Processing Qt 3-rd party") |
4f4b8935 |
5 | |
05ed7ed8 |
6 | if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "") |
7 | FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME) |
14bbbdcb |
8 | |
05ed7ed8 |
9 | if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "") |
28b13b31 |
10 | set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt") |
11 | message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR") |
05ed7ed8 |
12 | endif() |
14bbbdcb |
13 | |
05ed7ed8 |
14 | # Combine directory name with absolute path and show in GUI |
15 | set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE) |
16 | message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}") |
17 | endif() |
14bbbdcb |
18 | |
19 | set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}") |
41ea50ac |
20 | |
21 | # Now set CMAKE_PREFIX_PATH to point to local Qt installation. |
22 | # Without this setting find_package() will not work |
23 | set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR}) |
24 | |
25 | # Now we can apply standard CMake finder for Qt5. We do this mostly |
26 | # to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled |
6822a3be |
27 | find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH) |
41ea50ac |
28 | if (NOT ${Qt5_FOUND}) |
29 | # Now we can apply standard CMake finder for Qt. We do this mostly |
30 | # to have qt4_wrap_cpp() function available |
31 | find_package(Qt4) |
32 | #message (STATUS "Qt4 cmake configuration") |
33 | else() |
34 | #message (STATUS "Qt5 cmake configuration") |
28b13b31 |
35 | endif() |
36 | |
37 | if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}") |
38 | list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin") |
39 | else() |
40 | list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR) |
41 | endif() |