X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=59c9d7c5777486c3fd54a0f3285a3cb6ede99928;hb=16e5e1a614b8dbe2eec61c0f8d992f292451e5d7;hp=e2e1e1f6688e81d47efc1b29ef055bc11b5a25da;hpb=77f4d162a0f64011453fd6fd58f66e4947cf9739;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e2e1e1f668..59c9d7c577 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,9 +77,9 @@ if(NOT help AND NOT HELP) # 'project' triggers the searching for a compiler project(${LYX_PROJECT}) if (CMAKE_COMPILER_IS_GNUCXX) - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}") - message(STATUS "is too old, should be >= 4.0") + message(STATUS "is too old, should be >= 4.9") message(FATAL_ERROR "Exiting") endif() endif() @@ -231,7 +231,6 @@ LYX_COMBO(EXTERNAL_MYTHES "OFF := Build 3rdparty lib mytheslib" AUTO OFF ON) # GCC specific LYX_OPTION(PROFILE "Build with options for gprof" ${DefaultLyxProfile} GCC) -LYX_OPTION(EXTERNAL_BOOST "Use external boost" ${DefaultExternalLibs} GCC) 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) @@ -275,11 +274,6 @@ if (LYX_ENABLE_VALGRIND_TESTS) message(FATAL_ERROR "Cannot use valgrind tests, executable valgrind is missing. Please disable LYX_ENABLE_VALGRIND_TESTS") endif() endif() -if (LYX_DEBUG_GLIBC OR LYX_DEBUG_GLIBC_PEDANTIC OR LYX_STDLIB_DEBUG) - if (LYX_EXTERNAL_BOOST) - message(FATAL_ERROR "Using external boost not compatible with debug mode for stdlib") - endif() -endif() if(LYX_DMG) set(LYX_BUNDLE ON) @@ -380,13 +374,7 @@ unset(LYX_GCC11_MODE) if(UNIX OR MINGW) if (CMAKE_CXX_COMPILER_ID MATCHES "^([cC]lang|AppleClang)$") # 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() execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion OUTPUT_VARIABLE GCC_VERSION ERROR_VARIABLE _error RESULT_VARIABLE _err OUTPUT_STRIP_TRAILING_WHITESPACE) #message(STATUS "dumpfullversion: error = ${_error}, result = ${_err}") @@ -396,14 +384,8 @@ if(UNIX OR MINGW) #message(STATUS "dumpversion: error = ${_error}, result = ${_err}") endif() message(STATUS "Using GCC version ${GCC_VERSION}") - if(GCC_VERSION VERSION_LESS 4.6) - message(FATAL_ERROR "gcc >= 4.6 is required.") - elseif(GCC_VERSION VERSION_LESS 4.9) - # 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) + if(GCC_VERSION VERSION_LESS 4.9) + message(FATAL_ERROR "gcc >= 4.9 is required.") endif() endif() set(LYX_GCC11_MODE "${CXX11_FLAG}") @@ -411,9 +393,6 @@ else() if(MSVC_VERSION LESS 1900) # Drop support for msvc versions prior to 1900 (Visual Studio 2015) message(FATAL_ERROR "Visual Studio >= 2015 is required.") - set(LYX_USE_STD_REGEX 0) - else() - set(LYX_USE_STD_REGEX 1) endif() endif() @@ -706,7 +685,7 @@ else() # The following setting with LYX_GCC11_MODE is needed because cmake does not honor # CMAKE_CXX_STANDARD while performing tests like # check_cxx_source_compiles("..." HAVE_DEF_MAKE_UNIQUE) - set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}") + set(LYX_CXX_FLAGS "-Wall -Wextra -Wno-deprecated-copy ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}") if(LYX_STDLIB_DEBUG) set(LYX_CXX_FLAGS "${LYX_CXX_FLAGS} -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC") else() @@ -948,41 +927,6 @@ if(NOT LYX_EXTERNAL_DTL) add_subdirectory(3rdparty/dtl) endif() -if(LYX_USE_STD_REGEX) - # Set only include path. - # Use internal boost, which is known to exist - # we don't need any libraries - set(Lyx_Boost_Libraries) - add_definitions(-DBOOST_USER_CONFIG=) - include_directories(${TOP_SRC_DIR}/3rdparty/boost) -else() - # Using boost-regex - if(LYX_EXTERNAL_BOOST) - message(STATUS "Searching for external boost") - find_package(Boost COMPONENTS regex) - if(Boost_FOUND) - message(STATUS "Boost found") - message(STATUS "Boost-libs = ${Boost_LIBRARIES}") - set(Lyx_Boost_Libraries ${Boost_LIBRARIES}) - if (LYX_STDLIB_DEBUG OR LYX_DEBUG_GLIBC OR LYX_DEBUG_GLIBC_PEDANTIC) - # 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(FATAL_ERROR "Compiling LyX with stdlib-debug and system boost libraries may lead to crashes. Consider using '-DLYX_STDLIB_DEBUG=OFF -DLYX_DEBUG_GLIBC=OFF -DLYX_DEBUG_GLIBC_PEDANTIC=OFF' or using '-DLYX_EXTERNAL_BOOST=OFF'") - endif() - else() - message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON}) - endif() - else() - # Using included boost - set(Lyx_Boost_Libraries boost_regex) - add_definitions(-DBOOST_USER_CONFIG=) - include_directories(${TOP_SRC_DIR}/3rdparty/boost) - add_subdirectory(3rdparty/boost "${TOP_BINARY_DIR}/3rdparty/boost") - endif() -endif() - if(WIN32) if(LYX_CONSOLE) set(LYX_QTMAIN_LIBRARY) @@ -1034,9 +978,9 @@ if(LYX_PCH) COMPILE_FLAGS "/Ycconfig.h /Fp\$(IntDir)/config.pch") set(${name_}_sources ${${name_}_sources} ${TOP_BINARY_DIR}/config_pch.cpp ${TOP_BINARY_DIR}/pcheaders.h) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DLYX_PCH_STL /DLYX_PCH_BOOST /DLYX_PCH_QT") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /DLYX_PCH_STL /DLYX_PCH_BOOST /DLYX_PCH_QT") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /DLYX_PCH_STL /DLYX_PCH_BOOST") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DLYX_PCH_STL /DLYX_PCH_QT") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /DLYX_PCH_STL /DLYX_PCH_QT") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /DLYX_PCH_STL") endmacro(lyx_add_msvc_pch) macro(lyx_add_gcc_pch name_) endmacro() @@ -1044,7 +988,7 @@ if(LYX_PCH) macro(lyx_add_msvc_pch name_) endmacro() macro(lyx_add_gcc_pch name_) - add_definitions(-DLYX_PCH_STL -DLYX_PCH_BOOST -DLYX_PCH_QT) + add_definitions(-DLYX_PCH_STL -DLYX_PCH_QT) ADD_PRECOMPILED_HEADER(${name_} ${TOP_BINARY_DIR}/config_pch.cpp ${TOP_BINARY_DIR}/config.h.gch) endmacro() endif() @@ -1182,10 +1126,6 @@ if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*") MATH(EXPR QT4_VERSION "(${CMAKE_MATCH_1}<<16)|(${CMAKE_MATCH_2}<<8)|${CMAKE_MATCH_3}") endif() -if (NOT HAVE_REGEX) - set(LYX_USE_STD_REGEX 0) -endif() - set (cmd ${CMAKE_CTEST_COMMAND}) if (MSVC) @@ -1279,4 +1219,10 @@ endif() # can be run last add_subdirectory(development/cmake/post_install) +string(TIMESTAMP current_date "%Y-%m-%d %H:%M") +execute_process(COMMAND ${LYX_GITVERSION} describe --tags + WORKING_DIRECTORY "${TOP_SRC_DIR}" + OUTPUT_VARIABLE current_version + OUTPUT_STRIP_TRAILING_WHITESPACE) +file(APPEND "${TOP_BINARY_DIR}/Testing/IgnoredCount" "${current_date} ${current_version} Ignored tests = ${LYX_ignored_count}\n") message(STATUS)