BGE: alpha on frame buffer and precedence of MSAA over swap.
[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         if(WITH_CODEC_QUICKTIME)
172                 add_definitions(-DWITH_QUICKTIME)
173         endif()
174
175 elseif(WITH_X11)
176         list(APPEND INC_SYS
177                 ${X11_X11_INCLUDE_PATH}
178         )
179
180         list(APPEND SRC
181                 intern/GHOST_DisplayManagerX11.cpp
182                 intern/GHOST_SystemX11.cpp
183                 intern/GHOST_WindowX11.cpp
184
185                 intern/GHOST_DisplayManagerX11.h
186                 intern/GHOST_SystemX11.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 INC
202                         ../../extern/xdnd
203                 )
204
205                 list(APPEND SRC
206                         intern/GHOST_DropTargetX11.cpp
207
208                         intern/GHOST_DropTargetX11.h
209                 )
210         endif()
211
212         if(X11_XF86keysym_INCLUDE_PATH)
213                 add_definitions(-DWITH_XF86KEYSYM)
214                 list(APPEND INC_SYS
215                         ${X11_XF86keysym_INCLUDE_PATH}
216                 )
217         endif()
218
219         if(WITH_X11_XF86VMODE)
220                 add_definitions(-DWITH_X11_XF86VMODE)
221                 list(APPEND INC_SYS
222                         ${X11_xf86vmode_INCLUDE_PATH}
223                 )
224         endif()
225
226         if(WITH_X11_ALPHA)
227                 add_definitions(-DWITH_X11_ALPHA)
228         endif()
229
230         if(WITH_INPUT_NDOF)
231                 list(APPEND SRC
232                         intern/GHOST_NDOFManagerUnix.cpp
233
234                         intern/GHOST_NDOFManagerUnix.h
235                 )
236         endif()
237
238         if(NOT WITH_INSTALL_PORTABLE)
239                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
240         endif()
241
242         if(WITH_X11_XINPUT)
243                 add_definitions(-DWITH_X11_XINPUT)
244                 list(APPEND INC_SYS
245                         ${X11_Xinput_INCLUDE_PATH}
246                 )
247         endif()
248
249         add_definitions(-DWITH_X11)
250
251 elseif(WIN32)
252         ## Warnings as errors, this is too strict!
253         #if(MSVC)
254         #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
255         #endif()
256
257         list(APPEND INC_SYS
258                 ${WINTAB_INC}
259         )
260
261         list(APPEND SRC
262                 intern/GHOST_DisplayManagerWin32.cpp
263                 intern/GHOST_SystemWin32.cpp
264                 intern/GHOST_WindowWin32.cpp
265                 intern/GHOST_DropTargetWin32.cpp
266
267                 intern/GHOST_DisplayManagerWin32.h
268                 intern/GHOST_DropTargetWin32.h
269                 intern/GHOST_SystemWin32.h
270                 intern/GHOST_WindowWin32.h
271                 intern/GHOST_TaskbarWin32.h
272         )
273
274         if(NOT WITH_GL_EGL)
275                 list(APPEND SRC
276                         intern/GHOST_ContextWGL.cpp
277                                 
278                         intern/GHOST_ContextWGL.h
279                 )
280         endif()
281
282         if(WITH_INPUT_IME)
283                 add_definitions(-DWITH_INPUT_IME)
284
285                 list(APPEND SRC
286                         intern/GHOST_ImeWin32.cpp
287
288                         intern/GHOST_ImeWin32.h
289                 )
290         endif()
291
292         if(WITH_INPUT_NDOF)
293                 list(APPEND SRC
294                         intern/GHOST_NDOFManagerWin32.cpp
295
296                         intern/GHOST_NDOFManagerWin32.h
297                 )
298         endif()
299 endif()
300
301 if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
302         list(APPEND SRC
303                 intern/GHOST_ContextEGL.cpp
304                         
305                 intern/GHOST_ContextEGL.h
306         )
307 endif()
308
309 if(APPLE)
310         list(APPEND SRC
311                 intern/GHOST_SystemPathsCocoa.mm
312                 intern/GHOST_SystemPathsCocoa.h
313         )
314
315 elseif(UNIX)
316         list(APPEND SRC
317                 intern/GHOST_SystemPathsUnix.cpp
318                 intern/GHOST_SystemPathsUnix.h
319         )
320
321         if(NOT WITH_INSTALL_PORTABLE)
322                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
323         endif()
324
325 elseif(WIN32)
326         list(APPEND SRC
327                 intern/GHOST_SystemPathsWin32.cpp
328                 intern/GHOST_SystemPathsWin32.h
329         )
330
331         list(APPEND INC
332                 ../utfconv
333         )
334
335 endif()
336
337 add_definitions(${GL_DEFINITIONS})
338
339 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")