Added new CMake build option, WITH_YAFRAY. Set to disabled by default.
[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 OPTION(WITH_YAFRAY              "Enable Yafray (Renderer)"                              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   IF(WITH_OPENAL)
92     INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
93     IF(OPENAL_FOUND)
94       SET(WITH_OPENAL ON)
95       SET(OPENAL_LIB ${OPENAL_LIBRARY})
96       SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
97     ELSE(OPENAL_FOUND)
98       SET(WITH_OPENAL OFF)
99     ENDIF(OPENAL_FOUND)
100   ENDIF(WITH_OPENAL)
101
102   FIND_LIBRARY(ALUT_LIBRARY
103     NAMES alut
104     PATHS
105     /usr/local/lib
106     /usr/lib
107     /sw/lib
108     /opt/local/lib
109     /opt/csw/lib
110     /opt/lib
111   )
112   IF(ALUT_LIBRARY)
113     SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
114   ENDIF(ALUT_LIBRARY)
115
116   FIND_LIBRARY(INTL_LIBRARY
117     NAMES intl
118     PATHS
119     /usr/local/lib
120     /usr/lib
121     /sw/lib
122     /opt/local/lib
123     /opt/csw/lib
124     /opt/lib
125   )
126   FIND_LIBRARY(ICONV_LIBRARY
127     NAMES iconv
128     PATHS
129     /usr/local/lib
130     /usr/lib
131     /sw/lib
132     /opt/local/lib
133     /opt/csw/lib
134     /opt/lib
135   )
136   IF(INTL_LIBRARY AND ICONV_LIBRARY)
137     SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
138   ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
139   
140   FIND_PATH(FREETYPE_INC
141     freetype
142     PATHS
143     /usr/local/include/freetype2
144     /usr/include/freetype2
145     /sw/include/freetype2
146     /opt/local/include/freetype2
147     /opt/csw/include/freetype2
148     /opt/include/freetype2
149     NO_DEFAULT_PATH
150   )
151   SET(FREETYPE_LIB freetype)
152
153   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
154   SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
155   SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
156   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
157   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
158   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
159
160   INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
161   SET(SDL_INC ${SDL_INCLUDE_DIR})
162   SET(SDL_LIB ${SDL_LIBRARY})
163
164   FIND_PATH(OPENEXR_INC
165     ImfXdr.h
166     PATHS
167     /usr/local/include/OpenEXR
168     /usr/include/OpenEXR
169     /sw/include/OpenEXR
170     /opt/local/include/OpenEXR
171     /opt/csw/include/OpenEXR
172     /opt/include/OpenEXR
173   )
174   SET(OPENEXR_LIB Half IlmImf Iex Imath)
175
176   SET(FFMPEG /usr)
177   SET(FFMPEG_INC ${FFMPEG}/include)
178   SET(FFMPEG_LIB avformat avcodec avutil)
179   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
180
181   SET(JPEG_LIB jpeg)
182
183   SET(PNG_LIB png)
184
185   SET(ZLIB_LIB z)
186
187   SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl")
188
189   IF(WITH_OPENMP)
190     SET(LLIBS "${LLIBS} -lgomp")
191     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
192     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
193   ENDIF(WITH_OPENMP)
194
195
196   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
197
198   SET(PLATFORM_LINKFLAGS "-pthread")
199
200   # Better warnings
201   SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Waggregate-return -Wnested-externs -Wdeclaration-after-statement")
202
203   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
204 ENDIF(UNIX)
205
206 IF(WIN32)
207
208   INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
209   
210   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
211
212   # Setup 64bit and 64bit windows systems
213   IF(CMAKE_CL_64)
214     message("64 bit compiler detected.")
215     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
216   ENDIF(CMAKE_CL_64)
217
218   SET(PYTHON ${LIBDIR}/python)
219   SET(PYTHON_VERSION 2.5)
220   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
221   SET(PYTHON_BINARY python)
222   SET(PYTHON_LIB python25)
223   SET(PYTHON_LIBPATH ${PYTHON}/lib)
224
225   #SET(WITH_OPENAL ON)
226   SET(OPENAL ${LIBDIR}/openal)
227   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
228   SET(OPENAL_LIB openal_static)
229   SET(OPENAL_LIBPATH ${OPENAL}/lib)
230
231   IF(CMAKE_CL_64)
232         SET(PNG_LIB libpng)
233   ELSE(CMAKE_CL_64)
234         SET(PNG_LIB libpng_st)
235   ENDIF(CMAKE_CL_64)
236   SET(JPEG_LIB libjpeg)
237
238   SET(ZLIB ${LIBDIR}/zlib)
239   SET(ZLIB_INC ${ZLIB}/include)
240   IF(CMAKE_CL_64)
241         SET(ZLIB_LIB zlib)
242   ELSE(CMAKE_CL_64)
243         SET(ZLIB_LIB libz)
244   ENDIF(CMAKE_CL_64)
245   SET(ZLIB_LIBPATH ${ZLIB}/lib)
246   
247   SET(PTHREADS ${LIBDIR}/pthreads)
248   SET(PTHREADS_INC ${PTHREADS}/include)
249   SET(PTHREADS_LIB pthreadVC2)
250   SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
251   
252   SET(ICONV ${LIBDIR}/iconv)
253   SET(ICONV_INC ${ICONV}/include)
254   SET(ICONV_LIB iconv)
255   SET(ICONV_LIBPATH ${ICONV}/lib)
256   
257   SET(GETTEXT ${LIBDIR}/gettext)
258   SET(GETTEXT_INC ${GETTEXT}/include)
259   IF(CMAKE_CL_64)
260         SET(GETTEXT_LIB gettextlib)
261   ELSE(CMAKE_CL_64)
262         SET(GETTEXT_LIB gnu_gettext)
263   ENDIF(CMAKE_CL_64)
264   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
265
266   SET(FREETYPE ${LIBDIR}/freetype)
267   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
268   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
269   SET(FREETYPE_LIB freetype2ST)
270   
271   SET(OPENEXR ${LIBDIR}/openexr)
272   SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
273   SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
274   IF (MSVC80)
275   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
276   ELSE (MSVC80)
277   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
278   ENDIF(MSVC80)
279   IF (MSVC90)
280   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
281   ENDIF(MSVC90)
282
283   
284   SET(QUICKTIME ${LIBDIR}/QTDevWin)
285   SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
286   SET(QUICKTIME_LIB qtmlClient)
287   SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
288
289   SET(FFMPEG ${LIBDIR}/ffmpeg)
290   SET(FFMPEG_INC ${FFMPEG}/include)
291   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
292   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
293
294   IF(CMAKE_CL_64)
295   SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
296   ELSE(CMAKE_CL_64)
297   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
298   ENDIF(CMAKE_CL_64)
299   
300   IF(WITH_OPENAL)
301     SET(LLIBS ${LLIBS} dxguid)
302   ENDIF(WITH_OPENAL)
303
304   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)
305   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)
306   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)
307   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)
308   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)
309   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)
310   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)
311   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)
312
313   IF(WITH_OPENMP)
314     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
315     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
316   ENDIF(WITH_OPENMP)
317
318   SET(SDL ${LIBDIR}/sdl)
319   SET(SDL_INC ${SDL}/include)
320   SET(SDL_LIB SDL)
321   SET(SDL_LIBPATH ${SDL}/lib)
322
323   SET(PNG "${LIBDIR}/png")
324   SET(PNG_INC "${PNG}/include")
325   SET(PNG_LIBPATH ${PNG}/lib)
326
327   SET(JPEG "${LIBDIR}/jpeg")
328   SET(JPEG_INC "${JPEG}/include")
329   SET(JPEG_LIBPATH ${JPEG}/lib)
330
331   SET(TIFF ${LIBDIR}/tiff)
332   SET(TIFF_INC ${TIFF}/include)
333   
334   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
335
336   IF(CMAKE_CL_64)
337   SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
338   ELSE(CMAKE_CL_64)
339   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
340   ENDIF(CMAKE_CL_64)
341   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
342 ENDIF(WIN32)
343
344 IF(APPLE)
345   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
346     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
347   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
348     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
349   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
350
351   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
352   IF(OPENAL_FOUND)
353     SET(WITH_OPENAL ON)
354     SET(OPENAL_LIB ${OPENAL_LIBRARY})
355     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
356   ELSE(OPENAL_FOUND)
357     SET(WITH_OPENAL OFF)
358   ENDIF(OPENAL_FOUND)
359
360   SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
361   SET(PYTHON_VERSION 2.3)
362   SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
363   SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
364   SET(PYTHON_LIB "")
365   SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
366   SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
367
368   SET(GETTEXT ${LIBDIR}/gettext)
369   SET(GETTEXT_INC "${GETTEXT}/include")
370   SET(GETTEXT_LIB intl iconv)
371   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
372
373   SET(PNG_LIB png)
374   SET(JPEG_LIB jpeg)
375
376   SET(ZLIB /usr)
377   SET(ZLIB_INC "${ZLIB}/include")
378   SET(ZLIB_LIB z)
379
380   SET(FREETYPE ${LIBDIR}/freetype)
381   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
382   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
383   SET(FREETYPE_LIB freetype)
384
385   SET(OPENEXR ${LIBDIR}/openexr)
386   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
387   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
388     SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
389   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
390     SET(OPENEXR_LIB Iex Half IlmImf Imath)
391   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
392   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
393
394   SET(LLIBS stdc++ SystemStubs)
395
396   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
397   SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
398
399   IF(WITH_OPENMP)
400     SET(LLIBS "${LLIBS} -lgomp ")
401     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
402     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
403   ENDIF(WITH_OPENMP)
404
405   SET(SDL ${LIBDIR}/sdl)
406   SET(SDL_INC ${SDL}/include)
407   SET(SDL_LIB SDL)
408   SET(SDL_LIBPATH ${SDL}/lib)
409
410   SET(PNG "${LIBDIR}/png")
411   SET(PNG_INC "${PNG}/include")
412   SET(PNG_LIBPATH ${PNG}/lib)
413
414   SET(JPEG "${LIBDIR}/jpeg")
415   SET(JPEG_INC "${JPEG}/include")
416   SET(JPEG_LIBPATH ${JPEG}/lib)
417
418   SET(TIFF ${LIBDIR}/tiff)
419   SET(TIFF_INC ${TIFF}/include)
420
421   SET(EXETYPE MACOSX_BUNDLE)
422 ENDIF(APPLE)
423
424 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
425   SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
426   SET(BINRELOC_INC ${BINRELOC}/include)
427 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
428
429 #-----------------------------------------------------------------------------
430 # Common.
431
432 SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
433 SET(FTGL_INC ${FTGL}/include)
434 SET(FTGL_LIB extern_ftgl)
435
436
437 #-----------------------------------------------------------------------------
438 # Blender WebPlugin
439
440 IF(WITH_WEBPLUGIN) 
441   SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
442   SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
443
444   SET(WITH_PLAYER ON)
445 ENDIF(WITH_WEBPLUGIN)
446
447
448 #-----------------------------------------------------------------------------
449 # Configure OpenGL.
450 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
451 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
452 #-----------------------------------------------------------------------------
453 # Extra compile flags
454 IF(WITH_GAMEENGINE)
455   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
456 ENDIF(WITH_GAMEENGINE)
457 IF(WITH_BULLET)
458   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
459 ENDIF(WITH_BULLET)
460 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
461 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
462
463 #-----------------------------------------------------------------------------
464 # Libraries
465 FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
466 SUBDIRS(
467   intern
468   extern
469   source
470 )
471
472
473 #-----------------------------------------------------------------------------
474 # Blender Application
475 SUBDIRS(source/creator)
476
477
478 #-----------------------------------------------------------------------------
479 # Blender Player
480 IF(WITH_PLAYER)
481   SUBDIRS(blenderplayer)
482 ENDIF(WITH_PLAYER)