]> git.lyx.org Git - lyx.git/blobdiff - CMakeLists.txt
Typo
[lyx.git] / CMakeLists.txt
index a5b85132b21481c2cc8d233cc418854ce9402d24..8ad97de7ee056852e4212a5e89bf8f74b5b32d9f 100644 (file)
@@ -139,6 +139,7 @@ LYX_OPTION(ENABLE_URLTESTS  "Enable for URL tests" OFF ALL)
 LYX_OPTION(ENABLE_EXPORT_TESTS "Enable for export tests" 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)
 
 # GCC specific
 LYX_OPTION(PROFILE              "Build profile version" OFF GCC)
@@ -611,9 +612,20 @@ 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)
+    add_subdirectory(3rdparty/hunspell)
+    add_definitions(-DHUNSPELL_STATIC)
+    set(HUNSPELL_FOUND ON)
+    message(STATUS "  * Hunspell:")
+    message(STATUS "     - include: ${HUNSPELL_INCLUDE_DIR}")
+    message(STATUS "     - library: ${HUNSPELL_LIBRARY}")
+endif()
+
 foreach(_spell "ASPELL" "Enchant" "Hunspell")
   string(TOUPPER ${_spell} _upspell)
-  find_package(${_spell})
+  if (NOT ${_upspell}_FOUND)
+    find_package(${_spell})
+  endif()
   if (${_upspell}_FOUND)
     include_directories(${${_upspell}_INCLUDE_DIR})
     set(Spelling_FOUND ON)
@@ -628,6 +640,7 @@ foreach(_spell "ASPELL" "Enchant" "Hunspell")
   endif()
 endforeach()
 
+
 find_package(PythonInterp 2.7 QUIET)
 if(PYTHONINTERP_FOUND)
   if(PYTHON_VERSION_STRING VERSION_GREATER 2.8)
@@ -660,9 +673,17 @@ if(LYX_NLS)
        endif()
 endif()
 
+if(UNIX)
+    find_package(ICONV REQUIRED)
+    find_package(ZLIB REQUIRED)
+endif()
+
+if(LYX_3RDPARTY_BUILD)
+    add_subdirectory(3rdparty/libiconv)
+    set(HAVE_ICONV_CONST 1)
+    add_subdirectory(3rdparty/zlib)
+endif()
 
-find_package(ICONV REQUIRED)
-find_package(ZLIB REQUIRED)
 
 if(LYX_EXTERNAL_BOOST)
        message(STATUS "Searching for boost")
@@ -929,10 +950,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()