cmake source definitions:
[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_ISystem.cpp
46         intern/GHOST_ISystemPaths.cpp
47         intern/GHOST_ModifierKeys.cpp
48         intern/GHOST_NDOFManager.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         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_EventNDOF.h
77         intern/GHOST_EventString.h
78         intern/GHOST_EventTrackpad.h
79         intern/GHOST_EventWheel.h
80         intern/GHOST_ModifierKeys.h
81         intern/GHOST_NDOFManager.h
82         intern/GHOST_System.h
83         intern/GHOST_SystemPaths.h
84         intern/GHOST_TimerManager.h
85         intern/GHOST_TimerTask.h
86         intern/GHOST_Window.h
87         intern/GHOST_WindowManager.h
88 )
89
90 if(WITH_GHOST_DEBUG)
91         list(APPEND SRC
92                 intern/GHOST_EventPrinter.cpp
93
94                 intern/GHOST_EventPrinter.h
95         )
96         add_definitions(-DWITH_GHOST_DEBUG)
97 endif()
98
99
100 if(WITH_HEADLESS OR WITH_GHOST_SDL)
101         if(WITH_HEADLESS)
102                 list(APPEND SRC
103                         intern/GHOST_DisplayManagerNULL.h
104                         intern/GHOST_SystemNULL.h
105                         intern/GHOST_WindowNULL.h
106                 )
107                 add_definitions(-DWITH_HEADLESS)
108         else()
109                 list(APPEND SRC
110                         intern/GHOST_DisplayManagerSDL.cpp
111                         intern/GHOST_SystemSDL.cpp
112                         intern/GHOST_WindowSDL.cpp
113
114                         intern/GHOST_DisplayManagerSDL.h
115                         intern/GHOST_SystemSDL.h
116                         intern/GHOST_WindowSDL.h
117                 )
118                 add_definitions(-DWITH_GHOST_SDL)
119         endif()
120
121
122         # ack, this is still system dependant
123         if(APPLE)
124                 if(WITH_COCOA)
125                         list(APPEND SRC
126                                 intern/GHOST_SystemPathsCocoa.mm
127                                 intern/GHOST_SystemPathsCocoa.h
128                         )
129                 else()
130                         list(APPEND SRC
131                                 intern/GHOST_SystemPathsCarbon.cpp
132                                 intern/GHOST_SystemPathsCarbon.h
133                         )
134                 endif()
135         elseif(UNIX)
136                 list(APPEND SRC
137                         intern/GHOST_SystemPathsX11.cpp
138                         intern/GHOST_SystemPathsX11.h
139                 )
140         elseif(WIN32)
141
142                 list(APPEND SRC
143                         intern/GHOST_SystemPathsWin32.cpp
144
145                         intern/GHOST_SystemPathsWin32.h
146                 )
147         endif()
148
149         list(APPEND INC_SYS
150                 ${SDL_INCLUDE_DIR}
151         )
152
153 elseif(APPLE)
154         if(WITH_COCOA)
155                 list(APPEND SRC
156                         intern/GHOST_DisplayManagerCocoa.mm
157                         intern/GHOST_SystemCocoa.mm
158                         intern/GHOST_SystemPathsCocoa.mm
159                         intern/GHOST_WindowCocoa.mm
160                         
161                         intern/GHOST_DisplayManagerCocoa.h
162                         intern/GHOST_SystemCocoa.h
163                         intern/GHOST_SystemPathsCocoa.h
164                         intern/GHOST_WindowCocoa.h
165                 )
166         else()
167                 list(APPEND SRC
168                         intern/GHOST_DisplayManagerCarbon.cpp
169                         intern/GHOST_SystemCarbon.cpp
170                         intern/GHOST_SystemPathsCarbon.cpp
171                         intern/GHOST_WindowCarbon.cpp
172
173                         intern/GHOST_DisplayManagerCarbon.h
174                         intern/GHOST_SystemCarbon.h
175                         intern/GHOST_SystemPathsCarbon.h
176                         intern/GHOST_WindowCarbon.h
177                 )
178         endif()
179
180         if(WITH_CODEC_QUICKTIME)
181                 add_definitions(-DWITH_QUICKTIME)
182         endif()
183
184 elseif(UNIX)
185
186         if(WITH_X11_XINPUT)
187                 add_definitions(-DWITH_X11_XINPUT)
188         endif()
189
190         list(APPEND INC_SYS
191                 ${X11_X11_INCLUDE_PATH}
192         )
193
194         list(APPEND SRC
195                 intern/GHOST_DisplayManagerX11.cpp
196                 intern/GHOST_SystemX11.cpp
197                 intern/GHOST_SystemPathsX11.cpp
198                 intern/GHOST_WindowX11.cpp
199
200                 intern/GHOST_DisplayManagerX11.h
201                 intern/GHOST_SystemX11.h
202                 intern/GHOST_SystemPathsX11.h
203                 intern/GHOST_WindowX11.h
204         )
205
206         if(NOT WITH_INSTALL_PORTABLE)
207                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
208         endif()
209
210         if(X11_XF86keysym_INCLUDE_PATH)
211                 add_definitions(-DWITH_XF86KEYSYM)
212                 list(APPEND INC_SYS
213                         ${X11_XF86keysym_INCLUDE_PATH}
214                 )
215         endif()
216
217 elseif(WIN32)
218         if(MSVC)
219                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
220         endif()
221
222         list(APPEND INC_SYS
223                 ${WINTAB_INC}
224         )
225
226         list(APPEND SRC
227                 intern/GHOST_DisplayManagerWin32.cpp
228                 intern/GHOST_SystemWin32.cpp
229                 intern/GHOST_SystemPathsWin32.cpp
230                 intern/GHOST_WindowWin32.cpp
231                 intern/GHOST_DropTargetWin32.cpp
232
233                 intern/GHOST_DisplayManagerWin32.h
234                 intern/GHOST_DropTargetWin32.h
235                 intern/GHOST_SystemWin32.h
236                 intern/GHOST_SystemPathsWin32.h
237                 intern/GHOST_WindowWin32.h
238                 intern/GHOST_TaskbarWin32.h
239         )
240 endif()
241
242 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}")
243