]> git.lyx.org Git - features.git/blob - 3rdparty/hunspell/CMakeLists.txt
Cmake build: Use interprocedural optimization if possible
[features.git] / 3rdparty / hunspell / CMakeLists.txt
1
2 cmake_minimum_required(VERSION 3.1)
3
4 if (POLICY CMP0069)
5   cmake_policy(SET CMP0069 NEW)
6 endif()
7
8 project(hunspell)
9
10 set(HUNSPELL_VERSION 1.6.2)
11
12 set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${HUNSPELL_VERSION}/src)
13
14 include_directories(./ ${SRCDIR}/hunspell ${SRCDIR}/parsers ${SRCDIR}/tools)
15
16 if(WIN32)
17     include_directories(${SRCDIR}/win_api)
18     set(HUNCONFIG ${SRCDIR}/win_api/config.h)
19 endif()
20
21 # LIBS
22 set(SRCS
23     ${SRCDIR}/hunspell/affentry.cxx
24     ${SRCDIR}/hunspell/affixmgr.cxx
25     ${SRCDIR}/hunspell/csutil.cxx
26     ${SRCDIR}/hunspell/hashmgr.cxx
27     ${SRCDIR}/hunspell/suggestmgr.cxx
28     ${SRCDIR}/hunspell/phonet.cxx
29     ${SRCDIR}/hunspell/filemgr.cxx
30     ${SRCDIR}/hunspell/hunzip.cxx
31     ${SRCDIR}/hunspell/hunspell.cxx
32     ${SRCDIR}/hunspell/replist.cxx)
33
34 set(HEADERS
35     ${SRCDIR}/hunspell/affentry.hxx
36     ${SRCDIR}/hunspell/htypes.hxx
37     ${SRCDIR}/hunspell/affixmgr.hxx
38     ${SRCDIR}/hunspell/csutil.hxx
39     ${SRCDIR}/hunspell/hunspell.hxx
40     ${SRCDIR}/hunspell/atypes.hxx
41     ${SRCDIR}/hunspell/hunspell.h
42     ${SRCDIR}/hunspell/suggestmgr.hxx
43     ${SRCDIR}/hunspell/baseaffix.hxx
44     ${SRCDIR}/hunspell/hashmgr.hxx
45     ${SRCDIR}/hunspell/langnum.hxx
46     ${SRCDIR}/hunspell/phonet.hxx
47     ${SRCDIR}/hunspell/filemgr.hxx
48     ${SRCDIR}/hunspell/hunzip.hxx
49     ${SRCDIR}/hunspell/w_char.hxx
50     ${SRCDIR}/hunspell/replist.hxx
51     ${SRCDIR}/hunspell/hunvisapi.h)
52
53 add_definitions(-DHUNSPELL_STATIC)
54 add_library(hunspell STATIC ${HEADERS} ${SRCS} ${HUNCONFIG})
55
56 set(HUNSPELL_LIBRARY hunspell CACHE STRING "Hunspell library" FORCE)
57 set(HUNSPELL_INCLUDE_DIR ${SRCDIR} CACHE STRING "Hunspell include dir" FORCE)
58 set(HUNSPELL_FOUND CACHE STRING "Hunspell found" FORCE)
59
60 set_target_properties(hunspell PROPERTIES FOLDER "3rd_party")