--- modules/highgui/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: opencv-4.11.0/modules/highgui/CMakeLists.txt =================================================================== --- opencv-4.11.0.orig/modules/highgui/CMakeLists.txt +++ opencv-4.11.0/modules/highgui/CMakeLists.txt @@ -125,7 +125,11 @@ elseif(HAVE_QT) endif() foreach(dt_dep ${qt_deps}) - add_definitions(${Qt${QT_VERSION_MAJOR}${dt_dep}_DEFINITIONS}) + if((QT_VERSION_MAJOR GREATER 5) AND (QT_VERSION_MINOR GREATER 8)) + link_libraries(${Qt${QT_VERSION_MAJOR}${dt_dep}}) + else() + add_definitions(${Qt${QT_VERSION_MAJOR}${dt_dep}_DEFINITIONS}) + endif() include_directories(${Qt${QT_VERSION_MAJOR}${dt_dep}_INCLUDE_DIRS}) list(APPEND HIGHGUI_LIBRARIES ${Qt${QT_VERSION_MAJOR}${dt_dep}_LIBRARIES}) endforeach()