]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/FindEnchant.cmake
listerrors.lyx : Update a link.
[lyx.git] / development / cmake / modules / FindEnchant.cmake
1 if(WIN32)
2         find_library(ENCHANT_LIBRARY "libenchant")
3         find_path(ENCHANT_INCLUDE_DIR "enchant++.h")
4 else()
5   find_library(ENCHANT_LIBRARY "enchant"  
6         "/usr/local/lib" 
7         ${SYSTEM_LIB_DIRS}
8         "/opt/local/lib")
9   find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS 
10                 /usr/local/include
11                 /usr/local/include/enchant
12                 /usr/include
13                 /usr/include/enchant
14                 /opt/local/include/enchant)
15 endif()
16
17 if (ENCHANT_LIBRARY AND ENCHANT_INCLUDE_DIR)
18         set(ENCHANT_FOUND TRUE)
19         add_definitions(-DUSE_ENCHANT=1)
20         message(STATUS "Building with USE_ENCHANT")
21 else()
22         message(STATUS "Enchant not found, building without enchant support")
23 endif()
24
25
26 # handle the QUIETLY and REQUIRED arguments and 
27 # set ENCHANT_FOUND to TRUE if all listed variables are TRUE
28 include(FindPackageHandleStandardArgs)
29 find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_LIBRARY ENCHANT_INCLUDE_DIR)
30
31 if(Enchant_FIND_REQUIRED AND NOT ENCHANT_FOUND)
32         message(FATAL_ERROR "Could not find Enchant library")
33 endif()
34
35 mark_as_advanced(ENCHANT_LIBRARY ENCHANT_INCLUDE_DIR)