Reversing the last merge because I botched it.
[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., 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 #-----------------------------------------------------------------------------
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.6)
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 # Note! - Could create this from the blender version string
55 # ...but thats quite involved, make sure this matches the blender version.
56 SET(BLENDER_VERSION  2.5)
57
58 #-----------------------------------------------------------------------------
59 # Set default config options
60 OPTION(WITH_PLAYER        "Build Player" OFF)
61 OPTION(WITH_GAMEENGINE    "Enable Game Engine" ON)
62 OPTION(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
63 OPTION(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
64 OPTION(WITH_ELBEEM        "Enable Elbeem (Fluid Simulation)" ON)
65 OPTION(WITH_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
66 OPTION(WITH_TIFF          "Enable LibTIFF Support" ON)
67 OPTION(WITH_DDS           "Enable DDS Support" ON)
68 OPTION(WITH_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
69 OPTION(WITH_PYTHON        "Enable Embedded Python API" ON)
70 OPTION(WITH_SDL           "Enable SDL for sound and joystick support" ON)
71 OPTION(WITH_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
72 OPTION(WITH_OPENAL        "Enable OpenAL Support (http://www.openal.org)" ON)
73 OPTION(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
74 OPTION(WITH_FFTW3         "Enable FFTW3 support" OFF)
75 OPTION(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
76 OPTION(WITH_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
77 OPTION(WITH_LZO           "Enable fast LZO compression, used for pointcache" ON)
78 OPTION(WITH_LZMA          "Enable best LZMA compression, used for pointcache" ON)
79 OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
80 OPTION(WITH_BUILDINFO     "Include extra build details" ON)
81 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
82 OPTION(WITH_RAYOPTIMIZATION     "Enable use of SIMD (SSE) optimizations for the raytracer" OFF) 
83
84 IF(APPLE OR WIN32)
85         OPTION(WITH_QUICKTIME     "Enable Quicktime Support" OFF)
86 ENDIF(APPLE OR WIN32)
87
88 # Unix defaults to OpenMP On
89 # Disable opencollada on non-apple unix because opencollada has no package for debian
90 IF(UNIX AND NOT APPLE)
91         OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" ON)
92         OPTION(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org/)"      OFF)
93 ELSE()
94         OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
95         OPTION(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org/)"      OFF)
96 ENDIF()
97
98 IF (APPLE)
99         OPTION(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
100         OPTION(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
101         OPTION(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
102 ENDIF (APPLE)
103
104 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
105         MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
106 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
107
108 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
109 # On Unix: 
110 #   cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
111 # On Macs: 
112 #   cmake -D PYTHON_INC=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config -G Xcode ../blender
113 #
114 # When changing any of this remember to update the notes in doc/blender-cmake.txt
115
116 #-----------------------------------------------------------------------------
117 # Load some macros.
118 INCLUDE(CMake/macros.cmake)
119
120 #-----------------------------------------------------------------------------
121 #Platform specifics
122
123 IF(UNIX AND NOT APPLE)
124
125
126         IF(WITH_OPENAL)
127                 FIND_PACKAGE(OpenAL)
128                 IF(NOT OPENAL_FOUND)
129                         SET(WITH_OPENAL OFF)
130                 ENDIF(NOT OPENAL_FOUND)
131         ENDIF(WITH_OPENAL)
132
133         IF(WITH_JACK)
134                 SET(JACK /usr)
135                 SET(JACK_INC ${JACK}/include/jack)
136                 SET(JACK_LIB jack)
137                 SET(JACK_LIBPATH ${JACK}/lib)
138         ENDIF(WITH_JACK)
139
140         IF(WITH_SNDFILE)
141         SET(SNDFILE /usr)
142         SET(SNDFILE_INC ${SNDFILE}/include)
143         SET(SNDFILE_LIB sndfile)
144         SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
145         ENDIF(WITH_SNDFILE)
146
147         FIND_LIBRARY(INTL_LIBRARY
148                 NAMES intl
149                 PATHS
150                 /sw/lib
151         )
152         FIND_LIBRARY(ICONV_LIBRARY
153                 NAMES iconv
154                 PATHS
155                 /sw/lib
156         )
157   
158         IF(INTL_LIBRARY AND ICONV_LIBRARY)
159                 SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
160         ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
161
162         FIND_PACKAGE(Freetype)
163         # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
164
165         # No way to set py31. remove for now.
166         # FIND_PACKAGE(PythonLibs)
167         SET(PYTHON /usr)
168         SET(PYTHON_VERSION 3.1)
169         SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
170         # SET(PYTHON_BINARY python) # not used yet
171         SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "")
172         SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "")
173   
174         # FIND_PACKAGE(PythonInterp) # not used yet
175         # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
176   
177         SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
178
179         IF(WITH_SDL)
180                 FIND_PACKAGE(SDL)
181                 # UNSET(SDLMAIN_LIBRARY CACHE)
182                 IF(NOT SDL_FOUND)
183                         SET(WITH_SDL OFF)
184                 ENDIF(NOT SDL_FOUND)
185         ENDIF(WITH_SDL)
186
187         SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
188         FIND_PATH(OPENEXR_INC
189                 ImfXdr.h
190                 PATHS
191                 ${OPENEXR}/include/OpenEXR
192                 /usr/local/include/OpenEXR
193                 /sw/include/OpenEXR
194                 /opt/local/include/OpenEXR
195                 /opt/csw/include/OpenEXR
196                 /opt/include/OpenEXR
197         )
198         SET(OPENEXR_LIB Half IlmImf Iex Imath)
199
200         SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
201         SET(FFMPEG_INC ${FFMPEG}/include)
202         SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
203         SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
204   
205         IF(WITH_FFTW3)
206                 SET(FFTW3 /usr)
207                 SET(FFTW3_INC ${FFTW3}/include)
208                 SET(FFTW3_LIB fftw3)
209                 SET(FFTW3_LIBPATH ${FFTW3}/lib)
210         ENDIF(WITH_FFTW3)
211
212         SET(LIBSAMPLERATE /usr)
213         SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
214         SET(LIBSAMPLERATE_LIB samplerate)
215         SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
216
217         IF(WITH_TIFF)
218                 FIND_PACKAGE(TIFF)
219                 IF(NOT TIFF_FOUND)
220                         SET(WITH_TIFF OFF)
221                 ENDIF(NOT TIFF_FOUND)
222         ENDIF(WITH_TIFF)
223
224         FIND_PACKAGE(JPEG REQUIRED)
225
226         FIND_PACKAGE(PNG REQUIRED)
227
228         FIND_PACKAGE(ZLIB REQUIRED)
229
230         IF (WITH_OPENCOLLADA)
231                 SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
232                 SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
233                 SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer)
234                 SET(OPENCOLLADA_INC ${OPENCOLLADA})
235                 SET(PCRE /usr CACHE FILEPATH "PCRE Directory")
236                 SET(PCRE_LIBPATH ${PCRE}/lib)
237                 SET(PCRE_LIB pcre)
238                 SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
239                 SET(EXPAT_LIBPATH ${EXPAT}/lib)
240                 SET(EXPAT_LIB expat)
241         ENDIF (WITH_OPENCOLLADA)
242
243
244         # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too
245         SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11")
246
247         IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
248                 # BSD's dont use libdl.so
249                 SET(LLIBS "${LLIBS} -ldl")
250         ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
251
252         IF(WITH_OPENMP)
253                 SET(LLIBS "${LLIBS} -lgomp")
254                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
255                 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
256         ENDIF(WITH_OPENMP)
257
258
259         SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-char-subscripts")
260
261         SET(PLATFORM_LINKFLAGS "-pthread")
262
263         # Better warnings
264         SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
265         SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
266
267         INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
268 ENDIF(UNIX AND NOT APPLE)
269
270 IF(WIN32)
271
272         # this file is included anyway when building under Windows with cl.exe
273         #  INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
274   
275         SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
276
277         # Setup 64bit and 64bit windows systems
278         IF(CMAKE_CL_64)
279                 message("64 bit compiler detected.")
280                 SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
281         ENDIF(CMAKE_CL_64)
282
283         SET(PYTHON ${LIBDIR}/python)
284         SET(PYTHON_VERSION 3.1)
285         SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
286         # SET(PYTHON_BINARY python) # not used yet
287         SET(PYTHON_LIB python31)
288         SET(PYTHON_LIBPATH ${PYTHON}/lib)
289
290         IF(WITH_OPENAL)
291                 SET(OPENAL ${LIBDIR}/openal)
292                 SET(OPENAL_INCLUDE_DIR ${OPENAL}/include)
293                 SET(OPENAL_LIBRARY wrap_oal)
294                 SET(OPENAL_LIBPATH ${OPENAL}/lib)
295         ENDIF(WITH_OPENAL)
296
297         IF(WITH_SNDFILE)
298                 SET(SNDFILE ${LIBDIR}/sndfile)
299                 SET(SNDFILE_INC ${SNDFILE}/include)
300                 SET(SNDFILE_LIB libsndfile-1)
301                 SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
302         ENDIF(WITH_SNDFILE)
303   
304         SET(ICONV ${LIBDIR}/iconv)
305         SET(ICONV_INC ${ICONV}/include)
306         SET(ICONV_LIB iconv)
307         SET(ICONV_LIBPATH ${ICONV}/lib)
308
309         SET(QUICKTIME ${LIBDIR}/QTDevWin)
310         SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
311         SET(QUICKTIME_LIB qtmlClient)
312         SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
313
314         SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
315         SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
316         SET(LIBSAMPLERATE_LIB libsamplerate)
317         SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
318
319         SET(SDL ${LIBDIR}/sdl)
320         SET(SDL_INCLUDE_DIR ${SDL}/include)
321         SET(SDL_LIBRARY SDL)
322         SET(SDL_LIBPATH ${SDL}/lib)
323
324         SET(PNG "${LIBDIR}/png")
325         SET(PNG_INC "${PNG}/include")
326         SET(PNG_LIBPATH ${PNG}/lib)
327
328         SET(JPEG "${LIBDIR}/jpeg")
329         SET(JPEG_INC "${JPEG}/include")
330         SET(JPEG_LIBPATH ${JPEG}/lib)
331
332         SET(WINTAB_INC ${LIBDIR}/wintab/include) 
333
334         IF(MSVC)
335                 IF(CMAKE_CL_64)
336                         SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
337                 ELSE(CMAKE_CL_64)
338                         SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
339                 ENDIF(CMAKE_CL_64)
340                 
341                 SET(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
342                 SET(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305" CACHE STRING "MSVC MT C++ flags " FORCE)
343
344                 SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
345                 SET(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
346                 SET(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
347                 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
348                 SET(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
349                 SET(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
350                 SET(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
351                 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
352
353                 ADD_DEFINITIONS(-DWIN32)
354                 
355                 IF(WITH_OPENMP)
356                         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
357                         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
358                 ENDIF(WITH_OPENMP)
359                 
360                 SET(GETTEXT ${LIBDIR}/gettext)
361                 SET(GETTEXT_INC ${GETTEXT}/include)
362                 SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
363                 IF(CMAKE_CL_64)
364                         SET(GETTEXT_LIB gettext)
365                 ELSE(CMAKE_CL_64)
366                         SET(GETTEXT_LIB gnu_gettext)
367                 ENDIF(CMAKE_CL_64)
368
369                 IF(CMAKE_CL_64)
370                         SET(PNG_LIBRARIES libpng)
371                 ELSE(CMAKE_CL_64)
372                         SET(PNG_LIBRARIES libpng_st)
373                 ENDIF(CMAKE_CL_64)
374                 SET(JPEG_LIBRARY libjpeg)
375
376                 SET(ZLIB ${LIBDIR}/zlib)
377                 SET(ZLIB_INC ${ZLIB}/include)
378                 SET(ZLIB_LIBPATH ${ZLIB}/lib)
379                 IF(CMAKE_CL_64)
380                         SET(ZLIB_LIBRARIES libz)
381                 ELSE(CMAKE_CL_64)
382                         SET(ZLIB_LIBRARIES zlib)
383                 ENDIF(CMAKE_CL_64)
384
385                 SET(PTHREADS ${LIBDIR}/pthreads)
386                 SET(PTHREADS_INC ${PTHREADS}/include)
387                 SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
388                 SET(PTHREADS_LIB pthreadVC2)
389                 
390                 SET(FREETYPE ${LIBDIR}/freetype)
391                 SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
392                 SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
393                 SET(FREETYPE_LIBRARY freetype2ST)
394
395                 IF(WITH_FFTW3)
396                         SET(FFTW3 ${LIBDIR}/fftw3)
397                         SET(FFTW3_LIB libfftw)
398                         SET(FFTW3_INC ${FFTW3}/include)
399                         SET(FFTW3_LIBPATH ${FFTW3}/lib)
400                 ENDIF(WITH_FFTW3)
401
402                 IF(WITH_OPENCOLLADA)
403                         SET(OPENCOLLADA ${LIBDIR}/opencollada)
404                         SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
405                         SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
406                         SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
407                         #pcre is bundled with openCollada
408                         #SET(PCRE ${LIBDIR}/pcre)
409                         #SET(PCRE_LIBPATH ${PCRE}/lib)
410                         SET(PCRE_LIB pcre)
411                 ENDIF(WITH_OPENCOLLADA)
412                 
413                 IF(WITH_FFMPEG)
414                         SET(FFMPEG ${LIBDIR}/ffmpeg)
415                         SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
416                         SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0)
417                         SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
418                 ENDIF(WITH_FFMPEG)
419
420                 IF(WITH_OPENEXR)
421                         SET(OPENEXR ${LIBDIR}/openexr)
422                         SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
423                         SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
424                         IF (MSVC80)
425                                 SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
426                         ELSE (MSVC80)
427                                 SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
428                         ENDIF(MSVC80)
429                         IF (MSVC90)
430                                 SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
431                         ENDIF(MSVC90)
432                 ENDIF(WITH_OPENEXR)
433
434                 IF(WITH_TIFF)
435                         SET(TIFF ${LIBDIR}/tiff)
436                         SET(TIFF_LIBRARY libtiff)
437                         SET(TIFF_INCLUDE_DIR ${TIFF}/include)
438                         SET(TIFF_LIBPATH ${TIFF}/lib)
439                 ENDIF(WITH_TIFF)
440
441                 IF(WITH_JACK)
442                         SET(JACK ${LIBDIR}/jack)
443                         SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
444                         SET(JACK_LIB libjack)
445                         SET(JACK_LIBPATH ${JACK}/lib)
446                 ENDIF(WITH_JACK)
447
448                 # MSVC only, Mingw doesnt need
449                 IF(CMAKE_CL_64)
450                         SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
451                 ELSE(CMAKE_CL_64)
452                         SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
453                 ENDIF(CMAKE_CL_64)
454           
455                 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
456
457         ELSE(MSVC) # MINGW
458                 SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
459
460                 SET(CMAKE_CXX_FLAGS                "-pipe -funsigned-char -fno-strict-aliasing -mwindows" CACHE STRING "Mingw C++ flags " FORCE)
461                 SET(CMAKE_C_FLAGS                  "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C flags " FORCE)
462
463                 SET(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g" CACHE STRING "Mingw debug C++ flags " FORCE)
464                 SET(CMAKE_CXX_FLAGS_RELEASE        "   -O2" CACHE STRING "Mingw release C++ flags " FORCE)
465                 SET(CMAKE_CXX_FLAGS_MINSIZEREL     "   -Os" CACHE STRING "Mingw minsize release C++ flags " FORCE)
466                 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Mingw release, debug C++ flags " FORCE)
467
468                 SET(CMAKE_C_FLAGS_DEBUG            "-O0 -g" CACHE STRING "Mingw debug C flags " FORCE)
469                 SET(CMAKE_C_FLAGS_RELEASE          "-O2"    CACHE STRING "Mingw release C flags " FORCE)
470                 SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os"    CACHE STRING "Mingw minsize release C flags " FORCE)
471                 SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g" CACHE STRING "Mingw release, debug C++ flags " FORCE)
472                 ADD_DEFINITIONS(-DFREE_WINDOWS -DWIN32)
473                 
474                 IF(WITH_OPENMP)
475                         SET(LLIBS "${LLIBS} -lgomp")
476                         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
477                         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
478                 ENDIF(WITH_OPENMP)
479
480                 SET(GETTEXT ${LIBDIR}/gcc/gettext)
481                 SET(GETTEXT_INC ${GETTEXT}/include)
482                 SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
483                 SET(GETTEXT_LIB intl)
484
485                 SET(JPEG_LIBRARY jpeg)
486                 SET(PNG_LIBRARIES png)
487
488                 SET(ZLIB ${LIBDIR}/zlib)
489                 SET(ZLIB_INC ${ZLIB}/include)
490                 SET(ZLIB_LIBPATH ${ZLIB}/lib)
491                 SET(ZLIB_LIBRARIES z)
492
493                 SET(PTHREADS ${LIBDIR}/pthreads)
494                 SET(PTHREADS_INC ${PTHREADS}/include)
495                 SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
496                 SET(PTHREADS_LIB pthreadGC2)
497                 
498                 SET(FREETYPE ${LIBDIR}/gcc/freetype)
499                 SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
500                 SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
501                 SET(FREETYPE_LIBRARY freetype)
502
503                 IF(WITH_FFTW3)
504                         SET(FFTW3 ${LIBDIR}/gcc/fftw3)
505                         SET(FFTW3_LIB fftw3)
506                         SET(FFTW3_INC ${FFTW3}/include)
507                         SET(FFTW3_LIBPATH ${FFTW3}/lib)
508                 ENDIF(WITH_FFTW3)
509
510                 IF(WITH_OPENCOLLADA)
511                         SET(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
512                         SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
513                         SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
514                         SET(OPENCOLLADA_LIB OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
515                         #pcre is bundled with openCollada
516                         #SET(PCRE ${LIBDIR}/pcre)
517                         #SET(PCRE_LIBPATH ${PCRE}/lib)
518                         SET(PCRE_LIB pcre)
519                 ENDIF(WITH_OPENCOLLADA)
520                 
521                 IF(WITH_FFMPEG)
522                         # TODO
523                         SET(WITH_FFMPEG OFF)
524                 ENDIF(WITH_FFMPEG)
525
526                 IF(WITH_OPENEXR)
527                         SET(OPENEXR ${LIBDIR}/gcc/openexr)
528                         SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
529                         SET(OPENEXR_LIB Half IlmImf Iex)
530                         SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
531                 ENDIF(WITH_OPENEXR)
532
533                 IF(WITH_TIFF)
534                         SET(TIFF ${LIBDIR}/gcc/tiff)
535                         SET(TIFF_LIBRARY tiff)
536                         SET(TIFF_INCLUDE_DIR ${TIFF}/include)
537                         SET(TIFF_LIBPATH ${TIFF}/lib)
538                 ENDIF(WITH_TIFF)
539
540                 IF(WITH_JACK)
541                         SET(JACK ${LIBDIR}/jack)
542                         SET(JACK_INC ${JACK}/include/jack ${JACK}/include)
543                         SET(JACK_LIB jack)
544                         SET(JACK_LIBPATH ${JACK}/lib)
545                         
546                         # TODO, gives linking errors, force off
547                         SET(WITH_JACK OFF)
548                 ENDIF(WITH_JACK)
549
550         ENDIF(MSVC)
551
552 ENDIF(WIN32)
553
554 IF(APPLE)
555         IF(WITH_LIBS10.5)
556                 SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
557         ELSE(WITH_LIBS10.5)
558                 IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
559                         SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
560                 ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
561                         SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
562                 ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
563         ENDIF(WITH_LIBS10.5)
564         
565
566         IF(WITH_OPENAL)
567                 FIND_PACKAGE(OpenAL)
568                 IF(OPENAL_FOUND)
569                         SET(WITH_OPENAL ON)
570                         SET(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
571                 ELSE(OPENAL_FOUND)
572                         SET(WITH_OPENAL OFF)
573                 ENDIF(OPENAL_FOUND)
574         ENDIF(WITH_OPENAL)
575
576         IF(WITH_JACK)
577                 SET(JACK /usr)
578                 SET(JACK_INC ${JACK}/include/jack)
579                 SET(JACK_LIB jack)
580                 SET(JACK_LIBPATH ${JACK}/lib)
581         ENDIF(WITH_JACK)
582
583         IF(WITH_SNDFILE)
584                 SET(SNDFILE ${LIBDIR}/sndfile)
585                 SET(SNDFILE_INC ${SNDFILE}/include)
586                 SET(SNDFILE_LIB sndfile FLAC ogg vorbis vorbisenc)
587                 SET(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)
588         ENDIF(WITH_SNDFILE)
589
590         SET(PYTHON_VERSION 3.1)
591
592         IF(PYTHON_VERSION MATCHES 3.1)
593                 # we use precompiled libraries for py 3.1 and up by default
594
595                 SET(PYTHON ${LIBDIR}/python)
596                 SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
597                 # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
598                 SET(PYTHON_LIB python${PYTHON_VERSION})
599                 SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
600                 # SET(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
601         ELSE(PYTHON_VERSION MATCHES 3.1)
602                 # otherwise, use custom system framework
603
604                 SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
605                 SET(PYTHON_VERSION 3.1)
606                 SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}")
607                 # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION}) # not used yet
608                 SET(PYTHON_LIB "")
609                 SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config)
610                 SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
611         ENDIF(PYTHON_VERSION MATCHES 3.1)
612
613         SET(GETTEXT ${LIBDIR}/gettext)
614         SET(GETTEXT_INC "${GETTEXT}/include")
615         SET(GETTEXT_LIB intl iconv)
616         SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
617   
618         IF(WITH_FFTW3)
619                 SET(FFTW3 ${LIBDIR}/fftw3)
620                 SET(FFTW3_INC ${FFTW3}/include)
621                 SET(FFTW3_LIB fftw3)
622                 SET(FFTW3_LIBPATH ${FFTW3}/lib)
623         ENDIF(WITH_FFTW3)
624
625         SET(PNG_LIBRARIES png)
626         SET(JPEG_LIBRARY jpeg)
627
628         SET(ZLIB /usr)
629         SET(ZLIB_INC "${ZLIB}/include")
630         SET(ZLIB_LIBRARIES z bz2)
631
632         SET(FREETYPE ${LIBDIR}/freetype)
633         SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
634         SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
635         SET(FREETYPE_LIBRARY freetype)
636
637         SET(OPENEXR ${LIBDIR}/openexr)
638         SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
639         SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
640         SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
641
642         SET(FFMPEG ${LIBDIR}/ffmpeg)
643         SET(FFMPEG_INC ${FFMPEG}/include)
644         SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
645         SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
646
647         SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
648         SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
649         SET(LIBSAMPLERATE_LIB samplerate)
650         SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
651
652         SET(LLIBS stdc++ SystemStubs)
653
654         IF (WITH_COCOA)
655                 SET(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
656                 SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
657                 IF(USE_QTKIT)
658                         SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
659                         SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
660                         IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
661                                 SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
662                                 #libSDL still needs 32bit carbon quicktime 
663                         ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
664                 ELSEIF(WITH_QUICKTIME)
665                         SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
666                 ENDIF(USE_QTKIT)
667         ELSE (WITH_COCOA)
668                 SET(PLATFORM_CFLAGS "-pipe -funsigned-char")
669                 SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
670         ENDIF (WITH_COCOA)
671
672         IF(WITH_OPENMP)
673                 SET(LLIBS "${LLIBS} -lgomp")
674                 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
675                 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
676         ENDIF(WITH_OPENMP)
677
678         IF (WITH_OPENCOLLADA)
679                 SET(OPENCOLLADA ${LIBDIR}/opencollada)
680                 SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
681                 SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
682                 SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
683                 #pcre is bundled with openCollada
684                 #SET(PCRE ${LIBDIR}/pcre)
685                 #SET(PCRE_LIBPATH ${PCRE}/lib)
686                 SET(PCRE_LIB pcre)
687                 #libxml2 is used
688                 #SET(EXPAT ${LIBDIR}/expat)
689                 #SET(EXPAT_LIBPATH ${EXPAT}/lib)
690                 SET(EXPAT_LIB)
691         ENDIF (WITH_OPENCOLLADA)
692
693         SET(SDL ${LIBDIR}/sdl)
694         SET(SDL_INCLUDE_DIR ${SDL}/include)
695         SET(SDL_LIBRARY SDL)
696         SET(SDL_LIBPATH ${SDL}/lib)
697
698         SET(PNG "${LIBDIR}/png")
699         SET(PNG_INC "${PNG}/include")
700         SET(PNG_LIBPATH ${PNG}/lib)
701
702         SET(JPEG "${LIBDIR}/jpeg")
703         SET(JPEG_INC "${JPEG}/include")
704         SET(JPEG_LIBPATH ${JPEG}/lib)
705
706         SET(TIFF ${LIBDIR}/tiff)
707         SET(TIFF_INCLUDE_DIR ${TIFF}/include)
708         SET(TIFF_LIBRARY tiff)
709         SET(TIFF_LIBPATH ${TIFF}/lib)
710
711         SET(EXETYPE MACOSX_BUNDLE)
712
713         SET(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
714         SET(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
715         IF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
716                 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
717                 SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
718         ELSEIF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
719                 SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
720                 SET(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
721         ELSE(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
722                 SET(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
723                 SET(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
724         ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
725
726         # Better warnings
727         SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
728         SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
729
730 ENDIF(APPLE)
731
732 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
733         SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
734         SET(BINRELOC_INC ${BINRELOC}/include)
735 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
736
737
738 # buildinfo
739 IF(WITH_BUILDINFO)
740         # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
741         IF(UNIX)
742                 EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
743                 EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
744                 EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
745                 IF(BUILD_REV_RETURN)
746                         SET(BUILD_REV "unknown")
747                 ENDIF(BUILD_REV_RETURN)
748         ENDIF(UNIX)
749         
750         IF(WIN32)
751                 EXEC_PROGRAM("cmd /c date /t" OUTPUT_VARIABLE BUILD_DATE)
752                 EXEC_PROGRAM("cmd /c time /t" OUTPUT_VARIABLE BUILD_TIME)  
753                 EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
754                 IF(BUILD_REV_RETURN)
755                         SET(BUILD_REV "unknown")
756                 ENDIF(BUILD_REV_RETURN)
757         ENDIF(WIN32)
758 ENDIF(WITH_BUILDINFO)
759         
760 #-----------------------------------------------------------------------------
761 # Common.
762
763 set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
764 set(OPENJPEG_INC ${OPENJPEG})
765 set(OPENJPEG_LIb extern_libopenjpeg)
766
767 #-----------------------------------------------------------------------------
768 # Blender WebPlugin
769
770 IF(WITH_WEBPLUGIN) 
771         SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
772         SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
773
774         SET(WITH_PLAYER ON)
775 ENDIF(WITH_WEBPLUGIN)
776
777
778 #-----------------------------------------------------------------------------
779 # Configure OpenGL.
780 FIND_PACKAGE(OpenGL)
781 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
782 # UNSET(OPENGL_LIBRARIES CACHE) # not compat with older cmake 
783 # UNSET(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake 
784
785 #-----------------------------------------------------------------------------
786 # Extra compile flags
787 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
788 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
789
790 # better not define flags here but this is a debugging option thats off by default.
791 IF(WITH_CXX_GUARDEDALLOC)
792         SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}")
793 ENDIF(WITH_CXX_GUARDEDALLOC)
794
795 #-----------------------------------------------------------------------------
796 # Libraries
797 FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
798 ADD_SUBDIRECTORY(intern)
799 ADD_SUBDIRECTORY(extern)
800 ADD_SUBDIRECTORY(source)
801
802
803 #-----------------------------------------------------------------------------
804 # Blender Application
805 ADD_SUBDIRECTORY(source/creator)
806
807
808 #-----------------------------------------------------------------------------
809 # Blender Player
810 IF(WITH_PLAYER)
811         ADD_SUBDIRECTORY(source/blenderplayer)
812 ENDIF(WITH_PLAYER)