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