]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Remove spurious body tags in macro test file.
[lyx.git] / CMakeLists.txt
index 48688dced37a097cd8d5f6e31e62d09e64479551..933a8f38455e8ce82adf86fdd64d41b609210446 100644 (file)
@@ -461,7 +461,14 @@ else()
   set(SYSTEM_DATADIR "${CMAKE_INSTALL_PREFIX}")
 endif()
 
-if(LYX_PACKAGE_SUFFIX)
+# The define below allows lyx-executable to find its default configuration files
+# see routines
+#    Package::messages_file()
+#    get_default_user_support_dir()
+#    relative_system_support_dir()
+# in src/support/Package.cpp
+#
+if(LYX_PROGRAM_SUFFIX)
        set(PACKAGE ${PACKAGE_BASE}${LYX_INSTALL_SUFFIX})
 else()
        set(PACKAGE ${PACKAGE_BASE})
@@ -572,7 +579,15 @@ if(NOT MSVC)
        if(NOT LYX_QUIET)
                set(CMAKE_VERBOSE_MAKEFILE ON)
        endif()
-    set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}")
+       set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}")
+       if(LYX_CXX_FLAGS MATCHES "\\+\\+(14|11|98)")
+         # Thanks to Brad King <brad.king@kitware.com>
+         # for the pointer to https://cmake.org/cmake/help/v3.6/variable/CMAKE_CXX_STANDARD.html
+         # This allows us to use QT5.7 with recent g++ (version >= 4.9) compilers
+         # and still use our own c++ extension tests
+         set(CMAKE_CXX_STANDARD ${CMAKE_MATCH_1})
+         message(STATUS "CMAKE_CXX_STANDARD set to ${CMAKE_CXX_STANDARD}")
+       endif()
        if(LYX_STDLIB_DEBUG)
                set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
        endif()
@@ -636,8 +651,9 @@ elseif(LYX_USE_QT MATCHES "QT4")
        macro (qt_wrap_uifiles)
                qt4_wrap_ui(${ARGN})
        endmacro()
+        set(LYX_QTMAIN_LIBRARY ${QT_QTSVG_LIBRARY})
        if(WIN32)
-               set(LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARIES})
+               list(APPEND LYX_QTMAIN_LIBRARY ${QT_QTMAIN_LIBRARIES})
        endif()
 else()
   message(FATAL_ERROR "Unhandled value for LYX_USE_QT (${LYX_USE_QT})")