diff --git a/CMakeLists.txt b/CMakeLists.txt index ab165f0d1e..070c0e18d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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})