X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=7fd8b26f764b94a56aa9b8e7a1966548be3137a2;hb=0c7bd9a57f2a308bb9659200eda3b7e45f8d5d3c;hp=667f76e24bf1da193b03a32b20504b5cd7ea99c5;hpb=03cfeae00a345400e6b06afcf07bc0b38c9702ce;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 667f76e24b..7fd8b26f76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,9 +139,13 @@ LYX_OPTION(INSTALL_PREFIX "Install path for LyX" OFF ALL) 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(ENABLE_KEYTESTS "Enable for keytests" OFF ALL) LYX_OPTION(ASAN "Use address sanitizer" OFF ALL) LYX_COMBO(USE_QT "Use Qt version as frontend" QT4 QT5) -LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL) +#LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL) +LYX_OPTION(EXTERNAL_Z "Build 3rdparty lib zlib" ON ALL) +LYX_OPTION(EXTERNAL_ICONV "Build 3rdparty lib iconvlib" ON ALL) +LYX_OPTION(EXTERNAL_HUNSPELL "Build 3rdparty lib hunspelllib" ON ALL) # GCC specific LYX_OPTION(PROFILE "Build profile version" OFF GCC) @@ -207,7 +211,6 @@ else() set(LYX_MERGE_REBUILD OFF) endif() - if(LYX_DEPENDENCIES_DOWNLOAD) message(STATUS) if(MSVC14) @@ -312,6 +315,14 @@ else() set(USE_POSIX_PACKAGING ON) endif() +if(LYX_3RDPARTY_BUILD) + # LYX_3RDPARTY_BUILD is not cached anymore, but for compatibility reasons + # this enables the build of all 3rd_party libs + set(LYX_EXTERNAL_Z OFF CACHE BOOL "Build 3rdparty lib zlib" FORCE) + set(LYX_EXTERNAL_ICONV OFF CACHE BOOL "Build 3rdparty iconvlib" FORCE) + set(LYX_EXTERNAL_HUNSPELL OFF CACHE BOOL "Build 3rdparty hunspelllib" FORCE) +endif() + macro(setstripped _varname) if(${ARGC} GREATER 1) string(STRIP "${ARGV1}" _v) @@ -561,7 +572,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 + # 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() @@ -642,7 +661,7 @@ include_directories(${TOP_BINARY_DIR} ${TOP_SRC_DIR}/src) set(Spelling_FOUND OFF) set(Include_used_spellchecker) # String will be inserted into config.h -if(LYX_3RDPARTY_BUILD) +if(NOT LYX_EXTERNAL_HUNSPELL) add_subdirectory(3rdparty/hunspell) add_definitions(-DHUNSPELL_STATIC) set(HUNSPELL_FOUND ON) @@ -706,15 +725,17 @@ if(LYX_NLS) endif() endif() -if(UNIX) - find_package(ICONV REQUIRED) - find_package(ZLIB REQUIRED) +if(LYX_EXTERNAL_ICONV) + find_package(ICONV REQUIRED) else() - if(LYX_3RDPARTY_BUILD) - add_subdirectory(3rdparty/libiconv) - set(HAVE_ICONV_CONST 1) - add_subdirectory(3rdparty/zlib) - endif() + add_subdirectory(3rdparty/libiconv) + set(HAVE_ICONV_CONST 1) +endif() + +if(LYX_EXTERNAL_Z) + find_package(ZLIB REQUIRED) +else() + add_subdirectory(3rdparty/zlib) endif() if(LYX_EXTERNAL_BOOST) @@ -913,11 +934,6 @@ endif() 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) - # QPA_XCB is only valid if QT5+X11 - set(QPA_XCB 1) -endif() configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h) if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")