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