Merge of trunk into blender 2.5:
[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   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++")
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   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
201 ENDIF(UNIX)
202
203 IF(WIN32)
204
205   INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
206   
207   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
208
209   # Setup 64bit and 64bit windows systems
210   IF(CMAKE_CL_64)
211     message("64 bit compiler detected.")
212     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
213   ENDIF(CMAKE_CL_64)
214
215   SET(PYTHON ${LIBDIR}/python)
216   SET(PYTHON_VERSION 2.5)
217   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
218   SET(PYTHON_BINARY python)
219   SET(PYTHON_LIB python25)
220   SET(PYTHON_LIBPATH ${PYTHON}/lib)
221
222   #SET(WITH_OPENAL ON)
223   SET(OPENAL ${LIBDIR}/openal)
224   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
225   SET(OPENAL_LIB openal_static)
226   SET(OPENAL_LIBPATH ${OPENAL}/lib)
227
228   IF(CMAKE_CL_64)
229         SET(PNG_LIB libpng)
230   ELSE(CMAKE_CL_64)
231         SET(PNG_LIB libpng_st)
232   ENDIF(CMAKE_CL_64)
233   SET(JPEG_LIB libjpeg)
234
235   SET(ZLIB ${LIBDIR}/zlib)
236   SET(ZLIB_INC ${ZLIB}/include)
237   IF(CMAKE_CL_64)
238         SET(ZLIB_LIB zlib)
239   ELSE(CMAKE_CL_64)
240         SET(ZLIB_LIB libz)
241   ENDIF(CMAKE_CL_64)
242   SET(ZLIB_LIBPATH ${ZLIB}/lib)
243   
244   SET(PTHREADS ${LIBDIR}/pthreads)
245   SET(PTHREADS_INC ${PTHREADS}/include)
246   SET(PTHREADS_LIB pthreadVC2)
247   SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
248   
249   SET(ICONV ${LIBDIR}/iconv)
250   SET(ICONV_INC ${ICONV}/include)
251   SET(ICONV_LIB iconv)
252   SET(ICONV_LIBPATH ${ICONV}/lib)
253   
254   SET(GETTEXT ${LIBDIR}/gettext)
255   SET(GETTEXT_INC ${GETTEXT}/include)
256   IF(CMAKE_CL_64)
257         SET(GETTEXT_LIB gettextlib)
258   ELSE(CMAKE_CL_64)
259         SET(GETTEXT_LIB gnu_gettext)
260   ENDIF(CMAKE_CL_64)
261   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
262
263   SET(FREETYPE ${LIBDIR}/freetype)
264   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
265   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
266   SET(FREETYPE_LIB freetype2ST)
267   
268   SET(OPENEXR ${LIBDIR}/openexr)
269   SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
270   SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
271   IF (MSVC80)
272   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
273   ELSE (MSVC80)
274   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
275   ENDIF(MSVC80)
276   IF (MSVC90)
277   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
278   ENDIF(MSVC90)
279
280   
281   SET(QUICKTIME ${LIBDIR}/QTDevWin)
282   SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
283   SET(QUICKTIME_LIB qtmlClient)
284   SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
285
286   SET(FFMPEG ${LIBDIR}/ffmpeg)
287   SET(FFMPEG_INC ${FFMPEG}/include)
288   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
289   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
290
291   IF(CMAKE_CL_64)
292   SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
293   ELSE(CMAKE_CL_64)
294   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
295   ENDIF(CMAKE_CL_64)
296   
297   IF(WITH_OPENAL)
298     SET(LLIBS ${LLIBS} dxguid)
299   ENDIF(WITH_OPENAL)
300
301   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)
302   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)
303   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)
304   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)
305   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)
306   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)
307   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)
308   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)
309
310   IF(WITH_OPENMP)
311     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
312     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
313   ENDIF(WITH_OPENMP)
314
315   SET(SDL ${LIBDIR}/sdl)
316   SET(SDL_INC ${SDL}/include)
317   SET(SDL_LIB SDL)
318   SET(SDL_LIBPATH ${SDL}/lib)
319
320   SET(PNG "${LIBDIR}/png")
321   SET(PNG_INC "${PNG}/include")
322   SET(PNG_LIBPATH ${PNG}/lib)
323
324   SET(JPEG "${LIBDIR}/jpeg")
325   SET(JPEG_INC "${JPEG}/include")
326   SET(JPEG_LIBPATH ${JPEG}/lib)
327
328   SET(TIFF ${LIBDIR}/tiff)
329   SET(TIFF_INC ${TIFF}/include)
330   
331   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
332
333   IF(CMAKE_CL_64)
334   SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
335   ELSE(CMAKE_CL_64)
336   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
337   ENDIF(CMAKE_CL_64)
338   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
339 ENDIF(WIN32)
340
341 IF(APPLE)
342   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
343     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
344   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
345     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
346   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
347
348   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
349   IF(OPENAL_FOUND)
350     SET(WITH_OPENAL ON)
351     SET(OPENAL_LIB ${OPENAL_LIBRARY})
352     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
353   ELSE(OPENAL_FOUND)
354     SET(WITH_OPENAL OFF)
355   ENDIF(OPENAL_FOUND)
356
357   SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
358   SET(PYTHON_VERSION 2.3)
359   SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
360   SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
361   SET(PYTHON_LIB "")
362   SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
363   SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
364
365   SET(GETTEXT ${LIBDIR}/gettext)
366   SET(GETTEXT_INC "${GETTEXT}/include")
367   SET(GETTEXT_LIB intl iconv)
368   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
369
370   SET(PNG_LIB png)
371   SET(JPEG_LIB jpeg)
372
373   SET(ZLIB /usr)
374   SET(ZLIB_INC "${ZLIB}/include")
375   SET(ZLIB_LIB z)
376
377   SET(FREETYPE ${LIBDIR}/freetype)
378   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
379   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
380   SET(FREETYPE_LIB freetype)
381
382   SET(OPENEXR ${LIBDIR}/openexr)
383   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
384   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
385     SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
386   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
387     SET(OPENEXR_LIB Iex Half IlmImf Imath)
388   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
389   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
390
391   SET(LLIBS stdc++ SystemStubs)
392
393   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
394   SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
395
396   IF(WITH_OPENMP)
397     SET(LLIBS "${LLIBS} -lgomp ")
398     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
399     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
400   ENDIF(WITH_OPENMP)
401
402   SET(SDL ${LIBDIR}/sdl)
403   SET(SDL_INC ${SDL}/include)
404   SET(SDL_LIB SDL)
405   SET(SDL_LIBPATH ${SDL}/lib)
406
407   SET(PNG "${LIBDIR}/png")
408   SET(PNG_INC "${PNG}/include")
409   SET(PNG_LIBPATH ${PNG}/lib)
410
411   SET(JPEG "${LIBDIR}/jpeg")
412   SET(JPEG_INC "${JPEG}/include")
413   SET(JPEG_LIBPATH ${JPEG}/lib)
414
415   SET(TIFF ${LIBDIR}/tiff)
416   SET(TIFF_INC ${TIFF}/include)
417
418   SET(EXETYPE MACOSX_BUNDLE)
419 ENDIF(APPLE)
420
421 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
422   SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
423   SET(BINRELOC_INC ${BINRELOC}/include)
424 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
425
426 #-----------------------------------------------------------------------------
427 # Common.
428 SET(VERSE_INC ${CMAKE_SOURCE_DIR}/extern/verse/dist)
429
430 SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
431 SET(FTGL_INC ${FTGL}/include)
432 SET(FTGL_LIB extern_ftgl)
433
434
435 #-----------------------------------------------------------------------------
436 # Blender WebPlugin
437
438 IF(WITH_WEBPLUGIN) 
439   SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
440   SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
441
442   SET(WITH_PLAYER ON)
443 ENDIF(WITH_WEBPLUGIN)
444
445
446 #-----------------------------------------------------------------------------
447 # Configure OpenGL.
448 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
449 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
450 #-----------------------------------------------------------------------------
451 # Extra compile flags
452 IF(WITH_GAMEENGINE)
453   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
454 ENDIF(WITH_GAMEENGINE)
455 IF(WITH_BULLET)
456   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
457 ENDIF(WITH_BULLET)
458 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ")
459 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
460
461 #-----------------------------------------------------------------------------
462 # Libraries
463 FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
464 SUBDIRS(
465   intern
466   extern
467   source
468 )
469
470
471 #-----------------------------------------------------------------------------
472 # Blender Application
473 SUBDIRS(source/creator)
474
475
476 #-----------------------------------------------------------------------------
477 # Blender Player
478 IF(WITH_PLAYER)
479   SUBDIRS(blenderplayer)
480 ENDIF(WITH_PLAYER)