1 diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake
2 index 7c182e6a..5537595e 100644
3 --- a/cmake/FindEnchant.cmake
4 +++ b/cmake/FindEnchant.cmake
5 @@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
6 endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
8 find_package(PkgConfig)
9 -pkg_check_modules(PC_ENCHANT enchant)
10 +pkg_check_modules(PC_ENCHANT enchant-2)
12 find_path(ENCHANT_INCLUDE_DIR
14 @@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR
15 PATH_SUFFIXES "enchant")
17 find_library(ENCHANT_LIBRARIES
20 HINTS ${PC_ENCHANT_LIBRARY_DIRS})
22 if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
23 @@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
27 - #include <enchant/enchant.h>
28 + #include <enchant-2/enchant.h>
30 EnchantBroker *enchant_broker_init();
31 char **enchant_dict_suggest(EnchantDict *dict, const char *str,
32 @@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
33 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
36 +if(ENCHANT_API_COMPATIBLE)
37 + set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES})
38 +endif(ENCHANT_API_COMPATIBLE)
40 include(FindPackageHandleStandardArgs)
41 find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES
42 ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)