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)
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
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}
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")