Subversion Repositories Scribus

Rev

Rev 23406 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
17429 craig 1
# - Try to find HUNSPELL
2
# Once done this will define
3
#
4
#  HUNSPELL_FOUND - System has HUNSPELL
5
#  HUNSPELL_INCLUDE_DIR - The HUNSPELL include directory
6
#  HUNSPELL_LIBRARIES - The libraries needed to use HUNSPELL
7
#  HUNSPELL_DEFINITIONS - Compiler switches required for using HUNSPELL
8
 
9
#Based on examples at http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries
10
 
21738 craig 11
include(FindPkgConfig)
12
pkg_search_module(HUNSPELL REQUIRED hunspell)
17429 craig 13
 
21738 craig 14
find_path(HUNSPELL
15
  NAMES hunspell.h
23406 craig 16
  PATHS ${PKG_HUNSPELL_INCLUDE_DIRS} ${HUNSPELL_INCLUDE_DIRS}
21738 craig 17
  PATH_SUFFIXES hunspell
18
  NO_DEFAULT_PATH
19
)
17429 craig 20
 
21738 craig 21
find_library(HUNSPELL_LIBRARIES
22
  NAMES libhunspell
23406 craig 23
  PATHS ${PKG_HUNSPELL_LIBRARIES} ${HUNSPELL_LIBRARY_DIRS}
21738 craig 24
  NO_DEFAULT_PATH
25
)
17429 craig 26
 
22779 jghali 27
string(REGEX MATCH "1\.([1-9])\.." HUNSPELL_MATCH ${HUNSPELL_VERSION})
21738 craig 28
#set(HUNSPELL_MINOR_VERSION ${CMAKE_MATCH_1})
21741 craig 29
if(CMAKE_MATCH_1 GREATER 4)
23014 craig 30
	set(HUNSPELL_NEWAPI ON)
22522 craig 31
	message(STATUS "New HUNSPELL API found. Hunspell version ${HUNSPELL_VERSION}")
23406 craig 32
	message(STATUS "HUNSPELL INCLUDE ${HUNSPELL_INCLUDE_DIRS}")
22543 craig 33
	message(STATUS "HUNSPELL LIBRARIES ${HUNSPELL_LIBRARIES}")
21738 craig 34
endif()
17429 craig 35
 
21543 craig 36
mark_as_advanced(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES)