svn merge -r41458:41480 ^/trunk/blender
[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_XDG_USER_DIRS)
112         add_definitions(-DWITH_XDG_USER_DIRS)
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
129                         intern/GHOST_DisplayManagerSDL.h
130                         intern/GHOST_SystemSDL.h
131                         intern/GHOST_WindowSDL.h
132                 )
133                 add_definitions(-DWITH_GHOST_SDL)
134         endif()
135
136
137         # ack, this is still system dependant
138         if(APPLE)
139                 if(WITH_COCOA)
140                         list(APPEND SRC
141                                 intern/GHOST_SystemPathsCocoa.mm
142                                 intern/GHOST_SystemPathsCocoa.h
143                         )
144                 else()
145                         list(APPEND SRC
146                                 intern/GHOST_SystemPathsCarbon.cpp
147                                 intern/GHOST_SystemPathsCarbon.h
148                         )
149                 endif()
150         elseif(UNIX)
151                 list(APPEND SRC
152                         intern/GHOST_SystemPathsX11.cpp
153                         intern/GHOST_SystemPathsX11.h
154                 )
155
156                 if(NOT WITH_INSTALL_PORTABLE)
157                         add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
158                 endif()
159         elseif(WIN32)
160
161                 list(APPEND SRC
162                         intern/GHOST_SystemPathsWin32.cpp
163
164                         intern/GHOST_SystemPathsWin32.h
165                 )
166         endif()
167
168         list(APPEND INC_SYS
169                 ${SDL_INCLUDE_DIR}
170         )
171
172 elseif(APPLE)
173         if(WITH_COCOA)
174                 list(APPEND SRC
175                         intern/GHOST_DisplayManagerCocoa.mm
176                         intern/GHOST_SystemCocoa.mm
177                         intern/GHOST_SystemPathsCocoa.mm
178                         intern/GHOST_WindowCocoa.mm
179
180                         intern/GHOST_DisplayManagerCocoa.h
181                         intern/GHOST_SystemCocoa.h
182                         intern/GHOST_SystemPathsCocoa.h
183                         intern/GHOST_WindowCocoa.h
184                 )
185
186                 if(WITH_INPUT_NDOF)
187                         list(APPEND SRC
188                                 intern/GHOST_NDOFManagerCocoa.mm
189
190                                 intern/GHOST_NDOFManagerCocoa.h
191                         )
192                 endif()
193
194         else()
195                 list(APPEND SRC
196                         intern/GHOST_DisplayManagerCarbon.cpp
197                         intern/GHOST_SystemCarbon.cpp
198                         intern/GHOST_SystemPathsCarbon.cpp
199                         intern/GHOST_WindowCarbon.cpp
200
201                         intern/GHOST_DisplayManagerCarbon.h
202                         intern/GHOST_SystemCarbon.h
203                         intern/GHOST_SystemPathsCarbon.h
204                         intern/GHOST_WindowCarbon.h
205                 )
206         endif()
207
208         if(WITH_CODEC_QUICKTIME)
209                 add_definitions(-DWITH_QUICKTIME)
210         endif()
211
212 elseif(UNIX)
213
214         list(APPEND INC_SYS
215                 ${X11_X11_INCLUDE_PATH}
216         )
217
218         list(APPEND SRC
219                 intern/GHOST_DisplayManagerX11.cpp
220                 intern/GHOST_SystemX11.cpp
221                 intern/GHOST_SystemPathsX11.cpp
222                 intern/GHOST_WindowX11.cpp
223
224                 intern/GHOST_DisplayManagerX11.h
225                 intern/GHOST_SystemX11.h
226                 intern/GHOST_SystemPathsX11.h
227                 intern/GHOST_WindowX11.h
228         )
229
230         if(X11_XF86keysym_INCLUDE_PATH)
231                 add_definitions(-DWITH_XF86KEYSYM)
232                 list(APPEND INC_SYS
233                         ${X11_XF86keysym_INCLUDE_PATH}
234                 )
235         endif()
236
237         if(WITH_INPUT_NDOF)
238                 list(APPEND SRC
239                         intern/GHOST_NDOFManagerX11.cpp
240
241                         intern/GHOST_NDOFManagerX11.h
242                 )
243         endif()
244
245         if(NOT WITH_INSTALL_PORTABLE)
246                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
247         endif()
248
249         if(WITH_X11_XINPUT)
250                 add_definitions(-DWITH_X11_XINPUT)
251         endif()
252
253 elseif(WIN32)
254         ## Warnings as errors, this is too strict!
255         #if(MSVC)
256         #       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
257         #endif()
258
259         list(APPEND INC_SYS
260                 ${WINTAB_INC}
261         )
262
263         list(APPEND SRC
264                 intern/GHOST_DisplayManagerWin32.cpp
265                 intern/GHOST_SystemWin32.cpp
266                 intern/GHOST_SystemPathsWin32.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_SystemPathsWin32.h
274                 intern/GHOST_WindowWin32.h
275                 intern/GHOST_TaskbarWin32.h
276         )
277
278         if(WITH_INPUT_NDOF)
279                 list(APPEND SRC
280                         intern/GHOST_NDOFManagerWin32.cpp
281
282                         intern/GHOST_NDOFManagerWin32.h
283                 )
284         endif()
285
286 endif()
287
288 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
289