Merging pepper to trunk at revision 39791.
[blender.git] / intern / ghost / CMakeLists.txt
1 # $Id$
2 # ***** BEGIN GPL LICENSE BLOCK *****
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # The Original Code is Copyright (C) 2006, Blender Foundation
19 # All rights reserved.
20 #
21 # The Original Code is: all of this file.
22 #
23 # Contributor(s): Jacques Beaurain.
24 #
25 # ***** END GPL LICENSE BLOCK *****
26
27 set(INC
28         .
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_DisplayManager.cpp
43         intern/GHOST_EventManager.cpp
44         intern/GHOST_ISystem.cpp
45         intern/GHOST_ISystemPaths.cpp
46         intern/GHOST_ModifierKeys.cpp
47         intern/GHOST_Path-api.cpp
48         intern/GHOST_Path-api.cpp
49         intern/GHOST_Rect.cpp
50         intern/GHOST_System.cpp
51         intern/GHOST_TimerManager.cpp
52         intern/GHOST_Window.cpp
53         intern/GHOST_WindowManager.cpp
54
55         GHOST_C-api.h
56         GHOST_IEvent.h
57         GHOST_IEventConsumer.h
58         GHOST_ISystem.h
59         GHOST_ISystemPaths.h
60         GHOST_ITimerTask.h
61         GHOST_IWindow.h
62         GHOST_Path-api.h
63         GHOST_Rect.h
64         GHOST_Types.h
65
66         intern/GHOST_Buttons.h
67         intern/GHOST_CallbackEventConsumer.h
68         intern/GHOST_Debug.h
69         intern/GHOST_DisplayManager.h
70         intern/GHOST_Event.h
71         intern/GHOST_EventButton.h
72         intern/GHOST_EventCursor.h
73         intern/GHOST_EventDragnDrop.h
74         intern/GHOST_EventKey.h
75         intern/GHOST_EventManager.h
76         intern/GHOST_EventString.h
77         intern/GHOST_EventTrackpad.h
78         intern/GHOST_EventWheel.h
79         intern/GHOST_ModifierKeys.h
80         intern/GHOST_System.h
81         intern/GHOST_SystemPaths.h
82         intern/GHOST_TimerManager.h
83         intern/GHOST_TimerTask.h
84         intern/GHOST_Window.h
85         intern/GHOST_WindowManager.h
86 )
87
88 if(WITH_GHOST_DEBUG)
89         list(APPEND SRC
90                 intern/GHOST_EventPrinter.cpp
91
92                 intern/GHOST_EventPrinter.h
93         )
94         add_definitions(-DWITH_GHOST_DEBUG)
95 endif()
96
97 if(WITH_INPUT_NDOF)
98         add_definitions(-DWITH_INPUT_NDOF)
99
100         list(APPEND SRC
101                 intern/GHOST_NDOFManager.cpp
102
103                 intern/GHOST_EventNDOF.h
104                 intern/GHOST_NDOFManager.h
105         )
106
107         list(APPEND INC_SYS
108                 ${NDOF_INCLUDE_DIRS}
109         )
110 endif()
111
112 if(WITH_HEADLESS OR WITH_GHOST_SDL)
113         if(WITH_HEADLESS)
114                 list(APPEND SRC
115                         intern/GHOST_DisplayManagerNULL.h
116                         intern/GHOST_SystemNULL.h
117                         intern/GHOST_WindowNULL.h
118                 )
119                 add_definitions(-DWITH_HEADLESS)
120         else()
121                 list(APPEND SRC
122                         intern/GHOST_DisplayManagerSDL.cpp
123                         intern/GHOST_SystemSDL.cpp
124                         intern/GHOST_WindowSDL.cpp
125
126                         intern/GHOST_DisplayManagerSDL.h
127                         intern/GHOST_SystemSDL.h
128                         intern/GHOST_WindowSDL.h
129                 )
130                 add_definitions(-DWITH_GHOST_SDL)
131         endif()
132
133
134         # ack, this is still system dependant
135         if(APPLE)
136                 if(WITH_COCOA)
137                         list(APPEND SRC
138                                 intern/GHOST_SystemPathsCocoa.mm
139                                 intern/GHOST_SystemPathsCocoa.h
140                         )
141                 else()
142                         list(APPEND SRC
143                                 intern/GHOST_SystemPathsCarbon.cpp
144                                 intern/GHOST_SystemPathsCarbon.h
145                         )
146                 endif()
147         elseif(UNIX)
148                 list(APPEND SRC
149                         intern/GHOST_SystemPathsX11.cpp
150                         intern/GHOST_SystemPathsX11.h
151                 )
152
153                 if(NOT WITH_INSTALL_PORTABLE)
154                         add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
155                 endif()
156         elseif(WIN32)
157
158                 list(APPEND SRC
159                         intern/GHOST_SystemPathsWin32.cpp
160
161                         intern/GHOST_SystemPathsWin32.h
162                 )
163         endif()
164
165         list(APPEND INC_SYS
166                 ${SDL_INCLUDE_DIR}
167         )
168
169 elseif(APPLE)
170         if(WITH_COCOA)
171                 list(APPEND SRC
172                         intern/GHOST_DisplayManagerCocoa.mm
173                         intern/GHOST_SystemCocoa.mm
174                         intern/GHOST_SystemPathsCocoa.mm
175                         intern/GHOST_WindowCocoa.mm
176
177                         intern/GHOST_DisplayManagerCocoa.h
178                         intern/GHOST_SystemCocoa.h
179                         intern/GHOST_SystemPathsCocoa.h
180                         intern/GHOST_WindowCocoa.h
181                 )
182
183                 if(WITH_INPUT_NDOF)
184                         list(APPEND SRC
185                                 intern/GHOST_NDOFManagerCocoa.mm
186
187                                 intern/GHOST_NDOFManagerCocoa.h
188                         )
189                 endif()
190
191         else()
192                 list(APPEND SRC
193                         intern/GHOST_DisplayManagerCarbon.cpp
194                         intern/GHOST_SystemCarbon.cpp
195                         intern/GHOST_SystemPathsCarbon.cpp
196                         intern/GHOST_WindowCarbon.cpp
197
198                         intern/GHOST_DisplayManagerCarbon.h
199                         intern/GHOST_SystemCarbon.h
200                         intern/GHOST_SystemPathsCarbon.h
201                         intern/GHOST_WindowCarbon.h
202                 )
203         endif()
204
205         if(WITH_CODEC_QUICKTIME)
206                 add_definitions(-DWITH_QUICKTIME)
207         endif()
208
209 elseif(UNIX)
210
211         list(APPEND INC_SYS
212                 ${X11_X11_INCLUDE_PATH}
213         )
214
215         list(APPEND SRC
216                 intern/GHOST_DisplayManagerX11.cpp
217                 intern/GHOST_SystemX11.cpp
218                 intern/GHOST_SystemPathsX11.cpp
219                 intern/GHOST_WindowX11.cpp
220
221                 intern/GHOST_DisplayManagerX11.h
222                 intern/GHOST_SystemX11.h
223                 intern/GHOST_SystemPathsX11.h
224                 intern/GHOST_WindowX11.h
225         )
226
227         if(X11_XF86keysym_INCLUDE_PATH)
228                 add_definitions(-DWITH_XF86KEYSYM)
229                 list(APPEND INC_SYS
230                         ${X11_XF86keysym_INCLUDE_PATH}
231                 )
232         endif()
233
234         if(WITH_INPUT_NDOF)
235                 list(APPEND SRC
236                         intern/GHOST_NDOFManagerX11.cpp
237
238                         intern/GHOST_NDOFManagerX11.h
239                 )
240         endif()
241
242         if(NOT WITH_INSTALL_PORTABLE)
243                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
244         endif()
245
246         if(WITH_X11_XINPUT)
247                 add_definitions(-DWITH_X11_XINPUT)
248         endif()
249
250 elseif(WIN32)
251         if(MSVC)
252                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
253         endif()
254
255         list(APPEND INC_SYS
256                 ${WINTAB_INC}
257         )
258
259         list(APPEND SRC
260                 intern/GHOST_DisplayManagerWin32.cpp
261                 intern/GHOST_SystemWin32.cpp
262                 intern/GHOST_SystemPathsWin32.cpp
263                 intern/GHOST_WindowWin32.cpp
264                 intern/GHOST_DropTargetWin32.cpp
265
266                 intern/GHOST_DisplayManagerWin32.h
267                 intern/GHOST_DropTargetWin32.h
268                 intern/GHOST_SystemWin32.h
269                 intern/GHOST_SystemPathsWin32.h
270                 intern/GHOST_WindowWin32.h
271                 intern/GHOST_TaskbarWin32.h
272         )
273
274         if(WITH_INPUT_NDOF)
275                 list(APPEND SRC
276                         intern/GHOST_NDOFManagerWin32.cpp
277
278                         intern/GHOST_NDOFManagerWin32.h
279                 )
280         endif()
281
282 endif()
283
284 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
285