Rev 24351 | 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}) |
||
25061 | craig | 30 | if(NOT hunspell_FIND_QUIETLY) |
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 | |
25061 | craig | 37 | include(FindPackageHandleStandardArgs) |
38 | find_package_handle_standard_args(hunspell |
||
39 | FOUND_VAR hunspell_FOUND |
||
40 | REQUIRED_VARS |
||
41 | hunspell_LIBRARIES |
||
42 | hunspell_INCLUDE_DIRS |
||
43 | VERSION_VAR hunspell_VERSION |
||
44 | ) |
||
45 | |||
24351 | craig | 46 | mark_as_advanced(hunspell_INCLUDE_DIR hunspell_LIBRARIES) |