]> git.lyx.org Git - features.git/commitdiff
Added enchant to cmake
authorKornel Benko <kornel@lyx.org>
Fri, 22 Jan 2010 18:40:49 +0000 (18:40 +0000)
committerKornel Benko <kornel@lyx.org>
Fri, 22 Jan 2010 18:40:49 +0000 (18:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33167 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/CMakeLists.txt
development/cmake/src/CMakeLists.txt

index d043e8cda776b528e5d9bfccfdabae6d38fa0855..d02f3158c1178079868da61daa5c8f7e6613f618 100644 (file)
@@ -216,6 +216,21 @@ else()
   message(STATUS "----- Hunspell not found, building without hunspell support")
 endif()
 
+if(WIN32)
+  find_library(ENCHANT_LIBRARY "libenchant")
+  find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
+else()
+  find_library(ENCHANT_LIBRARY "enchant"  "/usr/local/lib" "/usr/lib")
+  find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include /usr/local/include/enchant /usr/include /usr/include/enchant)
+endif()
+if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
+  set(ENCHANT_FOUND TRUE)
+  add_definitions(-DUSE_ENCHANT=1)
+  message(STATUS "----- Building with USE_ENCHANT")
+else()
+  message(STATUS "----- Enchant not found, building without enchant support")
+endif()
+
 message(STATUS "")
 if(nls OR all)
        set(nls TRUE CACHE TYPE STRING)
index 3fb548102550ed872767aa286d670e0843439c9e..6f73565bcf225b187da4ab694c879ffebf89212d 100644 (file)
@@ -23,12 +23,14 @@ file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
 file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
 
 list(REMOVE_ITEM lyx_sources
+       ${TOP_SRC_DIR}/src/EnchantChecker.cpp
        ${TOP_SRC_DIR}/src/AspellChecker.cpp
        ${TOP_SRC_DIR}/src/HunspellChecker.cpp
        ${TOP_SRC_DIR}/src/Variables.cpp
        ${TOP_SRC_DIR}/src/Section.cpp)
 
 list(REMOVE_ITEM lyx_headers
+       ${TOP_SRC_DIR}/src/EnchantChecker.h
        ${TOP_SRC_DIR}/src/AspellChecker.h
        ${TOP_SRC_DIR}/src/HunspellChecker.h
        ${TOP_SRC_DIR}/src/Variables.h
@@ -45,6 +47,12 @@ if (ASPELL_FOUND)
        list(APPEND lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
 endif()
 
+if (ENCHANT_FOUND)
+  include_directories("${ENCHANT_INCLUDE_DIR}")
+  list(APPEND lyx_sources ${TOP_SRC_DIR}/src/EnchantChecker.cpp)
+  list(APPEND lyx_headers ${TOP_SRC_DIR}/src/EnchantChecker.h)
+endif()
+
 lyx_automoc(${TOP_SRC_DIR}/src/Compare.cpp ${TOP_SRC_DIR}/src/Server.cpp)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR}
@@ -91,6 +99,9 @@ endif()
 if (ASPELL_FOUND)
        target_link_libraries(${_lyx} ${ASPELL_LIBRARY})
 endif()
+if (ENCHANT_FOUND)
+    target_link_libraries(${_lyx} ${ENCHANT_LIBRARY})
+endif()
 
 if (APPLE)
   target_link_libraries(${_lyx} "-bind_at_load")