]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Document the export tests and other tests
[lyx.git] / CMakeLists.txt
index 531532627d1d20d1fdaea79c0e19b98946e6ff27..a87b049357d195c3f2317321b4fe25981567aa25 100644 (file)
@@ -40,6 +40,9 @@ if(COMMAND cmake_policy)
        cmake_policy(SET CMP0005 OLD)
        # Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION
        cmake_policy(SET CMP0006 NEW)
+       if(POLICY CMP0020)
+               cmake_policy(SET CMP0020 OLD)
+       endif()
        if(POLICY CMP0028)
                cmake_policy(SET CMP0028 OLD)
        endif()
@@ -134,6 +137,7 @@ LYX_OPTION(BUNDLE           "Build bundle  (experimental) " OFF ALL)
 LYX_OPTION(ENABLE_URLTESTS  "Enable for URL tests" OFF ALL)
 LYX_OPTION(ENABLE_EXPORT_TESTS "Enable for export tests" OFF ALL)
 LYX_OPTION(ASAN             "Use address sanitizer" OFF ALL)
+LYX_COMBO(USE_QT            "Use Qt version as frontend" QT4 QT5)
 
 # GCC specific
 LYX_OPTION(PROFILE              "Build profile version" OFF GCC)
@@ -142,7 +146,6 @@ LYX_OPTION(PROGRAM_SUFFIX       "Append version suffix to binaries" ON GCC)
 LYX_OPTION(DEBUG_GLIBC          "Enable libstdc++ debug mode" OFF GCC)
 LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++ pedantic debug mode" OFF GCC)
 LYX_OPTION(STDLIB_DEBUG         "Use debug stdlib" OFF GCC)
-LYX_OPTION(CONCEPT_CHECKS       "Enable concept-checks" OFF GCC)
 LYX_OPTION(PROFILE              "Build with options for gprof" OFF GCC)
 LYX_OPTION(ENABLE_CXX11         "Build with options for c++11-mode" OFF GCC)
 
@@ -156,11 +159,6 @@ LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC)
 # APPLE specific
 LYX_OPTION(DMG                   "Build as Mac bundle, needed for .dmg  (experimental) " OFF MAC)
 LYX_OPTION(COCOA                 "Use Cocoa on Mac" OFF MAC)
-if(LYX_XMINGW)
-  LYX_COMBO(USE_QT               "Use Qt version as frontend for MINGW" QT4)
-else()
-  LYX_COMBO(USE_QT               "Use Qt version as frontend" QT4 QT5)
-endif()
 
 
 if(help OR HELP)
@@ -251,7 +249,7 @@ endif()
 
 set(LYX_GCC11_MODE)
 if(UNIX OR MINGW)
-       execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+       execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
        message(STATUS "Using GCC version ${GCC_VERSION}")
        if(GCC_VERSION VERSION_LESS 4.9)
                # <regex> in gcc is unusable in versions less than 4.9.0
@@ -529,9 +527,6 @@ if(NOT MSVC)
        if(LYX_STDLIB_DEBUG)
                set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
        endif()
-       if(LYX_CONCEPT_CHECKS)
-               set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCPP_CONCEPT_CHECKS")
-       endif()
        set(CMAKE_CXX_FLAGS       "${LYX_CXX_FLAGS} -fno-strict-aliasing " CACHE TYPE STRING FORCE)
        set(CMAKE_CXX_FLAGS_DEBUG "${LYX_CXX_FLAGS} -fno-strict-aliasing -O0 -g3 -D_DEBUG" CACHE TYPE STRING FORCE)
        if(MINGW)
@@ -550,9 +545,9 @@ if(LYX_CXX_FLAGS_EXTRA)
 endif()
 
 if(LYX_XMINGW)
-    set(QT_MINGW_DIR ${LYX_QT4} CACHE PATH "Qt for Mingw" FORCE)
-    list(APPEND CMAKE_FIND_ROOT_PATH ${QT_MINGW_DIR} ${GNUWIN32_DIR})
+       list(APPEND CMAKE_FIND_ROOT_PATH ${GNUWIN32_DIR})
 endif()
+
 if(LYX_USE_QT MATCHES "QT5")
        find_package(Qt5Core REQUIRED)
        if (Qt5Core_FOUND)
@@ -575,6 +570,10 @@ if(LYX_USE_QT MATCHES "QT5")
                message(STATUS "Found Qt-Version ${QTVERSION}")
        endif()
 elseif(LYX_USE_QT MATCHES "QT4")
+       if(LYX_XMINGW)
+               set(QT_MINGW_DIR ${LYX_QT4} CACHE PATH "Qt for Mingw" FORCE)
+               list(APPEND CMAKE_FIND_ROOT_PATH ${QT_MINGW_DIR} ${GNUWIN32_DIR})
+       endif()
        find_package(Qt4 "4.5.0" REQUIRED)
        macro (qt_use_modules)
        endmacro()
@@ -662,6 +661,13 @@ if(LYX_EXTERNAL_BOOST)
                message(STATUS "Boost found")
                message(STATUS "Boost-libs = ${Boost_LIBRARIES}")
                set(Lyx_Boost_Libraries ${Boost_LIBRARIES})
+               if (LYX_STDLIB_DEBUG)
+                       # Comment from  Jean-Marc Lasgouttes:
+                       # In general, system boost libraries are incompatible with
+                       # the use of stdlib-debug in libstdc++. See ticket #9736 for
+                       # details.
+                       message(WARNING "Compiling LyX with stdlib-debug and system boost libraries may lead to crashes. Consider using '-DLYX_STDLIB_DEBUG=OFF' or using '-DLYX_EXTERNAL_BOOST=OFF'")
+               endif()
        else()
                message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON})
        endif()