commit 5ee53450bbef83b60edde401b075f2e1d51ce5b7
Author: Kornel Benko <kor...@lyx.org>
Date:   Tue Jun 25 13:50:32 2024 +0200

    Cmake build: Require std >= 17 for compilation of QT6
---
 CMakeLists.txt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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})
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to