Subversion Repositories Scribus

Rev

Rev 23407 | 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
#
24351 craig 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
17429 craig 8
 
9
#Based on examples at http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries
10
 
24351 craig 11
#include(FindPkgConfig)
12
find_package(PkgConfig QUIET)
13
pkg_search_module(hunspell REQUIRED hunspell)
17429 craig 14
 
24351 craig 15
find_path(hunspell
21738 craig 16
  NAMES hunspell.h
24351 craig 17
  PATHS ${PKG_hunspell_INCLUDE_DIRS} ${hunspell_INCLUDE_DIRS}
21738 craig 18
  PATH_SUFFIXES hunspell
19
  NO_DEFAULT_PATH
20
)
17429 craig 21
 
24351 craig 22
find_library(hunspell_LIBRARIES
21738 craig 23
  NAMES libhunspell
24351 craig 24
  PATHS ${PKG_hunspell_LIBRARIES} ${hunspell_LIBRARY_DIRS}
21738 craig 25
  NO_DEFAULT_PATH
26
)
17429 craig 27
 
24351 craig 28
string(REGEX MATCH "1\.([1-9])\.." hunspell_MATCH ${hunspell_VERSION})
29
#set(hunspell_MINOR_VERSION ${CMAKE_MATCH_1})
21741 craig 30
if(CMAKE_MATCH_1 GREATER 4)
24351 craig 31
	set(hunspell_NEWAPI ON)
32
	message(STATUS "New hunspell API found. hunspell version ${hunspell_VERSION}")
33
	message(STATUS "hunspell INCLUDE ${hunspell_INCLUDE_DIRS}")
34
	message(STATUS "hunspell LIBRARIES ${hunspell_LIBRARIES}")
21738 craig 35
endif()
17429 craig 36
 
24351 craig 37
mark_as_advanced(hunspell_INCLUDE_DIR hunspell_LIBRARIES)