Fix T53004: XWayland ignores cursor-warp calls
[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 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Jacques Beaurain.
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 set(INC
27         .
28         ../glew-mx
29         ../string
30         ../../source/blender/imbuf
31         ../../source/blender/makesdna
32 )
33
34 set(INC_SYS
35         ${GLEW_INCLUDE_PATH}
36 )
37
38 set(SRC
39         intern/GHOST_Buttons.cpp
40         intern/GHOST_C-api.cpp
41         intern/GHOST_CallbackEventConsumer.cpp
42         intern/GHOST_Context.cpp
43         intern/GHOST_ContextNone.cpp
44         intern/GHOST_DisplayManager.cpp
45         intern/GHOST_EventManager.cpp
46         intern/GHOST_ISystem.cpp
47         intern/GHOST_ISystemPaths.cpp
48         intern/GHOST_ModifierKeys.cpp
49         intern/GHOST_Path-api.cpp
50         intern/GHOST_Rect.cpp
51         intern/GHOST_System.cpp
52         intern/GHOST_TimerManager.cpp
53         intern/GHOST_Window.cpp
54         intern/GHOST_WindowManager.cpp
55
56         GHOST_C-api.h
57         GHOST_IEvent.h
58         GHOST_IEventConsumer.h
59         GHOST_ISystem.h
60         GHOST_ISystemPaths.h
61         GHOST_ITimerTask.h
62         GHOST_IWindow.h
63         GHOST_Path-api.h
64         GHOST_Rect.h
65         GHOST_Types.h
66
67         intern/GHOST_Buttons.h
68         intern/GHOST_CallbackEventConsumer.h
69         intern/GHOST_Context.h
70         intern/GHOST_ContextNone.h
71         intern/GHOST_Debug.h
72         intern/GHOST_DisplayManager.h
73         intern/GHOST_Event.h
74         intern/GHOST_EventButton.h
75         intern/GHOST_EventCursor.h
76         intern/GHOST_EventDragnDrop.h
77         intern/GHOST_EventKey.h
78         intern/GHOST_EventManager.h
79         intern/GHOST_EventString.h
80         intern/GHOST_EventTrackpad.h
81         intern/GHOST_EventWheel.h
82         intern/GHOST_ModifierKeys.h
83         intern/GHOST_System.h
84         intern/GHOST_SystemPaths.h
85         intern/GHOST_TimerManager.h
86         intern/GHOST_TimerTask.h
87         intern/GHOST_Window.h
88         intern/GHOST_WindowManager.h
89 )
90
91 if(WITH_GHOST_DEBUG)
92         list(APPEND SRC
93                 intern/GHOST_EventPrinter.cpp
94
95                 intern/GHOST_EventPrinter.h
96         )
97         add_definitions(-DWITH_GHOST_DEBUG)
98 endif()
99
100 if(WITH_INPUT_NDOF)
101         add_definitions(-DWITH_INPUT_NDOF)
102
103         list(APPEND SRC
104                 intern/GHOST_NDOFManager.cpp
105
106                 intern/GHOST_EventNDOF.h
107                 intern/GHOST_NDOFManager.h
108         )
109
110         list(APPEND INC_SYS
111                 ${NDOF_INCLUDE_DIRS}
112         )
113 endif()
114
115 if(WITH_HEADLESS OR WITH_GHOST_SDL)
116         if(WITH_HEADLESS)
117                 list(APPEND SRC
118                         intern/GHOST_DisplayManagerNULL.h
119                         intern/GHOST_SystemNULL.h
120                         intern/GHOST_WindowNULL.h
121                 )
122                 add_definitions(-DWITH_HEADLESS)
123         else()
124                 list(APPEND SRC
125                         intern/GHOST_DisplayManagerSDL.cpp
126                         intern/GHOST_SystemSDL.cpp
127                         intern/GHOST_WindowSDL.cpp
128                         intern/GHOST_ContextSDL.cpp
129
130                         intern/GHOST_DisplayManagerSDL.h
131                         intern/GHOST_SystemSDL.h
132                         intern/GHOST_WindowSDL.h
133                         intern/GHOST_ContextSDL.h
134                 )
135                 add_definitions(-DWITH_GHOST_SDL)
136         endif()
137
138         if(NOT WITH_HEADLESS)
139                 list(APPEND INC_SYS
140                         ${SDL_INCLUDE_DIR}
141                 )
142         endif()
143
144 elseif(APPLE AND NOT WITH_X11)
145         list(APPEND SRC
146                 intern/GHOST_DisplayManagerCocoa.mm
147                 intern/GHOST_SystemCocoa.mm
148                 intern/GHOST_WindowCocoa.mm
149
150                 intern/GHOST_DisplayManagerCocoa.h
151                 intern/GHOST_SystemCocoa.h
152                 intern/GHOST_WindowCocoa.h
153         )
154
155         if(NOT WITH_GL_EGL)
156                 list(APPEND SRC
157                         intern/GHOST_ContextCGL.mm
158
159                         intern/GHOST_ContextCGL.h
160                 )
161         endif()
162
163         if(WITH_INPUT_NDOF)
164                 list(APPEND SRC
165                         intern/GHOST_NDOFManagerCocoa.mm
166
167                         intern/GHOST_NDOFManagerCocoa.h
168                 )
169         endif()
170
171 elseif(WITH_X11)
172         list(APPEND INC_SYS
173                 ${X11_X11_INCLUDE_PATH}
174         )
175
176         list(APPEND SRC
177                 intern/GHOST_DisplayManagerX11.cpp
178                 intern/GHOST_SystemX11.cpp
179                 intern/GHOST_WindowX11.cpp
180
181                 intern/GHOST_DisplayManagerX11.h
182                 intern/GHOST_SystemX11.h
183                 intern/GHOST_WindowX11.h
184         )
185
186         if(NOT WITH_GL_EGL)
187                 list(APPEND SRC
188                         intern/GHOST_ContextGLX.cpp
189
190                         intern/GHOST_ContextGLX.h
191                 )
192         endif()
193
194         if(WITH_GHOST_XDND)
195                 add_definitions(-DWITH_XDND)
196
197                 list(APPEND INC
198                         ../../extern/xdnd
199                 )
200
201                 list(APPEND SRC
202                         intern/GHOST_DropTargetX11.cpp
203
204                         intern/GHOST_DropTargetX11.h
205                 )
206         endif()
207
208         if(X11_XF86keysym_INCLUDE_PATH)
209                 add_definitions(-DWITH_XF86KEYSYM)
210                 list(APPEND INC_SYS
211                         ${X11_XF86keysym_INCLUDE_PATH}
212                 )
213         endif()
214
215         if(WITH_X11_XF86VMODE)
216                 add_definitions(-DWITH_X11_XF86VMODE)
217                 list(APPEND INC_SYS
218                         ${X11_xf86vmode_INCLUDE_PATH}
219                 )
220         endif()
221
222         if(WITH_X11_XFIXES)
223                 add_definitions(-DWITH_X11_XFIXES)
224                 list(APPEND INC_SYS
225                         ${X11_Xfixes_INCLUDE_PATH}
226                 )
227         endif()
228
229         if(WITH_X11_ALPHA)
230                 add_definitions(-DWITH_X11_ALPHA)
231         endif()
232
233         if(WITH_INPUT_NDOF)
234                 list(APPEND SRC
235                         intern/GHOST_NDOFManagerUnix.cpp
236
237                         intern/GHOST_NDOFManagerUnix.h
238                 )
239         endif()
240
241         if(NOT WITH_INSTALL_PORTABLE)
242                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
243         endif()
244
245         if(WITH_X11_XINPUT)
246                 add_definitions(-DWITH_X11_XINPUT)
247                 list(APPEND INC_SYS
248                         ${X11_Xinput_INCLUDE_PATH}
249                 )
250         endif()
251
252         add_definitions(-DWITH_X11)
253
254 elseif(WIN32)
255         ## Warnings as errors, this is too strict!
256         #if(MSVC)
257         #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
258         #endif()
259
260         list(APPEND INC_SYS
261                 ${WINTAB_INC}
262         )
263
264         list(APPEND SRC
265                 intern/GHOST_DisplayManagerWin32.cpp
266                 intern/GHOST_SystemWin32.cpp
267                 intern/GHOST_WindowWin32.cpp
268                 intern/GHOST_DropTargetWin32.cpp
269
270                 intern/GHOST_DisplayManagerWin32.h
271                 intern/GHOST_DropTargetWin32.h
272                 intern/GHOST_SystemWin32.h
273                 intern/GHOST_WindowWin32.h
274                 intern/GHOST_TaskbarWin32.h
275         )
276
277         if(NOT WITH_GL_EGL)
278                 list(APPEND SRC
279                         intern/GHOST_ContextWGL.cpp
280                                 
281                         intern/GHOST_ContextWGL.h
282                 )
283         endif()
284
285         if(WITH_INPUT_IME)
286                 add_definitions(-DWITH_INPUT_IME)
287
288                 list(APPEND SRC
289                         intern/GHOST_ImeWin32.cpp
290
291                         intern/GHOST_ImeWin32.h
292                 )
293         endif()
294
295         if(WITH_INPUT_NDOF)
296                 list(APPEND SRC
297                         intern/GHOST_NDOFManagerWin32.cpp
298
299                         intern/GHOST_NDOFManagerWin32.h
300                 )
301         endif()
302 endif()
303
304 if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
305         list(APPEND SRC
306                 intern/GHOST_ContextEGL.cpp
307                         
308                 intern/GHOST_ContextEGL.h
309         )
310 endif()
311
312 if(APPLE)
313         list(APPEND SRC
314                 intern/GHOST_SystemPathsCocoa.mm
315                 intern/GHOST_SystemPathsCocoa.h
316         )
317
318 elseif(UNIX)
319         list(APPEND SRC
320                 intern/GHOST_SystemPathsUnix.cpp
321                 intern/GHOST_SystemPathsUnix.h
322         )
323
324         if(NOT WITH_INSTALL_PORTABLE)
325                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
326         endif()
327
328 elseif(WIN32)
329         list(APPEND SRC
330                 intern/GHOST_SystemPathsWin32.cpp
331                 intern/GHOST_SystemPathsWin32.h
332         )
333
334         list(APPEND INC
335                 ../utfconv
336         )
337
338 endif()
339
340 add_definitions(${GL_DEFINITIONS})
341
342 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")