Qt: Enable building against Qt6 by default

This commit is contained in:
Vicki Pfau 2024-03-25 21:27:58 -07:00
parent ae8b88a4a3
commit 86551614d9
1 changed files with 13 additions and 6 deletions

View File

@ -25,12 +25,19 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(QT_LIBRARIES)
set(QT_V 5)
find_package(Qt${QT_V} COMPONENTS Core Widgets Network OPTIONAL_COMPONENTS Multimedia)
if(QT_V GREATER_EQUAL 6)
find_package(Qt${QT_V} COMPONENTS OpenGL OpenGLWidgets)
endif()
set(QT Qt${QT_V})
set(QT_VERSIONS 6 5)
foreach(V ${QT_VERSIONS})
set(QT Qt${V})
set(QT_V ${V})
message("${V} ${QT} ${QT_V}")
find_package(${QT} COMPONENTS Core Widgets Network OPTIONAL_COMPONENTS Multimedia)
if(QT_V GREATER_EQUAL 6)
find_package(${QT} COMPONENTS OpenGL OpenGLWidgets)
endif()
if(${${QT}Widgets_FOUND})
break()
endif()
endforeach()
if(NOT BUILD_GL AND NOT BUILD_GLES2 AND NOT BUILD_GLES3)
message(WARNING "OpenGL is recommended to build the Qt port")