f172b964f6
This makes the code clearer and decouples it from the GLWidget. As a drive-by, add a global shortcut to close. Pick-to: 6.3 6.2 Change-Id: I3469d29bc367acc17c5f8acf9d46219259b8315b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
39 lines
913 B
CMake
39 lines
913 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(threadedqopenglwidget LANGUAGES CXX)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
|
set(INSTALL_EXAMPLESDIR "examples")
|
|
endif()
|
|
|
|
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/opengl/threadedqopenglwidget")
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets)
|
|
|
|
qt_add_executable(threadedqopenglwidget
|
|
renderer.cpp renderer.h
|
|
glwidget.cpp glwidget.h
|
|
main.cpp
|
|
mainwindow.cpp mainwindow.h
|
|
)
|
|
|
|
set_target_properties(threadedqopenglwidget PROPERTIES
|
|
WIN32_EXECUTABLE TRUE
|
|
MACOSX_BUNDLE TRUE
|
|
)
|
|
|
|
target_link_libraries(threadedqopenglwidget PUBLIC
|
|
Qt::Core
|
|
Qt::Gui
|
|
Qt::OpenGL
|
|
Qt::OpenGLWidgets
|
|
Qt::Widgets
|
|
)
|
|
|
|
install(TARGETS threadedqopenglwidget
|
|
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
)
|