Cmake build: Require std >= 17 for compilation of QT6

This commit is contained in:
Kornel Benko 2024-06-25 13:50:32 +02:00
parent e653907b84
commit 5ee53450bb

View File

@ -526,7 +526,7 @@ endif()
if(LYX_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice install prefix" FORCE)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(LYX_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice install prefix" FORCE)
set(LYX_INSTALL_PREFIX ${LYX_INSTALL_PREFIX} CACHE PATH "LyX user's choice install prefix" FORCE)
endif()
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# see http://www.cmake.org/pipermail/cmake/2006-October/011559.html
@ -788,6 +788,10 @@ set(QtCore5CompatLibrary)
set(QtCore5CompatModule)
if(LYX_USE_QT MATCHES "QT6|QT5")
if (LYX_USE_QT MATCHES "QT6")
if (CMAKE_CXX_STANDARD LESS 20)
message(STATUS "CXX_STANDARD = ${CMAKE_CXX_STANDARD}")
message(FATAL_ERROR "QT6 compilation requires at least CXX_STANDARD = 17")
endif()
set(QtVal "Qt6")
macro (qt_add_resources)
Qt6_add_resources(${ARGN})
@ -796,6 +800,10 @@ if(LYX_USE_QT MATCHES "QT6|QT5")
Qt6_wrap_ui(${ARGN})
endmacro()
else()
if (CMAKE_CXX_STANDARD LESS 11)
message(STATUS "CXX_STANDARD = ${CMAKE_CXX_STANDARD}")
message(FATAL_ERROR "QT6 compilation requires at least CXX_STANDARD = 11")
endif()
set(QtVal "Qt5")
macro (qt_add_resources)
Qt5_add_resources(${ARGN})