build option to use SDL 1.3 for GHOST rather then X11/Win32/Cocoa api's,
[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_CallbackEventConsumer.cpp
41         intern/GHOST_C-api.cpp
42         intern/GHOST_Path-api.cpp
43         intern/GHOST_DisplayManager.cpp
44         intern/GHOST_EventManager.cpp
45         intern/GHOST_EventPrinter.cpp
46         intern/GHOST_ISystem.cpp
47         intern/GHOST_ISystemPaths.cpp
48         intern/GHOST_ModifierKeys.cpp
49         intern/GHOST_NDOFManager.cpp
50         intern/GHOST_Path-api.cpp
51         intern/GHOST_Rect.cpp
52         intern/GHOST_System.cpp
53         intern/GHOST_TimerManager.cpp
54         intern/GHOST_Window.cpp
55         intern/GHOST_WindowManager.cpp
56
57         GHOST_C-api.h
58         GHOST_IEvent.h
59         GHOST_IEventConsumer.h
60         GHOST_ISystem.h
61         GHOST_ISystemPaths.h
62         GHOST_ITimerTask.h
63         GHOST_IWindow.h
64         GHOST_Path-api.h
65         GHOST_Rect.h
66         GHOST_Types.h
67         intern/GHOST_Buttons.h
68         intern/GHOST_CallbackEventConsumer.h
69         intern/GHOST_Debug.h
70         intern/GHOST_DisplayManager.h
71         intern/GHOST_Event.h
72         intern/GHOST_EventButton.h
73         intern/GHOST_EventCursor.h
74         intern/GHOST_EventDragnDrop.h
75         intern/GHOST_EventKey.h
76         intern/GHOST_EventManager.h
77         intern/GHOST_EventNDOF.h
78         intern/GHOST_EventPrinter.h
79         intern/GHOST_EventString.h
80         intern/GHOST_EventTrackpad.h
81         intern/GHOST_EventWheel.h
82         intern/GHOST_ModifierKeys.h
83         intern/GHOST_NDOFManager.h
84         intern/GHOST_System.h
85         intern/GHOST_SystemPaths.h
86         intern/GHOST_TimerManager.h
87         intern/GHOST_TimerTask.h
88         intern/GHOST_Window.h
89         intern/GHOST_WindowManager.h
90 )
91
92 if(WITH_HEADLESS OR WITH_SDL_GHOST)
93         if(WITH_HEADLESS)
94                 list(APPEND SRC
95                         intern/GHOST_DisplayManagerNULL.h
96                         intern/GHOST_SystemNULL.h
97                         intern/GHOST_WindowNULL.h
98                 )
99                 add_definitions(-DWITH_HEADLESS)
100         else()
101                 list(APPEND SRC
102                         intern/GHOST_DisplayManagerSDL.cpp
103                         intern/GHOST_SystemSDL.cpp
104                         intern/GHOST_WindowSDL.cpp
105
106                         intern/GHOST_DisplayManagerSDL.h
107                         intern/GHOST_SystemSDL.h
108                         intern/GHOST_WindowSDL.h
109                 )
110                 add_definitions(-DWITH_SDL_GHOST)
111         endif()
112
113
114         # ack, this is still system dependant
115         if(APPLE)
116                 if(WITH_COCOA)
117                         list(APPEND SRC
118                                 intern/GHOST_SystemPathsCocoa.mm
119                                 intern/GHOST_SystemPathsCocoa.h
120                         )
121                 else()
122                         list(APPEND SRC
123                                 intern/GHOST_SystemPathsCarbon.cpp
124                                 intern/GHOST_SystemPathsCarbon.h
125                         )
126                 endif()
127         elseif(UNIX)
128                 list(APPEND SRC
129                         intern/GHOST_SystemPathsX11.cpp
130                         intern/GHOST_SystemPathsX11.h
131                 )
132         elseif(WIN32)
133
134                 list(APPEND SRC
135                         intern/GHOST_SystemPathsWin32.cpp
136
137                         intern/GHOST_SystemPathsWin32.h
138                 )
139         endif()
140
141         list(APPEND INC_SYS ${SDL_INCLUDE_DIR})
142
143 elseif(APPLE)
144         if(WITH_COCOA)
145                 list(APPEND SRC
146                         intern/GHOST_DisplayManagerCocoa.mm
147                         intern/GHOST_SystemCocoa.mm
148                         intern/GHOST_SystemPathsCocoa.mm
149                         intern/GHOST_WindowCocoa.mm
150                         
151                         intern/GHOST_DisplayManagerCocoa.h
152                         intern/GHOST_SystemCocoa.h
153                         intern/GHOST_SystemPathsCocoa.h
154                         intern/GHOST_WindowCocoa.h
155                 )
156         else()
157                 list(APPEND SRC
158                         intern/GHOST_DisplayManagerCarbon.cpp
159                         intern/GHOST_SystemCarbon.cpp
160                         intern/GHOST_SystemPathsCarbon.cpp
161                         intern/GHOST_WindowCarbon.cpp
162
163                         intern/GHOST_DisplayManagerCarbon.h
164                         intern/GHOST_SystemCarbon.h
165                         intern/GHOST_SystemPathsCarbon.h
166                         intern/GHOST_WindowCarbon.h
167                 )
168         endif()
169
170         if(WITH_CODEC_QUICKTIME)
171                 add_definitions(-DWITH_QUICKTIME)
172         endif()
173
174 elseif(UNIX)
175
176         if(WITH_X11_XINPUT)
177                 add_definitions(-DWITH_X11_XINPUT)
178         endif()
179
180         list(APPEND INC_SYS ${X11_X11_INCLUDE_PATH})
181
182         list(APPEND SRC
183                 intern/GHOST_DisplayManagerX11.cpp
184                 intern/GHOST_SystemX11.cpp
185                 intern/GHOST_SystemPathsX11.cpp
186                 intern/GHOST_WindowX11.cpp
187
188                 intern/GHOST_DisplayManagerX11.h
189                 intern/GHOST_SystemX11.h
190                 intern/GHOST_SystemPathsX11.h
191                 intern/GHOST_WindowX11.h
192         )
193
194         if(NOT WITH_INSTALL_PORTABLE)
195                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
196         endif()
197
198         if(X11_XF86keysym_INCLUDE_PATH)
199                 add_definitions(-DWITH_XF86KEYSYM)
200                 list(APPEND INC_SYS ${X11_XF86keysym_INCLUDE_PATH})
201         endif()
202
203 elseif(WIN32)
204         if(MSVC)
205                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
206         endif()
207
208         list(APPEND INC_SYS ${WINTAB_INC})
209
210         list(APPEND SRC
211                 intern/GHOST_DisplayManagerWin32.cpp
212                 intern/GHOST_SystemWin32.cpp
213                 intern/GHOST_SystemPathsWin32.cpp
214                 intern/GHOST_WindowWin32.cpp
215                 intern/GHOST_DropTargetWin32.cpp
216
217                 intern/GHOST_DisplayManagerWin32.h
218                 intern/GHOST_DropTargetWin32.h
219                 intern/GHOST_SystemWin32.h
220                 intern/GHOST_SystemPathsWin32.h
221                 intern/GHOST_WindowWin32.h
222                 intern/GHOST_TaskbarWin32.h
223         )
224 endif()
225
226 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
227