Cleanup: use wm prefix for GenericCallback
[blender.git] / intern / ghost / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 # ***** END GPL LICENSE BLOCK *****
20
21 set(INC
22   .
23   ../glew-mx
24   ../string
25   ../../source/blender/imbuf
26   ../../source/blender/makesdna
27 )
28
29 set(INC_SYS
30   ${GLEW_INCLUDE_PATH}
31 )
32
33 set(SRC
34   intern/GHOST_Buttons.cpp
35   intern/GHOST_C-api.cpp
36   intern/GHOST_CallbackEventConsumer.cpp
37   intern/GHOST_Context.cpp
38   intern/GHOST_ContextNone.cpp
39   intern/GHOST_DisplayManager.cpp
40   intern/GHOST_EventManager.cpp
41   intern/GHOST_ISystem.cpp
42   intern/GHOST_ISystemPaths.cpp
43   intern/GHOST_ModifierKeys.cpp
44   intern/GHOST_Path-api.cpp
45   intern/GHOST_Rect.cpp
46   intern/GHOST_System.cpp
47   intern/GHOST_TimerManager.cpp
48   intern/GHOST_Window.cpp
49   intern/GHOST_WindowManager.cpp
50
51   GHOST_C-api.h
52   GHOST_IContext.h
53   GHOST_IEvent.h
54   GHOST_IEventConsumer.h
55   GHOST_ISystem.h
56   GHOST_ISystemPaths.h
57   GHOST_ITimerTask.h
58   GHOST_IWindow.h
59   GHOST_Path-api.h
60   GHOST_Rect.h
61   GHOST_Types.h
62
63   intern/GHOST_Buttons.h
64   intern/GHOST_CallbackEventConsumer.h
65   intern/GHOST_Context.h
66   intern/GHOST_ContextNone.h
67   intern/GHOST_Debug.h
68   intern/GHOST_DisplayManager.h
69   intern/GHOST_Event.h
70   intern/GHOST_EventButton.h
71   intern/GHOST_EventCursor.h
72   intern/GHOST_EventDragnDrop.h
73   intern/GHOST_EventKey.h
74   intern/GHOST_EventManager.h
75   intern/GHOST_EventString.h
76   intern/GHOST_EventTrackpad.h
77   intern/GHOST_EventWheel.h
78   intern/GHOST_ModifierKeys.h
79   intern/GHOST_System.h
80   intern/GHOST_SystemPaths.h
81   intern/GHOST_TimerManager.h
82   intern/GHOST_TimerTask.h
83   intern/GHOST_Window.h
84   intern/GHOST_WindowManager.h
85 )
86
87 set(LIB
88   bf_intern_glew_mx
89   bf_intern_string
90   ${GLEW_LIBRARY}
91 )
92
93 if(WITH_GHOST_DEBUG)
94   list(APPEND SRC
95     intern/GHOST_EventPrinter.cpp
96
97     intern/GHOST_EventPrinter.h
98   )
99   add_definitions(-DWITH_GHOST_DEBUG)
100 endif()
101
102 if(WITH_INPUT_NDOF)
103   add_definitions(-DWITH_INPUT_NDOF)
104
105   list(APPEND SRC
106     intern/GHOST_NDOFManager.cpp
107
108     intern/GHOST_EventNDOF.h
109     intern/GHOST_NDOFManager.h
110   )
111
112   list(APPEND INC_SYS
113     ${NDOF_INCLUDE_DIRS}
114   )
115 endif()
116
117 if(WITH_HEADLESS OR WITH_GHOST_SDL)
118   if(WITH_HEADLESS)
119     list(APPEND SRC
120       intern/GHOST_DisplayManagerNULL.h
121       intern/GHOST_SystemNULL.h
122       intern/GHOST_WindowNULL.h
123     )
124     add_definitions(-DWITH_HEADLESS)
125   else()
126     list(APPEND SRC
127       intern/GHOST_ContextSDL.cpp
128       intern/GHOST_DisplayManagerSDL.cpp
129       intern/GHOST_SystemSDL.cpp
130       intern/GHOST_WindowSDL.cpp
131
132       intern/GHOST_ContextSDL.h
133       intern/GHOST_DisplayManagerSDL.h
134       intern/GHOST_SystemSDL.h
135       intern/GHOST_WindowSDL.h
136     )
137     add_definitions(-DWITH_GHOST_SDL)
138   endif()
139
140   if(NOT WITH_HEADLESS)
141     list(APPEND INC_SYS
142       ${SDL_INCLUDE_DIR}
143     )
144   endif()
145
146 elseif(APPLE AND NOT WITH_X11)
147   list(APPEND SRC
148     intern/GHOST_DisplayManagerCocoa.mm
149     intern/GHOST_SystemCocoa.mm
150     intern/GHOST_WindowCocoa.mm
151
152     intern/GHOST_DisplayManagerCocoa.h
153     intern/GHOST_SystemCocoa.h
154     intern/GHOST_WindowCocoa.h
155   )
156
157   if(NOT WITH_GL_EGL)
158     list(APPEND SRC
159       intern/GHOST_ContextCGL.mm
160
161       intern/GHOST_ContextCGL.h
162     )
163   endif()
164
165   if(WITH_INPUT_NDOF)
166     list(APPEND SRC
167       intern/GHOST_NDOFManagerCocoa.mm
168
169       intern/GHOST_NDOFManagerCocoa.h
170     )
171   endif()
172
173 elseif(WITH_X11)
174   list(APPEND INC_SYS
175     ${X11_X11_INCLUDE_PATH}
176   )
177
178   list(APPEND SRC
179     intern/GHOST_DisplayManagerX11.cpp
180     intern/GHOST_SystemX11.cpp
181     intern/GHOST_TaskbarX11.cpp
182     intern/GHOST_WindowX11.cpp
183
184     intern/GHOST_DisplayManagerX11.h
185     intern/GHOST_SystemX11.h
186     intern/GHOST_TaskbarX11.h
187     intern/GHOST_WindowX11.h
188   )
189
190   if(NOT WITH_GL_EGL)
191     list(APPEND SRC
192       intern/GHOST_ContextGLX.cpp
193
194       intern/GHOST_ContextGLX.h
195     )
196   endif()
197
198   if(WITH_GHOST_XDND)
199     add_definitions(-DWITH_XDND)
200
201     list(APPEND LIB
202       extern_xdnd
203     )
204
205     list(APPEND INC
206       ../../extern/xdnd
207     )
208
209     list(APPEND SRC
210       intern/GHOST_DropTargetX11.cpp
211
212       intern/GHOST_DropTargetX11.h
213     )
214   endif()
215
216   if(X11_XF86keysym_INCLUDE_PATH)
217     add_definitions(-DWITH_XF86KEYSYM)
218     list(APPEND INC_SYS
219       ${X11_XF86keysym_INCLUDE_PATH}
220     )
221   endif()
222
223   if(WITH_X11_XF86VMODE)
224     add_definitions(-DWITH_X11_XF86VMODE)
225     list(APPEND INC_SYS
226       ${X11_xf86vmode_INCLUDE_PATH}
227     )
228   endif()
229
230   if(WITH_X11_XFIXES)
231     add_definitions(-DWITH_X11_XFIXES)
232     list(APPEND INC_SYS
233       ${X11_Xfixes_INCLUDE_PATH}
234     )
235   endif()
236
237   if(WITH_X11_ALPHA)
238     add_definitions(-DWITH_X11_ALPHA)
239   endif()
240
241   if(WITH_INPUT_NDOF)
242     list(APPEND SRC
243       intern/GHOST_NDOFManagerUnix.cpp
244
245       intern/GHOST_NDOFManagerUnix.h
246     )
247   endif()
248
249   if(NOT WITH_INSTALL_PORTABLE)
250     add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
251   endif()
252
253   if(WITH_X11_XINPUT)
254     add_definitions(-DWITH_X11_XINPUT)
255     list(APPEND INC_SYS
256       ${X11_Xinput_INCLUDE_PATH}
257     )
258   endif()
259
260   add_definitions(-DWITH_X11)
261
262 elseif(WIN32)
263   ## Warnings as errors, this is too strict!
264   #if(MSVC)
265   #   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
266   #endif()
267
268   list(APPEND INC_SYS
269     ${WINTAB_INC}
270   )
271
272   list(APPEND SRC
273     intern/GHOST_DisplayManagerWin32.cpp
274     intern/GHOST_DropTargetWin32.cpp
275     intern/GHOST_SystemWin32.cpp
276     intern/GHOST_WindowWin32.cpp
277
278     intern/GHOST_DisplayManagerWin32.h
279     intern/GHOST_DropTargetWin32.h
280     intern/GHOST_SystemWin32.h
281     intern/GHOST_TaskbarWin32.h
282     intern/GHOST_WindowWin32.h
283   )
284
285   if(NOT WITH_GL_EGL)
286     list(APPEND SRC
287       intern/GHOST_ContextWGL.cpp
288
289       intern/GHOST_ContextWGL.h
290     )
291   endif()
292
293   if(WITH_INPUT_IME)
294     add_definitions(-DWITH_INPUT_IME)
295
296     list(APPEND SRC
297       intern/GHOST_ImeWin32.cpp
298
299       intern/GHOST_ImeWin32.h
300     )
301   endif()
302
303   if(WITH_INPUT_NDOF)
304     list(APPEND SRC
305       intern/GHOST_NDOFManagerWin32.cpp
306
307       intern/GHOST_NDOFManagerWin32.h
308     )
309   endif()
310 endif()
311
312 if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
313   list(APPEND SRC
314     intern/GHOST_ContextEGL.cpp
315
316     intern/GHOST_ContextEGL.h
317   )
318 endif()
319
320 if(APPLE)
321   list(APPEND SRC
322     intern/GHOST_SystemPathsCocoa.h
323     intern/GHOST_SystemPathsCocoa.mm
324   )
325
326 elseif(UNIX)
327   list(APPEND SRC
328     intern/GHOST_SystemPathsUnix.cpp
329     intern/GHOST_SystemPathsUnix.h
330   )
331
332   if(NOT WITH_INSTALL_PORTABLE)
333     add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
334   endif()
335
336 elseif(WIN32)
337   list(APPEND SRC
338     intern/GHOST_SystemPathsWin32.cpp
339     intern/GHOST_SystemPathsWin32.h
340   )
341
342   list(APPEND INC
343     ../utfconv
344   )
345
346 endif()
347
348 add_definitions(${GL_DEFINITIONS})
349
350 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")