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