X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=CMakeLists.txt;h=3fc69ab1d4bbc813e5423d97f7425504107cb38f;hb=df2cddb859f5c3e4be50e00ac072d79fdf166ad1;hp=6975751221dc50b38056358d271196e7f394373a;hpb=0f881e202eb0514a569d5d1ddc5584d577124151;p=lyx.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6975751221..3fc69ab1d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,6 +136,7 @@ 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_FILEDIALOG "Use native or QT file dialog" QT NATIVE) LYX_COMBO(USE_QT "Use Qt version as frontend" AUTO QT4 QT5) #LYX_OPTION(3RDPARTY_BUILD "Build 3rdparty libs" OFF ALL) LYX_OPTION(EXTERNAL_Z "OFF := Build 3rdparty lib zlib" ON ALL) @@ -153,7 +154,7 @@ LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF GCC) LYX_OPTION(PROFILE "Build with options for gprof" OFF GCC) # MSVC specific -LYX_OPTION(CONSOLE "Show console on Windows, enforce with =FORCE" ON MSVC) +LYX_OPTION(CONSOLE "Show console on Windows" ON MSVC) LYX_OPTION(VLD "Use VLD with MSVC" OFF MSVC) LYX_OPTION(WALL "Enable all warnings" OFF MSVC) LYX_OPTION(DEPENDENCIES_DOWNLOAD "Download dependencies for MSVC 10" OFF MSVC) @@ -188,11 +189,6 @@ if(LYX_INSTALL) if(WIN32 AND NOT MINGW) set(LYX_HUNSPELL ON) endif() - if(LYX_CONSOLE MATCHES "FORCE") - set(LYX_CONSOLE ON) - else() - set(LYX_CONSOLE OFF) - endif() set(LYX_PACKAGE_SUFFIX ON) if(NOT LYX_DEBUG) set(LYX_RELEASE ON) @@ -359,12 +355,14 @@ endforeach(_c_l) FIND_PROGRAM(LYX_GITVERSION git) #message(STATUS "gitversion = ${LYX_GITVERSION}") set(LYX_REVISION_VERSION ${LYX_PATCH_VERSION}) +set(LYX_PACKAGE_RELEASE "1") if(LYX_GITVERSION) if (LYX_LOCALVERSIONING) # Find the revision number and for later use EXECUTE_PROCESS(COMMAND ${LYX_GITVERSION} describe --match 2.0.0 HEAD - WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE LYX_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) - if (LYX_PACKAGE_RELEASE MATCHES "^2\\.0\\.0\\-\([0-9]+\)\\-.*$") + WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE tmp_LYX_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) + if (tmp_LYX_PACKAGE_RELEASE MATCHES "^2\\.0\\.0\\-\([0-9]+\)\\-\(.*\)$") + set(LYX_PACKAGE_RELEASE ${CMAKE_MATCH_2}) # We will add offset of 40000 to get appropriate value to # previous svn. # We use this value than also to set the package-patch-value @@ -384,6 +382,7 @@ if(LYX_PROGRAM_SUFFIX AND NOT (APPLE AND LYX_BUNDLE)) endif() set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}") set(_tex2lyx tex2lyx${PROGRAM_SUFFIX}) +set(_convert lyxconvert${PROGRAM_SUFFIX}) add_custom_target(lyx_version ALL COMMAND ${CMAKE_COMMAND} -DTOP_SRC_DIR=${TOP_SRC_DIR} -DTOP_CMAKE_PATH=${TOP_CMAKE_PATH} -DTOP_BINARY_DIR=${TOP_BINARY_DIR} -DLYX_DATE=${LYX_DATE} -P ${TOP_SCRIPT_PATH}/LyXGetVersion.cmake @@ -524,13 +523,15 @@ else() endif() mark_as_advanced(LYX_MAN_DIR) -if(LYX_INSTALL AND WIN32) - message(STATUS "Configuring NSIS files") - configure_file(development/Win32/packaging/installer/lyx.nsi.cmake ${CMAKE_BINARY_DIR}/installer/lyx.nsi @ONLY) - configure_file(development/Win32/packaging/installer/settings.nsh.cmake ${CMAKE_BINARY_DIR}/installer/settings-cmake.nsh @ONLY) - configure_file(development/Win32/packaging/installer/include/declarations.nsh.cmake ${CMAKE_BINARY_DIR}/installer/declarations-cmake.nsh @ONLY) - message(STATUS "NSIS files are created in ${CMAKE_BINARY_DIR}/installer") -endif() +# The Win installer cannot be built by CMake because one needs to install plugins for NSIS +# see the Readme.txt of the installer +#if(LYX_INSTALL AND WIN32) +# message(STATUS "Configuring NSIS files") +# configure_file(development/Win32/packaging/installer/lyx.nsi.cmake ${CMAKE_BINARY_DIR}/installer/lyx.nsi @ONLY) +# configure_file(development/Win32/packaging/installer/settings.nsh.cmake ${CMAKE_BINARY_DIR}/installer/settings-cmake.nsh @ONLY) +# configure_file(development/Win32/packaging/installer/include/declarations.nsh.cmake ${CMAKE_BINARY_DIR}/installer/declarations-cmake.nsh @ONLY) +# message(STATUS "NSIS files are created in ${CMAKE_BINARY_DIR}/installer") +#endif() if(NOT GROUP_CODE) #set(GROUP_CODE "The Golden Code") @@ -794,37 +795,41 @@ else() add_subdirectory(3rdparty/zlib) endif() -if(LYX_EXTERNAL_BOOST) - message(STATUS "Searching for boost") - if(NOT LYX_USE_STD_REGEX) - find_package(Boost COMPONENTS regex) - endif() - if(Boost_FOUND) - 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() +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() - if(NOT LYX_USE_STD_REGEX) - set(Lyx_Boost_Libraries boost_regex) - endif() - add_definitions(-DBOOST_USER_CONFIG=) - include_directories(${TOP_SRC_DIR}/3rdparty/boost) - add_subdirectory(3rdparty/boost "${TOP_BINARY_DIR}/3rdparty/boost") + # 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) + # 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() + 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) @@ -839,7 +844,7 @@ if(WIN32) else() # -DPSAPI_VERSION=1 is not needed for mingw, since the mingw psapi.h # does not use it and always declares the vista compatible API. - # If this ever changes then -DPSAPI_VERSION might be needed here as well. + # If this ever changes then -DPSAPI_VERSION might be needed here as well. add_definitions(-DWINVER=0x0500) endif() endif() @@ -1029,8 +1034,8 @@ if(LYX_INSTALL) endif() add_subdirectory(${LYX_CMAKE_DIR}/doc "${TOP_BINARY_DIR}/doc") endif() - include(../Install) endif() +include(../Install) add_subdirectory(src "${TOP_BINARY_DIR}/src") add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx")