From: Kornel Benko Date: Fri, 22 Jan 2010 18:40:49 +0000 (+0000) Subject: Added enchant to cmake X-Git-Tag: 2.0.0~4263 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e2c93c5f7477009b28d2ef260e34a8537cd16b02;p=features.git Added enchant to cmake git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33167 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index d043e8cda7..d02f3158c1 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -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) diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index 3fb5481025..6f73565bcf 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -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")