svn merge ^/trunk/blender -r46930:HEAD
[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         ../string
29         ../../source/blender/imbuf
30         ../../source/blender/makesdna
31 )
32
33 set(INC_SYS
34         ${GLEW_INCLUDE_PATH}
35 )
36
37 set(SRC
38         intern/GHOST_Buttons.cpp
39         intern/GHOST_C-api.cpp
40         intern/GHOST_CallbackEventConsumer.cpp
41         intern/GHOST_DisplayManager.cpp
42         intern/GHOST_EventManager.cpp
43         intern/GHOST_ISystem.cpp
44         intern/GHOST_ISystemPaths.cpp
45         intern/GHOST_ModifierKeys.cpp
46         intern/GHOST_Path-api.cpp
47         intern/GHOST_Path-api.cpp
48         intern/GHOST_Rect.cpp
49         intern/GHOST_System.cpp
50         intern/GHOST_TimerManager.cpp
51         intern/GHOST_Window.cpp
52         intern/GHOST_WindowManager.cpp
53
54         GHOST_C-api.h
55         GHOST_IEvent.h
56         GHOST_IEventConsumer.h
57         GHOST_ISystem.h
58         GHOST_ISystemPaths.h
59         GHOST_ITimerTask.h
60         GHOST_IWindow.h
61         GHOST_Path-api.h
62         GHOST_Rect.h
63         GHOST_Types.h
64
65         intern/GHOST_Buttons.h
66         intern/GHOST_CallbackEventConsumer.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 if(WITH_GHOST_DEBUG)
88         list(APPEND SRC
89                 intern/GHOST_EventPrinter.cpp
90
91                 intern/GHOST_EventPrinter.h
92         )
93         add_definitions(-DWITH_GHOST_DEBUG)
94 endif()
95
96 if(WITH_INPUT_NDOF)
97         add_definitions(-DWITH_INPUT_NDOF)
98
99         list(APPEND SRC
100                 intern/GHOST_NDOFManager.cpp
101
102                 intern/GHOST_EventNDOF.h
103                 intern/GHOST_NDOFManager.h
104         )
105
106         list(APPEND INC_SYS
107                 ${NDOF_INCLUDE_DIRS}
108         )
109 endif()
110
111 if(WITH_HEADLESS OR WITH_GHOST_SDL)
112         if(WITH_HEADLESS)
113                 list(APPEND SRC
114                         intern/GHOST_DisplayManagerNULL.h
115                         intern/GHOST_SystemNULL.h
116                         intern/GHOST_WindowNULL.h
117                 )
118                 add_definitions(-DWITH_HEADLESS)
119         else()
120                 list(APPEND SRC
121                         intern/GHOST_DisplayManagerSDL.cpp
122                         intern/GHOST_SystemSDL.cpp
123                         intern/GHOST_WindowSDL.cpp
124
125                         intern/GHOST_DisplayManagerSDL.h
126                         intern/GHOST_SystemSDL.h
127                         intern/GHOST_WindowSDL.h
128                 )
129                 add_definitions(-DWITH_GHOST_SDL)
130         endif()
131
132
133         # ack, this is still system dependant
134         if(APPLE)
135                 if(WITH_COCOA)
136                         list(APPEND SRC
137                                 intern/GHOST_SystemPathsCocoa.mm
138                                 intern/GHOST_SystemPathsCocoa.h
139                         )
140                 else()
141                         list(APPEND SRC
142                                 intern/GHOST_SystemPathsCarbon.cpp
143                                 intern/GHOST_SystemPathsCarbon.h
144                         )
145                 endif()
146         elseif(UNIX)
147                 list(APPEND SRC
148                         intern/GHOST_SystemPathsX11.cpp
149                         intern/GHOST_SystemPathsX11.h
150                 )
151
152                 if(NOT WITH_INSTALL_PORTABLE)
153                         add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
154                 endif()
155         elseif(WIN32)
156
157                 list(APPEND SRC
158                         intern/GHOST_SystemPathsWin32.cpp
159
160                         intern/GHOST_SystemPathsWin32.h
161                 )
162         endif()
163
164         if(NOT WITH_HEADLESS)
165                 list(APPEND INC_SYS
166                         ${SDL_INCLUDE_DIR}
167                 )
168         endif()
169
170 elseif(APPLE)
171         if(WITH_COCOA)
172                 list(APPEND SRC
173                         intern/GHOST_DisplayManagerCocoa.mm
174                         intern/GHOST_SystemCocoa.mm
175                         intern/GHOST_SystemPathsCocoa.mm
176                         intern/GHOST_WindowCocoa.mm
177
178                         intern/GHOST_DisplayManagerCocoa.h
179                         intern/GHOST_SystemCocoa.h
180                         intern/GHOST_SystemPathsCocoa.h
181                         intern/GHOST_WindowCocoa.h
182                 )
183
184                 if(WITH_INPUT_NDOF)
185                         list(APPEND SRC
186                                 intern/GHOST_NDOFManagerCocoa.mm
187
188                                 intern/GHOST_NDOFManagerCocoa.h
189                         )
190                 endif()
191
192         else()
193                 list(APPEND SRC
194                         intern/GHOST_DisplayManagerCarbon.cpp
195                         intern/GHOST_SystemCarbon.cpp
196                         intern/GHOST_SystemPathsCarbon.cpp
197                         intern/GHOST_WindowCarbon.cpp
198
199                         intern/GHOST_DisplayManagerCarbon.h
200                         intern/GHOST_SystemCarbon.h
201                         intern/GHOST_SystemPathsCarbon.h
202                         intern/GHOST_WindowCarbon.h
203                 )
204         endif()
205
206         if(WITH_CODEC_QUICKTIME)
207                 add_definitions(-DWITH_QUICKTIME)
208         endif()
209
210 elseif(UNIX)
211
212         list(APPEND INC_SYS
213                 ${X11_X11_INCLUDE_PATH}
214         )
215
216         list(APPEND SRC
217                 intern/GHOST_DisplayManagerX11.cpp
218                 intern/GHOST_SystemX11.cpp
219                 intern/GHOST_SystemPathsX11.cpp
220                 intern/GHOST_WindowX11.cpp
221
222                 intern/GHOST_DisplayManagerX11.h
223                 intern/GHOST_SystemX11.h
224                 intern/GHOST_SystemPathsX11.h
225                 intern/GHOST_WindowX11.h
226         )
227
228         if(WITH_GHOST_XDND)
229                 add_definitions(-DWITH_XDND)
230
231                 list(APPEND INC
232                         ../../extern/xdnd
233                 )
234
235                 list(APPEND SRC
236                         intern/GHOST_DropTargetX11.cpp
237
238                         intern/GHOST_DropTargetX11.h
239                 )
240         endif()
241
242         if(X11_XF86keysym_INCLUDE_PATH)
243                 add_definitions(-DWITH_XF86KEYSYM)
244                 list(APPEND INC_SYS
245                         ${X11_XF86keysym_INCLUDE_PATH}
246                 )
247         endif()
248
249         if(WITH_X11_XF86VMODE)
250                 add_definitions(-DWITH_X11_XF86VMODE)
251                 list(APPEND INC_SYS
252                         ${X11_xf86vmode_INCLUDE_PATH}
253                 )
254         endif()
255
256         if(WITH_INPUT_NDOF)
257                 list(APPEND SRC
258                         intern/GHOST_NDOFManagerX11.cpp
259
260                         intern/GHOST_NDOFManagerX11.h
261                 )
262         endif()
263
264         if(NOT WITH_INSTALL_PORTABLE)
265                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
266         endif()
267
268         if(WITH_X11_XINPUT)
269                 add_definitions(-DWITH_X11_XINPUT)
270         endif()
271
272 elseif(WIN32)
273         ## Warnings as errors, this is too strict!
274         #if(MSVC)
275         #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
276         #endif()
277
278         list(APPEND INC_SYS
279                 ${WINTAB_INC}
280         )
281
282         list(APPEND INC
283                 ../utfconv
284         )
285
286         list(APPEND SRC
287                 intern/GHOST_DisplayManagerWin32.cpp
288                 intern/GHOST_SystemWin32.cpp
289                 intern/GHOST_SystemPathsWin32.cpp
290                 intern/GHOST_WindowWin32.cpp
291                 intern/GHOST_DropTargetWin32.cpp
292
293                 intern/GHOST_DisplayManagerWin32.h
294                 intern/GHOST_DropTargetWin32.h
295                 intern/GHOST_SystemWin32.h
296                 intern/GHOST_SystemPathsWin32.h
297                 intern/GHOST_WindowWin32.h
298                 intern/GHOST_TaskbarWin32.h
299         )
300
301         if(WITH_INPUT_NDOF)
302                 list(APPEND SRC
303                         intern/GHOST_NDOFManagerWin32.cpp
304
305                         intern/GHOST_NDOFManagerWin32.h
306                 )
307         endif()
308
309 endif()
310
311 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
312