X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=3f491581b821fb0f6e4655008794e4a0527b7238;hb=ecdeffb52b1dad2f56e0e4210d0a040e807e2caf;hp=075a6a74e64973ff9e48e893de1f527bdb48ec5e;hpb=652835bdea60100d1a4653a1ae15a9e1520944cf;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 075a6a74e6..3f491581b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,11 +246,10 @@ set(LYX_GCC11_MODE) if(UNIX OR MINGW) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) message(STATUS "Using GCC version ${GCC_VERSION}") - if(NOT GCC_VERSION VERSION_LESS 4.4) - set(LYX_USE_TR1 1) - # GCC <= 4.5 does not support regex: there are linker errors - # http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1 - set(LYX_USE_TR1_REGEX 0) + if(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) endif() if (LYX_ENABLE_CXX11) find_package(CXX11Compiler) @@ -260,10 +259,10 @@ if(UNIX OR MINGW) set(LYX_GCC11_MODE "${CXX11_FLAG}") endif() else() - if(MSVC10) - set(LYX_USE_TR1 1) - #set(LYX_USE_TR1_REGEX 1) #TODO should we use it in ECMAScript mode? - endif() + set(LYX_USE_STD_REGEX 0) +# if(MSVC10) +# set(LYX_USE_STD_REGEX 1) #TODO should we use it in ECMAScript mode? +# endif() endif() @@ -316,7 +315,6 @@ endforeach(_c_l) FIND_PROGRAM(LYX_GITVERSION git) #message(STATUS "gitversion = ${LYX_GITVERSION}") -set(LYX_GIT_COMMIT_HASH "none") set(LYX_REVISION_VERSION ${LYX_PATCH_VERSION}) if(LYX_GITVERSION) if (LYX_LOCALVERSIONING) @@ -332,13 +330,7 @@ if(LYX_GITVERSION) set(ENABLE_DIST ON) endif() endif() - EXECUTE_PROCESS(COMMAND ${LYX_GITVERSION} log -1 "--pretty=format:%H" - WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE lyxgitcommit OUTPUT_STRIP_TRAILING_WHITESPACE) - if (lyxgitcommit MATCHES "^[0-9a-f]+$") - set(LYX_GIT_COMMIT_HASH ${lyxgitcommit}) - endif() endif() -#message(STATUS "LYX_GIT_COMMIT_HASH = ${LYX_GIT_COMMIT_HASH}") # Set the programs (lyx, tex2lyx, etc.) suffix # When building an OS X bundle, we will append @@ -481,7 +473,7 @@ endif() # lyx's source files set(LYX_CPP_FILES [a-zA-Z]*.cpp) -set(LYX_HPP_FILES *.h) +set(LYX_HPP_FILES [a-zA-Z]*.h) set(LYX_MOC_FILES moc_*.cpp) include(ProjectSourceGroup) @@ -562,6 +554,7 @@ if(LYX_USE_QT MATCHES "QT5") find_package(Qt5MacExtras REQUIRED) endif() find_package(Qt5X11Extras QUIET) + find_package(Qt5WinExtras QUIET) set(QTVERSION ${Qt5Core_VERSION}) macro (qt_use_modules) qt5_use_modules(${ARGN}) @@ -637,7 +630,11 @@ find_package(ZLIB REQUIRED) if(LYX_EXTERNAL_BOOST) message(STATUS "Searching for boost") - find_package(Boost COMPONENTS signals regex) #TODO could REQUIRED be used + if(LYX_USE_STD_REGEX) + find_package(Boost COMPONENTS signals) + else() + find_package(Boost COMPONENTS signals regex) + endif() if(Boost_FOUND) message(STATUS "Boost found") message(STATUS "Boost-libs = ${Boost_LIBRARIES}") @@ -646,7 +643,7 @@ if(LYX_EXTERNAL_BOOST) message(FATAL_ERROR "Boost not found" ${Boost_ERROR_REASON}) endif() else() - if(LYX_USE_TR1_REGEX) + if(LYX_USE_STD_REGEX) set(Lyx_Boost_Libraries boost_signals) else() set(Lyx_Boost_Libraries boost_signals boost_regex) @@ -677,7 +674,7 @@ endif() # Compute qt4-version from ${QTVERSION} message(STATUS "") -foreach(_v PACKAGE PACKAGE_VERSION LYX_GIT_COMMIT_HASH +foreach(_v PACKAGE PACKAGE_VERSION PROGRAM_SUFFIX LYX_DATE LYX_DIR_VER LYX_USERDIR_VER LYX_ABS_TOP_SRCDIR LYX_ABS_INSTALLED_DATADIR LYX_ABS_INSTALLED_LOCALEDIR LYX_INSTALL_SUFFIX)