2019-11-18 22:59:06 +08:00
|
|
|
|
|
|
|
# Instruct CMake to run moc+rcc+uic automatically when needed.
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
2022-04-19 05:10:05 +08:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGL REQUIRED)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets PrintSupport Svg Xml OpenGL REQUIRED)
|
2022-04-22 19:27:31 +08:00
|
|
|
if(${QT_VERSION_MAJOR} VERSION_GREATER_EQUAL "6")
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS OpenGLWidgets)
|
|
|
|
endif()
|
2022-04-21 16:57:24 +08:00
|
|
|
|
2022-04-22 19:27:31 +08:00
|
|
|
# configure compiler
|
|
|
|
if(${QT_VERSION_MAJOR} VERSION_LESS "6" )
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
2022-04-21 16:57:24 +08:00
|
|
|
endif()
|