From b46ea7fac058c4a72a9b6f8307c4039512c612cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 9 Dec 2015 13:54:08 +0100 Subject: [PATCH] integrate 3rdparty libs --- CMakeLists.txt | 29 ++++++++++++++++++++++++----- src/CMakeLists.txt | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b85132b2..e8b7361111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -620,7 +620,7 @@ foreach(_spell "ASPELL" "Enchant" "Hunspell") message(STATUS "Building with USE_${_upspell}") set(Include_used_spellchecker "${Include_used_spellchecker}#define USE_${_upspell} 1\n") else() - if(LYX_${_upspell}) + if(LYX_${_upspell} AND NOT LYX_HUNSPELL) message(FATAL_ERROR "Required ${_spell} devel package not found") else() message(STATUS "${_upspell} not found, building without ${_spell} support") @@ -628,6 +628,15 @@ foreach(_spell "ASPELL" "Enchant" "Hunspell") endif() endforeach() +if(LYX_HUNSPELL AND NOT HUNSPELL_FOUND) + add_subdirectory(src/3rdparty/hunspell) + set(Spelling_FOUND ON) +endif() +message(STATUS " * Hunspell:") +message(STATUS " - include: ${HUNSPELL_INCLUDE_DIR}") +message(STATUS " - library: ${HUNSPELL_LIBRARY}") + + find_package(PythonInterp 2.7 QUIET) if(PYTHONINTERP_FOUND) if(PYTHON_VERSION_STRING VERSION_GREATER 2.8) @@ -660,9 +669,19 @@ if(LYX_NLS) endif() endif() +if(UNIX) + find_package(ICONV REQUIRED) + find_package(ZLIB REQUIRED) +endif() + +if(NOT ICONV_FOUND) + add_subdirectory(src/3rdparty/libiconv) +endif() + +if(NOT ZLIB_FOUND) + add_subdirectory(src/3rdparty/zlib) +endif() -find_package(ICONV REQUIRED) -find_package(ZLIB REQUIRED) if(LYX_EXTERNAL_BOOST) message(STATUS "Searching for boost") @@ -929,10 +948,10 @@ if(LYX_NLS) message(STATUS "Building Native Language Support (LYX_NLS is set), used libraries:") message(STATUS) message(STATUS " * iconv") - message(STATUS " - header : ${ICONV_HEADER}") + message(STATUS " - include: ${ICONV_INCLUDE_DIR}") message(STATUS " - library: ${ICONV_LIBRARY}") message(STATUS " * zlib") - message(STATUS " - header : ${ZLIB_HEADER}") + message(STATUS " - include: ${ZLIB_INCLUDE_DIR}") message(STATUS " - library: ${ZLIB_LIBRARY}") message(STATUS) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0dc99a72d9..eb350c1774 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,7 +70,7 @@ if(WIN32) endif() include_directories(${CMAKE_CURRENT_BINARY_DIR} - ${ZLIB_INCLUDE_DIR} ${QT_INCLUDES}) + ${ZLIB_INCLUDE_DIR} ${ICONV_INCLUDE_DIR} ${QT_INCLUDES}) lyx_add_msvc_pch(lyx)