0029308: Configuration, Inspectors - search of Qt in CMake scripts is separated from...
[occt.git] / adm / cmake / qt.cmake
CommitLineData
14bbbdcb 1#qt
2
05ed7ed8 3# Qt is searched manually first (just determine root)
4message (STATUS "Processing Qt 3-rd party")
4f4b8935 5
05ed7ed8 6if (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 "")
10 message (FATAL_ERROR "... Qt root directory was not found")
11 endif()
14bbbdcb 12
05ed7ed8 13 # Combine directory name with absolute path and show in GUI
14 set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
15 message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
16endif()
14bbbdcb 17
18set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
41ea50ac 19
20# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
21# Without this setting find_package() will not work
22set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
23
24# Now we can apply standard CMake finder for Qt5. We do this mostly
25# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
6822a3be 26find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
41ea50ac 27if (NOT ${Qt5_FOUND})
28 # Now we can apply standard CMake finder for Qt. We do this mostly
29 # to have qt4_wrap_cpp() function available
30 find_package(Qt4)
31 #message (STATUS "Qt4 cmake configuration")
32else()
33 #message (STATUS "Qt5 cmake configuration")
05ed7ed8 34endif()