BUG: Qt5 components not correctly detected if only Qt5_DIR is provided, when this is supported by Qt CMake system.

Fixed by updating Qt5 find_package call to use modern CMake syntax
pull/14410/head
Adam Rankin 6 years ago
parent cedd78d526
commit a164a131f9
  1. 10
      cmake/OpenCVFindLibsGUI.cmake

@ -15,15 +15,11 @@ endif()
ocv_clear_vars(HAVE_QT HAVE_QT5)
if(WITH_QT)
if(NOT WITH_QT EQUAL 4)
find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Widgets)
find_package(Qt5Test)
find_package(Qt5Concurrent)
if(Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND AND Qt5Concurrent_FOUND)
find_package(Qt5 COMPONENTS Core Gui Widgets Test Concurrent REQUIRED NO_MODULE)
if(Qt5_FOUND)
set(HAVE_QT5 ON)
set(HAVE_QT ON)
find_package(Qt5OpenGL)
find_package(Qt5 COMPONENTS OpenGL QUIET)
if(Qt5OpenGL_FOUND)
set(QT_QTOPENGL_FOUND ON)
endif()

Loading…
Cancel
Save