Merged 15170:15635 from trunk (no conflicts or even merges)
[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_FFMPEG              "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
65 OPTION(WITH_OPENAL              "Enable OpenAL Support (http://www.openal.org)"         ON)
66 OPTION(YESIAMSTUPID             "Enable execution on 64-bit platforms"                  OFF)
67 OPTION(WITH_OPENMP              "Enable OpenMP (has to be supported by the compiler)"   OFF)
68
69 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
70   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
71 ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
72
73 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
74 # On Unix: 
75 #   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
76 # On Macs: 
77 #   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
78 #
79 # When changing any of this remember to update the notes in doc/blender-cmake.txt
80
81 #-----------------------------------------------------------------------------
82 # Load some macros.
83 INCLUDE(CMake/macros.cmake)
84
85 #-----------------------------------------------------------------------------
86 #Platform specifics
87
88 IF(UNIX)
89   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
90   IF(OPENAL_FOUND)
91     SET(WITH_OPENAL ON)
92     SET(OPENAL_LIB ${OPENAL_LIBRARY})
93     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
94   ELSE(OPENAL_FOUND)
95     SET(WITH_OPENAL OFF)
96   ENDIF(OPENAL_FOUND)
97
98   FIND_LIBRARY(ALUT_LIBRARY
99     NAMES alut
100     PATHS
101     /usr/local/lib
102     /usr/lib
103     /sw/lib
104     /opt/local/lib
105     /opt/csw/lib
106     /opt/lib
107   )
108   IF(ALUT_LIBRARY)
109     SET(OPENAL_LIB ${OPENAL_LIB} ${ALUT_LIBRARY})
110   ENDIF(ALUT_LIBRARY)
111
112   FIND_LIBRARY(INTL_LIBRARY
113     NAMES intl
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   FIND_LIBRARY(ICONV_LIBRARY
123     NAMES iconv
124     PATHS
125     /usr/local/lib
126     /usr/lib
127     /sw/lib
128     /opt/local/lib
129     /opt/csw/lib
130     /opt/lib
131   )
132   IF(INTL_LIBRARY AND ICONV_LIBRARY)
133     SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
134   ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
135   
136   FIND_PATH(FREETYPE_INC
137     freetype
138     PATHS
139     /usr/local/include/freetype2
140     /usr/include/freetype2
141     /sw/include/freetype2
142     /opt/local/include/freetype2
143     /opt/csw/include/freetype2
144     /opt/include/freetype2
145     NO_DEFAULT_PATH
146   )
147   SET(FREETYPE_LIB freetype)
148
149   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonLibs.cmake)
150   SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "")
151   SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "")
152   INCLUDE(${CMAKE_ROOT}/Modules/FindPythonInterp.cmake)
153   SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
154   SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
155
156   INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
157   SET(SDL_INC ${SDL_INCLUDE_DIR})
158   SET(SDL_LIB ${SDL_LIBRARY})
159
160   FIND_PATH(OPENEXR_INC
161     ImfXdr.h
162     PATHS
163     /usr/local/include/OpenEXR
164     /usr/include/OpenEXR
165     /sw/include/OpenEXR
166     /opt/local/include/OpenEXR
167     /opt/csw/include/OpenEXR
168     /opt/include/OpenEXR
169   )
170   SET(OPENEXR_LIB Half IlmImf Iex Imath)
171
172   SET(FFMPEG /usr)
173   SET(FFMPEG_INC ${FFMPEG}/include)
174   SET(FFMPEG_LIB avformat avcodec avutil)
175   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
176
177   SET(JPEG_LIB jpeg)
178
179   SET(PNG_LIB png)
180
181   SET(ZLIB_LIB z)
182
183   SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++")
184
185   IF(WITH_OPENMP)
186     SET(LLIBS "${LLIBS} -lgomp ")
187     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
188     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
189   ENDIF(WITH_OPENMP)
190
191
192   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts")
193
194   SET(PLATFORM_LINKFLAGS "-pthread")
195
196   INCLUDE_DIRECTORIES(/usr/include /usr/local/include)
197 ENDIF(UNIX)
198
199 IF(WIN32)
200
201   INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
202   
203   SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
204
205   # Setup 64bit and 64bit windows systems
206   IF(CMAKE_CL_64)
207     message("64 bit compiler detected.")
208     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
209   ENDIF(CMAKE_CL_64)
210
211   SET(PYTHON ${LIBDIR}/python)
212   SET(PYTHON_VERSION 2.5)
213   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
214   SET(PYTHON_BINARY python)
215   SET(PYTHON_LIB python25)
216   SET(PYTHON_LIBPATH ${PYTHON}/lib)
217
218   #SET(WITH_OPENAL ON)
219   SET(OPENAL ${LIBDIR}/openal)
220   SET(OPENAL_INC ${OPENAL}/include ${OPENAL}/include/AL)
221   SET(OPENAL_LIB openal_static)
222   SET(OPENAL_LIBPATH ${OPENAL}/lib)
223
224   IF(CMAKE_CL_64)
225         SET(PNG_LIB libpng)
226   ELSE(CMAKE_CL_64)
227         SET(PNG_LIB libpng_st)
228   ENDIF(CMAKE_CL_64)
229   SET(JPEG_LIB libjpeg)
230
231   SET(ZLIB ${LIBDIR}/zlib)
232   SET(ZLIB_INC ${ZLIB}/include)
233   IF(CMAKE_CL_64)
234         SET(ZLIB_LIB zlib)
235   ELSE(CMAKE_CL_64)
236         SET(ZLIB_LIB libz)
237   ENDIF(CMAKE_CL_64)
238   SET(ZLIB_LIBPATH ${ZLIB}/lib)
239   
240   SET(PTHREADS ${LIBDIR}/pthreads)
241   SET(PTHREADS_INC ${PTHREADS}/include)
242   SET(PTHREADS_LIB pthreadVC2)
243   SET(PTHREADS_LIBPATH ${PTHREADS}/lib)
244   
245   SET(ICONV ${LIBDIR}/iconv)
246   SET(ICONV_INC ${ICONV}/include)
247   SET(ICONV_LIB iconv)
248   SET(ICONV_LIBPATH ${ICONV}/lib)
249   
250   SET(GETTEXT ${LIBDIR}/gettext)
251   SET(GETTEXT_INC ${GETTEXT}/include)
252   SET(GETTEXT_LIB gnu_gettext)
253   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
254
255   SET(FREETYPE ${LIBDIR}/freetype)
256   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
257   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
258   SET(FREETYPE_LIB freetype2ST)
259   
260   SET(OPENEXR ${LIBDIR}/openexr)
261   SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath)
262   SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
263   IF (MSVC80)
264   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005)
265   ELSE (MSVC80)
266   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc)
267   ENDIF(MSVC80)
268   IF (MSVC90)
269   SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008)
270   ENDIF(MSVC90)
271
272   
273   SET(QUICKTIME ${LIBDIR}/QTDevWin)
274   SET(QUICKTIME_INC ${QUICKTIME}/CIncludes)
275   SET(QUICKTIME_LIB qtmlClient)
276   SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
277
278   SET(FFMPEG ${LIBDIR}/ffmpeg)
279   SET(FFMPEG_INC ${FFMPEG}/include)
280   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
281   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
282
283   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
284   IF(WITH_OPENAL)
285     SET(LLIBS ${LLIBS} dxguid)
286   ENDIF(WITH_OPENAL)
287
288   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)
289   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)
290   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)
291   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)
292   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)
293   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)
294   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)
295   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)
296
297   IF(WITH_OPENMP)
298     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ")
299     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
300   ENDIF(WITH_OPENMP)
301
302   SET(SDL ${LIBDIR}/sdl)
303   SET(SDL_INC ${SDL}/include)
304   SET(SDL_LIB SDL)
305   SET(SDL_LIBPATH ${SDL}/lib)
306
307   SET(PNG "${LIBDIR}/png")
308   SET(PNG_INC "${PNG}/include")
309   SET(PNG_LIBPATH ${PNG}/lib)
310
311   SET(JPEG "${LIBDIR}/jpeg")
312   SET(JPEG_INC "${JPEG}/include")
313   SET(JPEG_LIBPATH ${JPEG}/lib)
314
315   SET(TIFF ${LIBDIR}/tiff)
316   SET(TIFF_INC ${TIFF}/include)
317   
318   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
319
320   IF(CMAKE_CL_64)
321   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ")
322   ELSE(CMAKE_CL_64)
323   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
324   ENDIF(CMAKE_CL_64)
325   SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
326 ENDIF(WIN32)
327
328 IF(APPLE)
329   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
330     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
331   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
332     SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc)
333   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
334
335   INCLUDE(${CMAKE_ROOT}/Modules/FindOpenAL.cmake)
336   IF(OPENAL_FOUND)
337     SET(WITH_OPENAL ON)
338     SET(OPENAL_LIB ${OPENAL_LIBRARY})
339     SET(OPENAL_INC ${OPENAL_INCLUDE_DIR})
340   ELSE(OPENAL_FOUND)
341     SET(WITH_OPENAL OFF)
342   ENDIF(OPENAL_FOUND)
343
344   SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/)
345   SET(PYTHON_VERSION 2.3)
346   SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "")
347   SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "")
348   SET(PYTHON_LIB "")
349   SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "")
350   SET(PYTHON_LINKFLAGS "-u __dummy -u _PyMac_Error -framework System -framework Python")
351
352   SET(GETTEXT ${LIBDIR}/gettext)
353   SET(GETTEXT_INC "${GETTEXT}/include")
354   SET(GETTEXT_LIB intl iconv)
355   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
356
357   SET(PNG_LIB png)
358   SET(JPEG_LIB jpeg)
359
360   SET(ZLIB /usr)
361   SET(ZLIB_INC "${ZLIB}/include")
362   SET(ZLIB_LIB z)
363
364   SET(FREETYPE ${LIBDIR}/freetype)
365   SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2)
366   SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
367   SET(FREETYPE_LIB freetype)
368
369   SET(OPENEXR ${LIBDIR}/openexr)
370   SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
371   IF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
372     SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
373   ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
374     SET(OPENEXR_LIB Iex Half IlmImf Imath)
375   ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
376   SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
377
378   SET(LLIBS stdc++ SystemStubs)
379
380   SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
381   SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
382
383   IF(WITH_OPENMP)
384     SET(LLIBS "${LLIBS} -lgomp ")
385     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
386     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
387   ENDIF(WITH_OPENMP)
388
389   SET(SDL ${LIBDIR}/sdl)
390   SET(SDL_INC ${SDL}/include)
391   SET(SDL_LIB SDL)
392   SET(SDL_LIBPATH ${SDL}/lib)
393
394   SET(PNG "${LIBDIR}/png")
395   SET(PNG_INC "${PNG}/include")
396   SET(PNG_LIBPATH ${PNG}/lib)
397
398   SET(JPEG "${LIBDIR}/jpeg")
399   SET(JPEG_INC "${JPEG}/include")
400   SET(JPEG_LIBPATH ${JPEG}/lib)
401
402   SET(TIFF ${LIBDIR}/tiff)
403   SET(TIFF_INC ${TIFF}/include)
404
405   SET(EXETYPE MACOSX_BUNDLE)
406 ENDIF(APPLE)
407
408 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
409   SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
410   SET(BINRELOC_INC ${BINRELOC}/include)
411 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
412
413 #-----------------------------------------------------------------------------
414 # Common.
415 SET(VERSE_INC ${CMAKE_SOURCE_DIR}/extern/verse/dist)
416
417 SET(FTGL ${CMAKE_SOURCE_DIR}/extern/bFTGL)
418 SET(FTGL_INC ${FTGL}/include)
419 SET(FTGL_LIB extern_ftgl)
420
421
422 #-----------------------------------------------------------------------------
423 # Configure OpenGL.
424 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
425 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
426 #-----------------------------------------------------------------------------
427 # Extra compile flags
428 IF(WITH_GAMEENGINE)
429   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
430 ENDIF(WITH_GAMEENGINE)
431 IF(WITH_BULLET)
432   SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
433 ENDIF(WITH_BULLET)
434 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ")
435 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
436
437 #-----------------------------------------------------------------------------
438 # Libraries
439 FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "")
440 SUBDIRS(
441   intern
442   extern
443   source
444 )
445
446
447 #-----------------------------------------------------------------------------
448 # Blender Application
449 SUBDIRS(source/creator)
450
451 #-----------------------------------------------------------------------------
452 # Blender Player
453 IF(WITH_PLAYER)
454   SUBDIRS(blenderplayer)
455 ENDIF(WITH_PLAYER)