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