]> git.lyx.org Git - lyx.git/blob - 3rdparty/hunspell/CMakeLists.txt
Cmake build: Remove warnings about deprecated policy CMP0069
[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   if (NOT LYX_DEBUG)
7     cmake_policy(SET CMP0069 NEW)
8     include(CheckIPOSupported)
9     check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
10   endif()
11 endif()
12
13 project(hunspell)
14
15 set(HUNSPELL_VERSION 1.7.0)
16
17 set(SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/${HUNSPELL_VERSION}/src)
18
19 include_directories(./ ${SRCDIR}/hunspell ${SRCDIR}/parsers ${SRCDIR}/tools)
20
21 if(WIN32)
22     include_directories(${SRCDIR}/win_api)
23     set(HUNCONFIG ${SRCDIR}/win_api/config.h)
24 endif()
25
26 # LIBS
27 set(SRCS
28     ${SRCDIR}/hunspell/affentry.cxx
29     ${SRCDIR}/hunspell/affixmgr.cxx
30     ${SRCDIR}/hunspell/csutil.cxx
31     ${SRCDIR}/hunspell/hashmgr.cxx
32     ${SRCDIR}/hunspell/suggestmgr.cxx
33     ${SRCDIR}/hunspell/phonet.cxx
34     ${SRCDIR}/hunspell/filemgr.cxx
35     ${SRCDIR}/hunspell/hunzip.cxx
36     ${SRCDIR}/hunspell/hunspell.cxx
37     ${SRCDIR}/hunspell/replist.cxx)
38
39 set(HEADERS
40     ${SRCDIR}/hunspell/affentry.hxx
41     ${SRCDIR}/hunspell/htypes.hxx
42     ${SRCDIR}/hunspell/affixmgr.hxx
43     ${SRCDIR}/hunspell/csutil.hxx
44     ${SRCDIR}/hunspell/hunspell.hxx
45     ${SRCDIR}/hunspell/atypes.hxx
46     ${SRCDIR}/hunspell/hunspell.h
47     ${SRCDIR}/hunspell/suggestmgr.hxx
48     ${SRCDIR}/hunspell/baseaffix.hxx
49     ${SRCDIR}/hunspell/hashmgr.hxx
50     ${SRCDIR}/hunspell/langnum.hxx
51     ${SRCDIR}/hunspell/phonet.hxx
52     ${SRCDIR}/hunspell/filemgr.hxx
53     ${SRCDIR}/hunspell/hunzip.hxx
54     ${SRCDIR}/hunspell/w_char.hxx
55     ${SRCDIR}/hunspell/replist.hxx
56     ${SRCDIR}/hunspell/hunvisapi.h)
57
58 add_definitions(-DHUNSPELL_STATIC)
59 add_library(hunspell STATIC ${HEADERS} ${SRCS} ${HUNCONFIG})
60
61 set(HUNSPELL_LIBRARY hunspell CACHE STRING "Hunspell library" FORCE)
62 set(HUNSPELL_INCLUDE_DIR ${SRCDIR} CACHE STRING "Hunspell include dir" FORCE)
63 set(HUNSPELL_FOUND CACHE STRING "Hunspell found" FORCE)
64
65 set_target_properties(hunspell PROPERTIES
66         FOLDER "3rd_party"
67         INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})