dont return a system path if cmake's 'WITH_INSTALL_PORTABLE' is enabled. this way...
[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         ../../extern/glew/include
31         ../../source/blender/imbuf
32         ../../source/blender/makesdna
33 )
34
35 set(SRC
36         intern/GHOST_Buttons.cpp
37         intern/GHOST_CallbackEventConsumer.cpp
38         intern/GHOST_C-api.cpp
39         intern/GHOST_Path-api.cpp
40         intern/GHOST_DisplayManager.cpp
41         intern/GHOST_EventManager.cpp
42         intern/GHOST_EventPrinter.cpp
43         intern/GHOST_ISystem.cpp
44         intern/GHOST_ISystemPaths.cpp
45         intern/GHOST_ModifierKeys.cpp
46         intern/GHOST_NDOFManager.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         intern/GHOST_Buttons.h
65         intern/GHOST_CallbackEventConsumer.h
66         intern/GHOST_Debug.h
67         intern/GHOST_DisplayManager.h
68         intern/GHOST_Event.h
69         intern/GHOST_EventButton.h
70         intern/GHOST_EventCursor.h
71         intern/GHOST_EventDragnDrop.h
72         intern/GHOST_EventKey.h
73         intern/GHOST_EventManager.h
74         intern/GHOST_EventNDOF.h
75         intern/GHOST_EventPrinter.h
76         intern/GHOST_EventString.h
77         intern/GHOST_EventTrackpad.h
78         intern/GHOST_EventWheel.h
79         intern/GHOST_ModifierKeys.h
80         intern/GHOST_NDOFManager.h
81         intern/GHOST_System.h
82         intern/GHOST_SystemPaths.h
83         intern/GHOST_TimerManager.h
84         intern/GHOST_TimerTask.h
85         intern/GHOST_Window.h
86         intern/GHOST_WindowManager.h
87 )
88
89 if(APPLE)
90         if(WITH_COCOA)
91                 list(APPEND SRC
92                         intern/GHOST_DisplayManagerCocoa.mm
93                         intern/GHOST_SystemCocoa.mm
94                         intern/GHOST_SystemPathsCocoa.mm
95                         intern/GHOST_WindowCocoa.mm
96                         
97                         intern/GHOST_DisplayManagerCocoa.h
98                         intern/GHOST_SystemCocoa.h
99                         intern/GHOST_SystemPathsCocoa.h
100                         intern/GHOST_WindowCocoa.h
101                 )
102         else()
103                 list(APPEND SRC
104                         intern/GHOST_DisplayManagerCarbon.cpp
105                         intern/GHOST_SystemCarbon.cpp
106                         intern/GHOST_SystemPathsCarbon.cpp
107                         intern/GHOST_WindowCarbon.cpp
108
109                         intern/GHOST_DisplayManagerCarbon.h
110                         intern/GHOST_SystemCarbon.h
111                         intern/GHOST_SystemPathsCarbon.h
112                         intern/GHOST_WindowCarbon.h
113                 )
114         endif()
115
116         if(WITH_CODEC_QUICKTIME)
117                 add_definitions(-DWITH_QUICKTIME)
118         endif()
119
120 elseif(UNIX)
121
122         if(WITH_X11_XINPUT)
123                 add_definitions(-DWITH_X11_XINPUT)
124         endif()
125
126         list(APPEND INC ${X11_X11_INCLUDE_PATH})
127
128         list(APPEND SRC
129                 intern/GHOST_DisplayManagerX11.cpp
130                 intern/GHOST_SystemX11.cpp
131                 intern/GHOST_SystemPathsX11.cpp
132                 intern/GHOST_WindowX11.cpp
133
134                 intern/GHOST_DisplayManagerX11.h
135                 intern/GHOST_SystemX11.h
136                 intern/GHOST_SystemPathsX11.h
137                 intern/GHOST_WindowX11.h
138         )
139
140         if(NOT WITH_INSTALL_PORTABLE)
141                 add_definitions(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
142         endif()
143
144         if(X11_XF86keysym_INCLUDE_PATH)
145                 add_definitions(-DWITH_XF86KEYSYM)
146                 list(APPEND INC ${X11_XF86keysym_INCLUDE_PATH})
147         endif()
148
149 elseif(WIN32)
150         if(MSVC)
151                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
152         endif()
153
154         list(APPEND INC ${WINTAB_INC})
155
156         list(APPEND SRC
157                 intern/GHOST_DisplayManagerWin32.cpp
158                 intern/GHOST_SystemWin32.cpp
159                 intern/GHOST_SystemPathsWin32.cpp
160                 intern/GHOST_WindowWin32.cpp
161                 intern/GHOST_DropTargetWin32.cpp
162
163                 intern/GHOST_DisplayManagerWin32.h
164                 intern/GHOST_DropTargetWin32.h
165                 intern/GHOST_SystemWin32.h
166                 intern/GHOST_SystemPathsWin32.h
167                 intern/GHOST_WindowWin32.h
168                 intern/GHOST_TaskbarWin32.h
169         )
170 endif()
171
172 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}")
173