Noticed that sculpt was quite slow because of string lookups in RNA, so added a separ...
[blender.git] / 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 #-----------------------------------------------------------------------------
28 # We don't allow in-source builds. This causes no end of troubles because 
29 # all out-of-source builds will use the CMakeCache.txt file there and even 
30 # build the libs and objects in it. It will also conflict with the current 
31 # Makefile system for Blender
32
33 IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
34 MESSAGE(FATAL_ERROR "CMake generation for blender is not allowed within the source directory! 
35 Remove the CMakeCache.txt file and try again from another folder, e.g.: 
36
37    rm CMakeCache.txt 
38    cd ..
39    mkdir cmake-make 
40    cd cmake-make
41    cmake -G \"Unix Makefiles\" ../blender
42 ")
43 ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
44
45 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
46 PROJECT(Blender)
47
48 #-----------------------------------------------------------------------------
49 # Redirect output files
50
51 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
52 SET(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib)
53
54 #-----------------------------------------------------------------------------
55 # Set default config options
56 OPTION(WITH_PLAYER              "Build Player"                                          OFF)
57 OPTION(WITH_GAMEENGINE          "Enable Game Engine"                                    ON)
58 OPTION(WITH_BULLET              "Enable Bullet (Physics Engine)"                        ON)
59 OPTION(WITH_INTERNATIONAL       "Enable I18N   (International fonts and text)"          ON)
60 OPTION(WITH_ELBEEM              "Enable Elbeem (Fluid Simulation)"                      ON)
61 OPTION(WITH_QUICKTIME           "Enable Quicktime Support"                              OFF)
62 OPTION(WITH_OPENEXR             "Enable OpenEXR Support (http://www.openexr.com)"       ON)
63 OPTION(WITH_DDS                 "Enable DDS Support"                                    ON)
64 OPTION(WITH_FFMPEG              "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
65 OPTION(WITH_PYTHON              "Enable Embedded Python API"                            ON)
66 OPTION(WITH_OPENAL              "Enable OpenAL Support (http://www.openal.org)"         ON)
67 OPTION(WITH_OPENMP              "Enable OpenMP (has to be supported by the compiler)"   OFF)
68 OPTION(WITH_WEBPLUGIN           "Enable Web Plugin (Unix only)"                         OFF)
69
70 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
71   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
72 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
73
74 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
75 # On Unix: 
76 #   cmake -D PYTHON_LIB=/usr/local/lib/python2.3/config/libpython2.3.so -D PYTHON_INC=/usr/local/include/python2.3 -D PYTHON_BINARY=/usr/local/bin/python2.3 -G "Unix Makefiles" ../blender
77 # On Macs: 
78 #   cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config -D PYTHON_BINARY=/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 -G Xcode ../blender
79 #
80 # When changing any of this remember to update the notes in doc/blender-cmake.txt
81
82 #-----------------------------------------------------------------------------
83 # Load some macros.
84 INCLUDE(CMake/macros.cmake)
85
86 #-----------------------------------------------------------------------------
87 #Platform specifics
88
89 IF(UNIX)
90   IF(WITH_OPENAL)
91     INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
92     IF(OPENAL_FOUND)
93       SET(WITH_OPENAL ON)
94       SET(OPENAL_LIB ${OPENAL_LIBRARY})
95       SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
96     ELSE(OPENAL_FOUND)
97       SET(WITH_OPENAL OFF)
98     ENDIF(OPENAL_FOUND)
99   ENDIF(WITH_OPENAL)
100
101   FIND_LIBRARY(ALUT_LIBRARY
102     NAMES alut
103     PATHS
104     /usr/local/lib
105     /usr/lib
106     /sw/lib
107     /opt/local/lib
108     /opt/csw/lib
109     /opt/lib
110   )
111   IF(ALUT_LIBRARY)
112     SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
113   ENDIF(ALUT_LIBRARY)
114
115   FIND_LIBRARY(INTL_LIBRARY
116     NAMES intl
117     PATHS
118     /usr/local/lib
119     /usr/lib
120     /sw/lib
121     /opt/local/lib
122     /opt/csw/lib
123     /opt/lib
124   )
125   FIND_LIBRARY(ICONV_LIBRARY
126     NAMES iconv
127     PATHS
128     /usr/local/lib
129     /usr/lib
130     /sw/lib
131     /opt/local/lib
132     /opt/csw/lib
133     /opt/lib
134   )
135   IF(INTL_LIBRARY AND ICONV_LIBRARY)
136     SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
137   ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
138   
139   FIND_PATH(FREETYPE_INC
140     freetype
141     PATHS
142     /usr/local/include/freetype2
143     /usr/include/freetype2
144     /sw/include/freetype2
145     /opt/local/include/freetype2
146     /opt/csw/include/freetype2
147     /opt/include/freetype2
148     NO_DEFAULT_PATH
149   )
150   SET(FREETYPE_LIB freetype)
151
152   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
153   SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
154   SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
155   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
156   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
157   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
158
159   INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
160   SET(SDL_INC ${SDL_INCLUDE_DIR})
161   SET(SDL_LIB ${SDL_LIBRARY})
162
163   FIND_PATH(OPENEXR_INC
164     ImfXdr.h
165     PATHS
166     /usr/local/include/OpenEXR
167     /usr/include/OpenEXR
168     /sw/include/OpenEXR
169     /opt/local/include/OpenEXR
170     /opt/csw/include/OpenEXR
171     /opt/include/OpenEXR
172   )
173   SET(OPENEXR_LIB Half IlmImf Iex Imath)
174
175   SET(FFMPEG /usr)
176   SET(FFMPEG_INC ${FFMPEG}/include)
177   SET(FFMPEG_LIB avformat avcodec avutil)
178   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
179
180   SET(JPEG_LIB jpeg)
181
182   SET(PNG_LIB png)
183
184   SET(ZLIB_LIB z)
185
186   SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl")
187
188   IF(WITH_OPENMP)
189     SET(LLIBS "${LLIBS} -lgomp")
190     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
191     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
192   ENDIF(WITH_OPENMP)
193
194
195   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
196
197   SET(PLATFORM_LINKFLAGS "-pthread")
198
199   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
200 ENDIF(UNIX)
201
202 IF(WIN32)
203
204   INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
205   
206   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
207
208   # Setup 64bit and 64bit windows systems
209   IF(CMAKE_CL_64)
210     message("64 bit compiler detected.")
211     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
212   ENDIF(CMAKE_CL_64)
213
214   SET(PYTHON ${LIBDIR}/python)
215   SET(PYTHON_VERSION 2.5)
216   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
217   SET(PYTHON_BINARY python)
218   SET(PYTHON_LIB python25)
219   SET(PYTHON_LIBPATH ${PYTHON}/lib)
220
221   #SET(WITH_OPENAL ON)
222   SET(OPENAL ${LIBDIR}/openal)
223   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
224   SET(OPENAL_LIB openal_static)
225   SET(OPENAL_LIBPATH ${OPENAL}/lib)
226
227   IF(CMAKE_CL_64)
228         SET(PNG_LIB libpng)
229   ELSE(CMAKE_CL_64)
230         SET(PNG_LIB libpng_st)
231   ENDIF(CMAKE_CL_64)
232   SET(JPEG_LIB libjpeg)
233
234   SET(ZLIB ${LIBDIR}/zlib)
235   SET(ZLIB_INC ${ZLIB}/include)
236   IF(CMAKE_CL_64)
237         SET(ZLIB_LIB zlib)
238   ELSE(CMAKE_CL_64)
239         SET(ZLIB_LIB libz)
240   ENDIF(CMAKE_CL_64)
241   SET(ZLIB_LIBPATH ${ZLIB}/lib)
242   
243   SET(PTHREADS ${LIBDIR}/pthreads)
244   SET(PTHREADS_INC ${PTHREADS}/include)
245   SET(PTHREADS_LIB pthreadVC2)
246   SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
247   
248   SET(ICONV ${LIBDIR}/iconv)
249   SET(ICONV_INC ${ICONV}/include)
250   SET(ICONV_LIB iconv)
251   SET(ICONV_LIBPATH ${ICONV}/lib)
252   
253   SET(GETTEXT ${LIBDIR}/gettext)
254   SET(GETTEXT_INC ${GETTEXT}/include)
255   IF(CMAKE_CL_64)
256         SET(GETTEXT_LIB gettextlib)
257   ELSE(CMAKE_CL_64)
258         SET(GETTEXT_LIB gnu_gettext)
259   ENDIF(CMAKE_CL_64)
260   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
261
262   SET(FREETYPE ${LIBDIR}/freetype)
263   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
264   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
265   SET(FREETYPE_LIB freetype2ST)
266   
267   SET(OPENEXR ${LIBDIR}/openexr)
268   SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
269   SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
270   IF (MSVC80)
271   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
272   ELSE (MSVC80)
273   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
274   ENDIF(MSVC80)
275   IF (MSVC90)
276   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
277   ENDIF(MSVC90)
278
279   
280   SET(QUICKTIME ${LIBDIR}/QTDevWin)
281   SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
282   SET(QUICKTIME_LIB qtmlClient)
283   SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
284
285   SET(FFMPEG ${LIBDIR}/ffmpeg)
286   SET(FFMPEG_INC ${FFMPEG}/include)
287   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
288   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
289
290   IF(CMAKE_CL_64)
291   SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
292   ELSE(CMAKE_CL_64)
293   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
294   ENDIF(CMAKE_CL_64)
295   
296   IF(WITH_OPENAL)
297     SET(LLIBS ${LLIBS} dxguid)
298   ENDIF(WITH_OPENAL)
299
300   SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
301   SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
302   SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
303   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
304   SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
305   SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
306   SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
307   SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
308
309   IF(WITH_OPENMP)
310     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
311     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
312   ENDIF(WITH_OPENMP)
313
314   SET(SDL ${LIBDIR}/sdl)
315   SET(SDL_INC ${SDL}/include)
316   SET(SDL_LIB SDL)
317   SET(SDL_LIBPATH ${SDL}/lib)
318
319   SET(PNG "${LIBDIR}/png")
320   SET(PNG_INC "${PNG}/include")
321   SET(PNG_LIBPATH ${PNG}/lib)
322
323   SET(JPEG "${LIBDIR}/jpeg")
324   SET(JPEG_INC "${JPEG}/include")
325   SET(JPEG_LIBPATH ${JPEG}/lib)
326
327   SET(TIFF ${LIBDIR}/tiff)
328   SET(TIFF_INC ${TIFF}/include)
329   
330   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
331
332   IF(CMAKE_CL_64)
333   SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
334   ELSE(CMAKE_CL_64)
335   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
336   ENDIF(CMAKE_CL_64)
337   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
338 ENDIF(WIN32)
339
340 IF(APPLE)
341   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
342     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
343   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
344     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
345   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
346
347   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
348   IF(OPENAL_FOUND)
349     SET(WITH_OPENAL ON)
350     SET(OPENAL_LIB ${OPENAL_LIBRARY})
351     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
352   ELSE(OPENAL_FOUND)
353     SET(WITH_OPENAL OFF)
354   ENDIF(OPENAL_FOUND)
355
356   SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
357   SET(PYTHON_VERSION 2.3)
358   SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
359   SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
360   SET(PYTHON_LIB "")
361   SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
362   SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
363
364   SET(GETTEXT ${LIBDIR}/gettext)
365   SET(GETTEXT_INC "${GETTEXT}/include")
366   SET(GETTEXT_LIB intl iconv)
367   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
368
369   SET(PNG_LIB png)
370   SET(JPEG_LIB jpeg)
371
372   SET(ZLIB /usr)
373   SET(ZLIB_INC "${ZLIB}/include")
374   SET(ZLIB_LIB z)
375
376   SET(FREETYPE ${LIBDIR}/freetype)
377   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
378   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
379   SET(FREETYPE_LIB freetype)
380
381   SET(OPENEXR ${LIBDIR}/openexr)
382   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
383   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
384     SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
385   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
386     SET(OPENEXR_LIB Iex Half IlmImf Imath)
387   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
388   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
389
390   SET(LLIBS stdc++ SystemStubs)
391
392   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
393   SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
394
395   IF(WITH_OPENMP)
396     SET(LLIBS "${LLIBS} -lgomp ")
397     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
398     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
399   ENDIF(WITH_OPENMP)
400
401   SET(SDL ${LIBDIR}/sdl)
402   SET(SDL_INC ${SDL}/include)
403   SET(SDL_LIB SDL)
404   SET(SDL_LIBPATH ${SDL}/lib)
405
406   SET(PNG "${LIBDIR}/png")
407   SET(PNG_INC "${PNG}/include")
408   SET(PNG_LIBPATH ${PNG}/lib)
409
410   SET(JPEG "${LIBDIR}/jpeg")
411   SET(JPEG_INC "${JPEG}/include")
412   SET(JPEG_LIBPATH ${JPEG}/lib)
413
414   SET(TIFF ${LIBDIR}/tiff)
415   SET(TIFF_INC ${TIFF}/include)
416
417   SET(EXETYPE MACOSX_BUNDLE)
418 ENDIF(APPLE)
419
420 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
421   SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
422   SET(BINRELOC_INC ${BINRELOC}/include)
423 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
424
425 #-----------------------------------------------------------------------------
426 # Common.
427
428 SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
429 SET(FTGL_INC ${FTGL}/include)
430 SET(FTGL_LIB extern_ftgl)
431
432
433 #-----------------------------------------------------------------------------
434 # Blender WebPlugin
435
436 IF(WITH_WEBPLUGIN) 
437   SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
438   SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
439
440   SET(WITH_PLAYER ON)
441 ENDIF(WITH_WEBPLUGIN)
442
443
444 #-----------------------------------------------------------------------------
445 # Configure OpenGL.
446 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
447 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
448 #-----------------------------------------------------------------------------
449 # Extra compile flags
450 IF(WITH_GAMEENGINE)
451   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
452 ENDIF(WITH_GAMEENGINE)
453 IF(WITH_BULLET)
454   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
455 ENDIF(WITH_BULLET)
456 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ")
457 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
458
459 #-----------------------------------------------------------------------------
460 # Libraries
461 FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
462 SUBDIRS(
463   intern
464   extern
465   source
466 )
467
468
469 #-----------------------------------------------------------------------------
470 # Blender Application
471 SUBDIRS(source/creator)
472
473
474 #-----------------------------------------------------------------------------
475 # Blender Player
476 IF(WITH_PLAYER)
477   SUBDIRS(blenderplayer)
478 ENDIF(WITH_PLAYER)