]> git.lyx.org Git - lyx.git/blob - development/Win32/aspell/CMakeLists.txt
Scons: libintl also needs /MD option
[lyx.git] / development / Win32 / aspell / CMakeLists.txt
1 project(aspell)
2
3 #  default:      build rel_0_60-branch
4 #  -DCVS_HEAD=1: build cvs HEAD version
5
6
7 set(ASPELL_LIB_NAME libaspell) 
8 set(ASPELL_EXE_NAME aspell) 
9
10 if(${LINK} MATCHES "shared" OR ASPELL_LINK)
11         set(ASPELL_SHARED_LIB 1)
12         set(ASPELL_LINK SHARED CACHE TYPE STRING)
13 else(${LINK} MATCHES "shared" OR ASPELL_LINK)
14         #MESSAGE(STATUS)
15         #MESSAGE(STATUS "Use -DLINK=shared to build the libraries as shared")
16         #MESSAGE(STATUS)
17         set(ASPELL_LINK STATIC)
18 endif(${LINK} MATCHES "shared" OR ASPELL_LINK)
19
20
21
22 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
23
24 ########################################################################
25 #
26 # Aspell Library
27 #
28
29
30 set(libaspell_sources
31   ../common/cache.cpp
32   ../common/string.cpp
33   ../common/getdata.cpp
34   ../common/itemize.cpp
35   ../common/file_util.cpp
36   ../common/string_map.cpp
37   ../common/string_list.cpp
38   ../common/config.cpp
39   ../common/posib_err.cpp
40   ../common/errors.cpp
41   ../common/error.cpp
42   ../common/fstream.cpp
43   ../common/iostream.cpp
44   ../common/info.cpp
45   ../common/can_have_error.cpp
46   ../common/convert.cpp
47   ../common/speller.cpp
48   ../common/filter.cpp
49   ../common/objstack.cpp 
50   ../common/strtonum.cpp
51   ../common/gettext_init.cpp
52   ../common/file_data_util.cpp
53   ../modules/speller/default/readonly_ws.cpp
54   ../modules/speller/default/suggest.cpp
55   ../modules/speller/default/data.cpp
56   ../modules/speller/default/multi_ws.cpp
57   ../modules/speller/default/phonetic.cpp
58   ../modules/speller/default/writable.cpp
59   ../modules/speller/default/speller_impl.cpp
60   ../modules/speller/default/phonet.cpp
61   ../modules/speller/default/typo_editdist.cpp
62   ../modules/speller/default/editdist.cpp
63   ../modules/speller/default/primes.cpp
64   ../modules/speller/default/leditdist.cpp
65   ../modules/speller/default/affix.cpp
66   ../lib/word_list-c.cpp
67   ../lib/info-c.cpp
68   ../lib/mutable_container-c.cpp
69   ../lib/error-c.cpp
70   ../lib/string_map-c.cpp
71   ../lib/new_config.cpp
72   ../lib/config-c.cpp
73   ../lib/string_enumeration-c.cpp
74   ../lib/can_have_error-c.cpp
75   ../lib/dummy.cpp
76   ../lib/new_filter.cpp
77   ../lib/new_fmode.cpp
78   ../lib/string_list-c.cpp
79   ../lib/find_speller.cpp
80   ../lib/speller-c.cpp
81   ../lib/string_pair_enumeration-c.cpp
82   ../lib/new_checker.cpp
83   
84   
85 # This is for filters which are ALWAYS static.  
86 # The url filter is always usefull and fairly simple.
87 # The genconv filter is mostly defined in the main aspell libarary
88 #   since it is used by other filters.  The actual genconv filter
89 #   is just a small wrapper.
90
91   ../modules/filter/url.cpp
92 )
93
94 if(NOT CVS_HEAD)
95         set(libaspell_sources ${libaspell_sources}
96           ../common/tokenizer.cpp
97           ../common/document_checker.cpp
98           ../modules/speller/default/language.cpp
99           ../modules/tokenizer/basic.cpp
100           ../lib/filter-c.cpp
101           ../lib/document_checker-c.cpp
102           # msvc win32 support
103         )
104         if(MSVC)
105                 set(libaspell_sources ${libaspell_sources} ../win32/dirent.c)
106         endif(MSVC)
107 else(NOT CVS_HEAD)
108         set(libaspell_sources ${libaspell_sources}
109           ../common/convert_filter.cpp
110           ../common/checker.cpp
111           ../modules/speller/default/checker_impl.cpp
112           ../modules/speller/default/lang_impl.cpp
113           ../lib/speller-cm.cpp
114           ../lib/checker-c.cpp
115           ../lib/document_checker-c.cpp
116           ../lib/convert-c.cpp
117           ../lib/language-c.cpp
118           ../lib/language_types-c.cpp
119           ../lib/language-cm.cpp
120           ../lib/munch_list.cpp
121           ../modules/filter/genconv.cpp
122           # msvc win32 support
123           ../win32/libstub.cpp
124         )
125         set(CVS_HEAD 1 CACHE TYPE STRING)
126 endif(NOT CVS_HEAD)
127
128
129 file(GLOB commons_headers ../common/*.hpp )
130
131 set(commons_headers ${commons_headers} ../interfaces/cc/aspell.h)
132
133 if(COMPILE_IN_FILTERS)
134
135 ### Add your filter sources here,
136 ### starting with file containing filter class definition followed by
137 ### file containing filter member implementation.
138 set(libaspell_sources 
139   ${libaspell_sources}
140   ../modules/filter/email.cpp
141   ../modules/filter/tex.cpp
142   ../modules/filter/sgml.cpp
143   ../modules/filter/context.cpp
144   ../modules/filter/nroff.cpp
145   ../modules/filter/texinfo.cpp
146 )
147 endif(COMPILE_IN_FILTERS)
148
149
150 include_directories(
151         ${CMAKE_SOURCE_DIR}
152         ${CMAKE_SOURCE_DIR}/../win32
153         ${CMAKE_SOURCE_DIR}/../gen
154         ${CMAKE_SOURCE_DIR}/../lib
155         ${CMAKE_SOURCE_DIR}/../common
156         ${CMAKE_SOURCE_DIR}/../modules
157         ${CMAKE_SOURCE_DIR}/../modules/filter
158         ${CMAKE_SOURCE_DIR}/../modules/speller
159         ${CMAKE_SOURCE_DIR}/../modules/speller/default
160         ${CMAKE_SOURCE_DIR}/../interfaces/cc
161 )
162
163 if(MSVC)
164         # debug   library name: aspelld.lib
165         # release library name: aspell.lib
166         set(CMAKE_DEBUG_POSTFIX "d")
167         if(MSVC_IDE)
168         else(MSVC_IDE)
169                 SET(CMAKE_EXE_LINKER_FLAGS /MANIFEST)
170         endif(MSVC_IDE)
171
172         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Zi  -wd4522 -wd4521 -wd4996 -wd4800")
173         set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} -wd4522 -wd4521 -wd4996 -wd4800")
174         SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
175         SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
176 endif(MSVC)
177
178 if(WIN32)
179         add_definitions(-DWIN32PORT)
180 endif(WIN32)
181
182 if(ASPELL_SHARED_LIB)
183         add_definitions(-DASPELL_MAKE_LIB -DASPELL_USE_SHARED)
184 endif(ASPELL_SHARED_LIB)
185
186 add_library(${ASPELL_LIB_NAME} ${ASPELL_LINK} ${libaspell_sources} ${commons_headers})
187
188
189 if(WIN32)
190         target_link_libraries(${ASPELL_LIB_NAME} ole32)
191 endif(WIN32)
192
193
194 ########################################################################
195 #
196 # Aspell Program
197 #
198
199 add_subdirectory(prog)
200
201
202 ########################################################################
203 #
204 # Install
205 #
206
207 set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/../gnuwin32)
208
209 install(TARGETS ${ASPELL_LIB_NAME} 
210         RUNTIME DESTINATION bin
211         LIBRARY DESTINATION lib
212         ARCHIVE DESTINATION lib)
213         
214 install(FILES ../interfaces/cc/aspell.h 
215         DESTINATION include)
216
217 if(ASPELL_SHARED_LIB)
218         install(FILES ../win32/aspellexport.h
219         DESTINATION include)
220 endif(ASPELL_SHARED_LIB)
221