merge 17122:17206
[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_VERSE               "Enable Verse  (http://verse.blender.org)"              OFF)
61 OPTION(WITH_ELBEEM              "Enable Elbeem (Fluid Simulation)"                      ON)
62 OPTION(WITH_QUICKTIME           "Enable Quicktime Support"                              OFF)
63 OPTION(WITH_OPENEXR             "Enable OpenEXR Support (http://www.openexr.com)"       ON)
64 OPTION(WITH_DDS                 "Enable DDS Support"                                    ON)
65 OPTION(WITH_FFMPEG              "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
66 OPTION(WITH_FFMPEG              "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
67 OPTION(WITH_OPENAL              "Enable OpenAL Support (http://www.openal.org)"         ON)
68 OPTION(WITH_OPENMP              "Enable OpenMP (has to be supported by the compiler)"   OFF)
69 OPTION(WITH_WEBPLUGIN           "Enable Web Plugin (Unix only)"                         OFF)
70
71 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
72   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
73 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
74
75 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
76 # On Unix: 
77 #   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
78 # On Macs: 
79 #   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
80 #
81 # When changing any of this remember to update the notes in doc/blender-cmake.txt
82
83 #-----------------------------------------------------------------------------
84 # Load some macros.
85 INCLUDE(CMake/macros.cmake)
86
87 #-----------------------------------------------------------------------------
88 #Platform specifics
89
90 IF(UNIX)
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
100   FIND_LIBRARY(ALUT_LIBRARY
101     NAMES alut
102     PATHS
103     /usr/local/lib
104     /usr/lib
105     /sw/lib
106     /opt/local/lib
107     /opt/csw/lib
108     /opt/lib
109   )
110   IF(ALUT_LIBRARY)
111     SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
112   ENDIF(ALUT_LIBRARY)
113
114   FIND_LIBRARY(INTL_LIBRARY
115     NAMES intl
116     PATHS
117     /usr/local/lib
118     /usr/lib
119     /sw/lib
120     /opt/local/lib
121     /opt/csw/lib
122     /opt/lib
123   )
124   FIND_LIBRARY(ICONV_LIBRARY
125     NAMES iconv
126     PATHS
127     /usr/local/lib
128     /usr/lib
129     /sw/lib
130     /opt/local/lib
131     /opt/csw/lib
132     /opt/lib
133   )
134   IF(INTL_LIBRARY AND ICONV_LIBRARY)
135     SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
136   ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
137   
138   FIND_PATH(FREETYPE_INC
139     freetype
140     PATHS
141     /usr/local/include/freetype2
142     /usr/include/freetype2
143     /sw/include/freetype2
144     /opt/local/include/freetype2
145     /opt/csw/include/freetype2
146     /opt/include/freetype2
147     NO_DEFAULT_PATH
148   )
149   SET(FREETYPE_LIB freetype)
150
151   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
152   SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
153   SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
154   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
155   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
156   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
157
158   INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
159   SET(SDL_INC ${SDL_INCLUDE_DIR})
160   SET(SDL_LIB ${SDL_LIBRARY})
161
162   FIND_PATH(OPENEXR_INC
163     ImfXdr.h
164     PATHS
165     /usr/local/include/OpenEXR
166     /usr/include/OpenEXR
167     /sw/include/OpenEXR
168     /opt/local/include/OpenEXR
169     /opt/csw/include/OpenEXR
170     /opt/include/OpenEXR
171   )
172   SET(OPENEXR_LIB Half IlmImf Iex Imath)
173
174   SET(FFMPEG /usr)
175   SET(FFMPEG_INC ${FFMPEG}/include)
176   SET(FFMPEG_LIB avformat avcodec avutil)
177   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
178
179   SET(JPEG_LIB jpeg)
180
181   SET(PNG_LIB png)
182
183   SET(ZLIB_LIB z)
184
185   SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++")
186
187   IF(WITH_OPENMP)
188     SET(LLIBS "${LLIBS} -lgomp")
189     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
190     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
191   ENDIF(WITH_OPENMP)
192
193
194   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
195
196   SET(PLATFORM_LINKFLAGS "-pthread")
197
198   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
199 ENDIF(UNIX)
200
201 IF(WIN32)
202
203   INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
204   
205   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
206
207   # Setup 64bit and 64bit windows systems
208   IF(CMAKE_CL_64)
209     message("64 bit compiler detected.")
210     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
211   ENDIF(CMAKE_CL_64)
212
213   SET(PYTHON ${LIBDIR}/python)
214   SET(PYTHON_VERSION 2.5)
215   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
216   SET(PYTHON_BINARY python)
217   SET(PYTHON_LIB python25)
218   SET(PYTHON_LIBPATH ${PYTHON}/lib)
219
220   #SET(WITH_OPENAL ON)
221   SET(OPENAL ${LIBDIR}/openal)
222   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
223   SET(OPENAL_LIB openal_static)
224   SET(OPENAL_LIBPATH ${OPENAL}/lib)
225
226   IF(CMAKE_CL_64)
227         SET(PNG_LIB libpng)
228   ELSE(CMAKE_CL_64)
229         SET(PNG_LIB libpng_st)
230   ENDIF(CMAKE_CL_64)
231   SET(JPEG_LIB libjpeg)
232
233   SET(ZLIB ${LIBDIR}/zlib)
234   SET(ZLIB_INC ${ZLIB}/include)
235   IF(CMAKE_CL_64)
236         SET(ZLIB_LIB zlib)
237   ELSE(CMAKE_CL_64)
238         SET(ZLIB_LIB libz)
239   ENDIF(CMAKE_CL_64)
240   SET(ZLIB_LIBPATH ${ZLIB}/lib)
241   
242   SET(PTHREADS ${LIBDIR}/pthreads)
243   SET(PTHREADS_INC ${PTHREADS}/include)
244   SET(PTHREADS_LIB pthreadVC2)
245   SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
246   
247   SET(ICONV ${LIBDIR}/iconv)
248   SET(ICONV_INC ${ICONV}/include)
249   SET(ICONV_LIB iconv)
250   SET(ICONV_LIBPATH ${ICONV}/lib)
251   
252   SET(GETTEXT ${LIBDIR}/gettext)
253   SET(GETTEXT_INC ${GETTEXT}/include)
254   IF(CMAKE_CL_64)
255         SET(GETTEXT_LIB gettextlib)
256   ELSE(CMAKE_CL_64)
257         SET(GETTEXT_LIB gnu_gettext)
258   ENDIF(CMAKE_CL_64)
259   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
260
261   SET(FREETYPE ${LIBDIR}/freetype)
262   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
263   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
264   SET(FREETYPE_LIB freetype2ST)
265   
266   SET(OPENEXR ${LIBDIR}/openexr)
267   SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
268   SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
269   IF (MSVC80)
270   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
271   ELSE (MSVC80)
272   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
273   ENDIF(MSVC80)
274   IF (MSVC90)
275   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
276   ENDIF(MSVC90)
277
278   
279   SET(QUICKTIME ${LIBDIR}/QTDevWin)
280   SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
281   SET(QUICKTIME_LIB qtmlClient)
282   SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
283
284   SET(FFMPEG ${LIBDIR}/ffmpeg)
285   SET(FFMPEG_INC ${FFMPEG}/include)
286   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
287   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
288
289   IF(CMAKE_CL_64)
290   SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
291   ELSE(CMAKE_CL_64)
292   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
293   ENDIF(CMAKE_CL_64)
294   
295   IF(WITH_OPENAL)
296     SET(LLIBS ${LLIBS} dxguid)
297   ENDIF(WITH_OPENAL)
298
299   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)
300   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)
301   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)
302   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)
303   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)
304   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)
305   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)
306   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)
307
308   IF(WITH_OPENMP)
309     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
310     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
311   ENDIF(WITH_OPENMP)
312
313   SET(SDL ${LIBDIR}/sdl)
314   SET(SDL_INC ${SDL}/include)
315   SET(SDL_LIB SDL)
316   SET(SDL_LIBPATH ${SDL}/lib)
317
318   SET(PNG "${LIBDIR}/png")
319   SET(PNG_INC "${PNG}/include")
320   SET(PNG_LIBPATH ${PNG}/lib)
321
322   SET(JPEG "${LIBDIR}/jpeg")
323   SET(JPEG_INC "${JPEG}/include")
324   SET(JPEG_LIBPATH ${JPEG}/lib)
325
326   SET(TIFF ${LIBDIR}/tiff)
327   SET(TIFF_INC ${TIFF}/include)
328   
329   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
330
331   IF(CMAKE_CL_64)
332   SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
333   ELSE(CMAKE_CL_64)
334   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
335   ENDIF(CMAKE_CL_64)
336   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
337 ENDIF(WIN32)
338
339 IF(APPLE)
340   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
341     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
342   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
343     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
344   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
345
346   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
347   IF(OPENAL_FOUND)
348     SET(WITH_OPENAL ON)
349     SET(OPENAL_LIB ${OPENAL_LIBRARY})
350     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
351   ELSE(OPENAL_FOUND)
352     SET(WITH_OPENAL OFF)
353   ENDIF(OPENAL_FOUND)
354
355   SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
356   SET(PYTHON_VERSION 2.3)
357   SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
358   SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
359   SET(PYTHON_LIB "")
360   SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
361   SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
362
363   SET(GETTEXT ${LIBDIR}/gettext)
364   SET(GETTEXT_INC "${GETTEXT}/include")
365   SET(GETTEXT_LIB intl iconv)
366   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
367
368   SET(PNG_LIB png)
369   SET(JPEG_LIB jpeg)
370
371   SET(ZLIB /usr)
372   SET(ZLIB_INC "${ZLIB}/include")
373   SET(ZLIB_LIB z)
374
375   SET(FREETYPE ${LIBDIR}/freetype)
376   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
377   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
378   SET(FREETYPE_LIB freetype)
379
380   SET(OPENEXR ${LIBDIR}/openexr)
381   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
382   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
383     SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
384   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
385     SET(OPENEXR_LIB Iex Half IlmImf Imath)
386   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
387   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
388
389   SET(LLIBS stdc++ SystemStubs)
390
391   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
392   SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
393
394   IF(WITH_OPENMP)
395     SET(LLIBS "${LLIBS} -lgomp ")
396     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
397     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
398   ENDIF(WITH_OPENMP)
399
400   SET(SDL ${LIBDIR}/sdl)
401   SET(SDL_INC ${SDL}/include)
402   SET(SDL_LIB SDL)
403   SET(SDL_LIBPATH ${SDL}/lib)
404
405   SET(PNG "${LIBDIR}/png")
406   SET(PNG_INC "${PNG}/include")
407   SET(PNG_LIBPATH ${PNG}/lib)
408
409   SET(JPEG "${LIBDIR}/jpeg")
410   SET(JPEG_INC "${JPEG}/include")
411   SET(JPEG_LIBPATH ${JPEG}/lib)
412
413   SET(TIFF ${LIBDIR}/tiff)
414   SET(TIFF_INC ${TIFF}/include)
415
416   SET(EXETYPE MACOSX_BUNDLE)
417 ENDIF(APPLE)
418
419 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
420   SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
421   SET(BINRELOC_INC ${BINRELOC}/include)
422 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
423
424 #-----------------------------------------------------------------------------
425 # Common.
426 SET(VERSE_INC ${CMAKE_SOURCE_DIR}/extern/verse/dist)
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)