]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Re-organization of Additional Features manual by John Hudson.
[lyx.git] / CMakeLists.txt
index fee89e135c3cb602dfb24b0225813789a9b9bbb5..cf0e708554281b00ac2930df98f2f8802dfd6ff5 100644 (file)
@@ -156,7 +156,6 @@ LYX_OPTION(PROFILE              "Build with options for gprof" OFF GCC)
 LYX_OPTION(CONSOLE               "Show console on Windows, enforce with =FORCE" ON MSVC)
 LYX_OPTION(VLD                   "Use VLD with MSVC" OFF MSVC)
 LYX_OPTION(WALL                  "Enable all warnings" OFF MSVC)
-LYX_OPTION(CONFIGURE_CHECKS      "Also run configure checks for MSVC" OFF MSVC)
 LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC)
 
 # APPLE specific
@@ -211,17 +210,19 @@ endif()
 
 if(LYX_DEPENDENCIES_DOWNLOAD)
        message(STATUS)
-    if(MSVC12)
-        set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2013-deps)
-        set(deps_files lyx-windows-deps-msvc2013.zip)
-        set(deps_server http://ftp.lyx.de/LyX-Windows-Deps)
-        set(GNUWIN32_DIR ${LYX_DEPENDENCIES_DIR}/lyx-windows-deps-msvc2013)
-    else()
-        set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2010-deps)
-           set(deps_files lyx20-deps-msvc2010-x86.zip)
-           set(deps_server http://downloads.sourceforge.net/project/lyx/Win_installers/Dependencies)
-        set(GNUWIN32_DIR ${LYX_DEPENDENCIES_DIR}/deps20)
-    endif()
+       if(MSVC14)
+               set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2015-deps)
+               set(deps_files lyx-windows-deps-msvc2015.zip)
+               set(deps_server http://ftp.lyx.de/LyX-Windows-Deps)
+               set(GNUWIN32_DIR ${LYX_DEPENDENCIES_DIR}/lyx-windows-deps-msvc2015)
+       elseif(MSVC10)
+               set(LYX_DEPENDENCIES_DIR ${TOP_BINARY_DIR}/msvc2010-deps)
+               set(deps_files lyx-windows-deps-msvc2010.zip)
+               set(deps_server http://ftp.lyx.de/LyX-Windows-Deps)
+               set(GNUWIN32_DIR ${LYX_DEPENDENCIES_DIR}/lyx-windows-deps-msvc2010)
+       else()
+               message(FATAL_ERROR "error: no dependency package known for the selected MSVC version.")
+       endif()
     message(STATUS "Using downloaded dependencies in ${LYX_DEPENDENCIES_DIR}")
        foreach(it ${deps_files})
                set(already_downloaded already_downloaded-NOTFOUND CACHE PATH "downloaded" FORCE)
@@ -260,17 +261,28 @@ if(NOT CXX11COMPILER_FOUND)
 endif()
 set(LYX_GCC11_MODE)
 if(UNIX OR MINGW)
-       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)
-               if(GCC_VERSION VERSION_LESS 4.3)
-                       message(FATAL_ERROR "gcc >= 4.3 is required.")
-               endif()
-               # <regex> in gcc is unusable in versions less than 4.9.0
-               # see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
-               set(LYX_USE_STD_REGEX 0)
+       if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$")
+         # ignore the GCC_VERSION for clang
+         # and use the resulting CXX11_STD_REGEX found in FindCXX11Compiler.cmake
+         message(STATUS "Using clang")
+         if(CXX11_STD_REGEX)
+           set(LYX_USE_STD_REGEX 1)
+         else()
+           set(LYX_USE_STD_REGEX 0)
+         endif()
        else()
-               set(LYX_USE_STD_REGEX 1)
+         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)
+                 if(GCC_VERSION VERSION_LESS 4.6)
+                         message(FATAL_ERROR "gcc >= 4.6 is required.")
+                 endif()
+                 # <regex> in gcc is unusable in versions less than 4.9.0
+                 # see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
+                 set(LYX_USE_STD_REGEX 0)
+         else()
+                 set(LYX_USE_STD_REGEX 1)
+         endif()
        endif()
        set(LYX_GCC11_MODE "${CXX11_FLAG}")
 else()
@@ -893,13 +905,9 @@ if (WIN32 AND Qt5Core_FOUND)
        set(Z_PREFIX 1)
 endif()
 
-# compiler tests, config.h generation
-if(MSVC AND NOT LYX_CONFIGURE_CHECKS)
-       configure_file(${LYX_CMAKE_DIR}/configCompiler.h.msvc ${TOP_BINARY_DIR}/configCompiler.h)
-else()
-       include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
-       configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
-endif()
+# compiler tests, config.h generation LYX_CONFIGURE_CHECKS
+include(${LYX_CMAKE_DIR}/ConfigureChecks.cmake)
+configure_file(${LYX_CMAKE_DIR}/configCompiler.h.cmake ${TOP_BINARY_DIR}/configCompiler.h)
 
 set(QPA_XCB)
 if(Qt5X11Extras_FOUND AND QT_USES_X11)