Subversion Repositories Scribus

Rev

Rev 22543 | 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
16
  PATHS ${PKG_HUNSPELL_INCLUDE_DIRS} ${HUNSPELL_INCLUDE_DIRS} /usr/local/include /usr/include
17
  PATH_SUFFIXES hunspell
18
  NO_DEFAULT_PATH
19
)
17429 craig 20
 
21738 craig 21
find_library(HUNSPELL_LIBRARIES
22
  NAMES libhunspell
23
  PATHS ${PKG_HUNSPELL_LIBRARIES} ${HUNSPELL_LIBRARY_DIRS} /usr/local/lib /usr/lib
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)
21738 craig 30
	set(HUNSPELL_NEWAPI 1)
22522 craig 31
	message(STATUS "New HUNSPELL API found. Hunspell version ${HUNSPELL_VERSION}")
22543 craig 32
	message(STATUS "HUNSPELL INCLUDE ${HUNSPELL_INCLUDE_DIR}")
33
	message(STATUS "HUNSPELL LIBRARIES ${HUNSPELL_LIBRARIES}")
21738 craig 34
endif()
17429 craig 35
 
21738 craig 36
#find_path(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx )
37
#find_library(HUNSPELL_LIBRARIES NAMES hunspell-1.5 hunspell-1.4 hunspell-1.3 hunspell-1.2 PATHS /opt/local/lib /usr/local/lib /usr/lib )
38
#include(FindPackageHandleStandardArgs)
39
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR )
40
 
21543 craig 41
mark_as_advanced(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES)