f421c2c9395d780bcbd94b4ba14c9308c42431b3
[blender.git] / CMakeLists.txt
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
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.
31
32 if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
33         if(NOT DEFINED WITH_IN_SOURCE_BUILD)
34                 message(FATAL_ERROR
35                         "CMake generation for blender is not allowed within the source directory!"
36                         "\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
37                         "\n "
38                         "\n rm CMakeCache.txt"
39                         "\n cd .."
40                         "\n mkdir cmake-make"
41                         "\n cd cmake-make"
42                         "\n cmake ../blender"
43                         "\n "
44                         "\n Alternately define WITH_IN_SOURCE_BUILD to force this option (not recommended!)"
45                 )
46         endif()
47 endif()
48
49 cmake_minimum_required(VERSION 2.8)
50
51 if(NOT EXECUTABLE_OUTPUT_PATH)
52         set(FIRST_RUN "TRUE")
53 endif()
54
55 # this starts out unset
56 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
57
58 # avoid having empty buildtype
59 set(CMAKE_BUILD_TYPE_INIT "Release")
60
61 # quiet output for Makefiles, 'make -s' helps too
62 # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
63
64 # global compile definitions since add_definitions() adds for all.
65 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG           DEBUG _DEBUG)
66 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE         NDEBUG)
67 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL      NDEBUG)
68 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO  NDEBUG)
69
70
71 #-----------------------------------------------------------------------------
72 # Set policy
73
74 # see "cmake --help-policy CMP0003"
75 # So library linking is more sane
76 cmake_policy(SET CMP0003 NEW)
77
78 # So BUILDINFO and BLENDERPATH strings are automatically quoted
79 cmake_policy(SET CMP0005 NEW)
80
81 # So syntax problems are errors
82 cmake_policy(SET CMP0010 NEW)
83
84 # Input directories must have CMakeLists.txt
85 cmake_policy(SET CMP0014 NEW)
86
87 #-----------------------------------------------------------------------------
88 # Load some macros.
89 include(build_files/cmake/macros.cmake)
90
91
92 #-----------------------------------------------------------------------------
93 # Initialize project.
94
95 blender_project_hack_pre()
96
97 project(Blender)
98
99 blender_project_hack_post()
100
101 enable_testing()
102
103 #-----------------------------------------------------------------------------
104 # Redirect output files
105
106 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE )
107 set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
108
109 #-----------------------------------------------------------------------------
110 # Set default config options
111
112 get_blender_version()
113
114
115 # Blender internal features
116 option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
117 mark_as_advanced(WITH_BLENDER)
118
119 option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
120
121 option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
122 option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default (recommend to leave off)" OFF)
123 mark_as_advanced(WITH_PYTHON)  # dont want people disabling this unless they really know what they are doing.
124 mark_as_advanced(WITH_PYTHON_SECURITY)  # some distrobutions see this as a security issue, rather than have them patch it, make a build option.
125
126 option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
127 option(WITH_PYTHON_MODULE "Enable building as a python module (experemental, only enable for development)" OFF)
128 option(WITH_BUILDINFO     "Include extra build details (only disable for development & faster builds)" ON)
129 option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
130 option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
131 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
132 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
133 option(WITH_PLAYER        "Build Player" OFF)
134
135 # GHOST Windowing Library Options
136 option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
137 mark_as_advanced(WITH_GHOST_DEBUG)
138
139 option(WITH_GHOST_SDL    "Enable building blender against SDL for windowing rather then the native APIs" OFF)
140 mark_as_advanced(WITH_GHOST_SDL)
141
142 # Misc...
143 option(WITH_HEADLESS      "Build without graphical support (renderfarm, server mode only)" OFF)
144 mark_as_advanced(WITH_HEADLESS)
145
146 option(WITH_AUDASPACE    "Build with blenders audio library (only disable if you know what you're doing!)" ON)
147 mark_as_advanced(WITH_AUDASPACE)
148
149
150 # (unix defaults to OpenMP On)
151 if(UNIX AND NOT APPLE)
152         option(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" ON)
153 else()
154         option(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
155 endif()
156
157 if(UNIX AND NOT APPLE)
158         option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"   ON)
159         option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
160 else()
161         # not an option for other OS's
162         set(WITH_BUILTIN_GLEW ON)
163 endif()
164
165 # Modifiers
166 option(WITH_MOD_FLUID           "Enable Elbeem Modifier (Fluid Simulation)" ON)
167 option(WITH_MOD_SMOKE           "Enable Smoke Modifier (Smoke Simulation)" ON)
168 option(WITH_MOD_DECIMATE        "Enable Decimate Modifier" ON)
169 option(WITH_MOD_BOOLEAN         "Enable Boolean Modifier" ON)
170 option(WITH_MOD_CLOTH_ELTOPO    "Enable Experemental cloth solver" OFF)
171 mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
172
173 # Image format support
174 option(WITH_IMAGE_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
175 option(WITH_IMAGE_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
176 option(WITH_IMAGE_TIFF          "Enable LibTIFF Support" ON)
177 option(WITH_IMAGE_DDS           "Enable DDS Image Support" ON)
178 option(WITH_IMAGE_CINEON        "Enable CINEON and DPX Image Support" ON)
179 option(WITH_IMAGE_HDR           "Enable HDR Image Support" ON)
180 option(WITH_IMAGE_REDCODE       "Enable RedCode Image Support" OFF)
181 option(WITH_IMAGE_FRAMESERVER   "Enable image FrameServer Support for rendering" ON)
182
183 # Audio/Video format support
184 option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
185 option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
186 if(APPLE OR (WIN32 AND NOT UNIX))
187         option(WITH_CODEC_QUICKTIME     "Enable Quicktime Support" OFF)
188 endif()
189
190 # 3D format support
191 # disable opencollada on non-apple unix because opencollada has no package for debian
192 option(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org)"       OFF)
193
194 # Sound output
195 option(WITH_SDL           "Enable SDL for sound and joystick support" ON)
196 option(WITH_OPENAL        "Enable OpenAL Support (http://www.openal.org)" ON)
197 option(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
198
199 # Compression
200 option(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON)
201 option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)" ON)
202
203 # Misc
204 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
205 option(WITH_RAYOPTIMIZATION     "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
206 if(UNIX AND NOT APPLE)
207         option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
208 endif()
209 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
210
211 # disable for now, but plan to support on all platforms eventually
212 option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
213 mark_as_advanced(WITH_MEM_JEMALLOC)
214
215 # Debug
216 option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
217 mark_as_advanced(WITH_CXX_GUARDEDALLOC)
218
219 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
220 mark_as_advanced(WITH_ASSERT_ABORT)
221
222
223 if(APPLE)
224         if(NOT CMAKE_OSX_ARCHITECTURES)
225                 set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
226                 "Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
227                 FORCE)
228         endif()
229         if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
230                 set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5 CACHE STRING
231                 "Choose the minimum OSX version required: 10.4 or 10.5"
232                 FORCE)
233         endif()
234         option(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
235         option(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
236         option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
237 endif()
238
239 #-----------------------------------------------------------------------------
240 # Check for conflicting/unsupported configurations
241
242 if(NOT WITH_BLENDER AND NOT WITH_PLAYER)
243         message(FATAL_ERROR "At least one of WITH_BLENDER or WITH_PLAYER must be enabled, nothing to do!")
244 endif()
245
246 if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
247         message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
248 endif()
249
250 if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
251         message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG require WITH_AUDASPACE")
252 endif()
253
254 if(NOT WITH_SDL AND WITH_GHOST_SDL)
255         message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL to be ON")
256 endif()
257
258 if(NOT WITH_IMAGE_OPENJPEG AND WITH_IMAGE_REDCODE)
259         message(FATAL_ERROR "WITH_IMAGE_REDCODE requires WITH_IMAGE_OPENJPEG")
260 endif()
261
262 # python module, needs some different options
263 if(WITH_PYTHON_MODULE AND WITH_PLAYER)
264         message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
265 endif()
266
267 if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
268         message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
269 endif()
270
271 if(WITH_CODEC_QUICKTIME AND MINGW)
272         message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
273                                                 "because it is currently unsupported, remove this "
274                                                 "line if youre a developer who wants to add support.")
275 endif()
276
277 # may as well build python module without a UI
278 if(WITH_PYTHON_MODULE)
279         set(WITH_HEADLESS ON)
280 endif()
281
282 TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
283
284 # don't store paths to libs for portable distrobution
285 if(WITH_INSTALL_PORTABLE)
286         set(CMAKE_SKIP_BUILD_RPATH TRUE)
287 endif()
288
289 #-----------------------------------------------------------------------------
290 # Initialize un-cached vars, avoid unused warning
291
292 # linux only, not cached
293 set(WITH_BINRELOC OFF)
294
295 # MAXOSX only, set to avoid uninitialized
296 set(EXETYPE "")
297
298 # C/C++ flags
299 set(PLATFORM_CFLAGS)
300
301 # these are added to later on.
302 set(C_WARNINGS)
303 set(CXX_WARNINGS)
304
305 # for gcc -Wno-blah-blah
306 set(CC_REMOVE_STRICT_FLAGS)
307
308 # libraries to link the binary with passed to target_link_libraries()
309 # known as LLIBS to scons
310 set(PLATFORM_LINKLIBS "")
311
312 # Added to linker flags in setup_liblinks
313 # - CMAKE_EXE_LINKER_FLAGS
314 # - CMAKE_EXE_LINKER_FLAGS_DEBUG
315 set(PLATFORM_LINKFLAGS "")
316 set(PLATFORM_LINKFLAGS_DEBUG "")
317
318
319 # disabled for now, not supported
320 # option(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
321
322 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
323 # On Unix:
324 #   cmake ../blender \
325 #         -D PYTHON_VERSION=3.2 \
326 #         -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
327 #         -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
328 #
329 # On Macs:
330 #   cmake ../blender \
331 #         -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
332 #         -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \
333 #         -G Xcode
334 #
335 # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
336
337 #-----------------------------------------------------------------------------
338 #Platform specifics
339
340 if(UNIX AND NOT APPLE)
341
342         # needed for ubuntu 11.04
343         if(EXISTS "/usr/lib/x86_64-linux-gnu")
344                 set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
345         endif()
346
347         find_package(JPEG REQUIRED)
348         find_package(PNG REQUIRED)
349         find_package(ZLIB REQUIRED)
350         find_package(Freetype REQUIRED)
351
352         if(WITH_PYTHON)
353                 # No way to set py32. remove for now.
354                 # find_package(PythonLibs)
355
356                 # Use our own instead, since wothout py is such a rare case,
357                 # require this package
358                 find_package(PythonLibsUnix REQUIRED)
359         endif()
360
361
362         if(WITH_IMAGE_OPENEXR)
363                 find_package(OpenEXR)  # our own module
364                 if(NOT OPENEXR_FOUND)
365                         set(WITH_IMAGE_OPENEXR OFF)
366                 endif()
367         endif()
368
369         if(WITH_IMAGE_OPENJPEG)
370                 find_package(OpenJPEG)
371                 if(NOT OPENJPEG_FOUND)
372                         set(WITH_IMAGE_OPENJPEG OFF)
373                 endif()
374         endif()
375
376         if(WITH_IMAGE_TIFF)
377                 find_package(TIFF)
378                 if(NOT TIFF_FOUND)
379                         set(WITH_IMAGE_TIFF OFF)
380                 endif()
381         endif()
382
383         # Audio IO
384         if(WITH_OPENAL)
385                 find_package(OpenAL)
386                 if(NOT OPENAL_FOUND)
387                         set(WITH_OPENAL OFF)
388                 endif()
389         endif()
390
391         if(WITH_SDL)
392                 find_package(SDL)
393                 mark_as_advanced(
394                         SDLMAIN_LIBRARY
395                         SDL_INCLUDE_DIR
396                         SDL_LIBRARY
397                         SDL_LIBRARY_TEMP
398                 )
399                 # unset(SDLMAIN_LIBRARY CACHE)
400                 if(NOT SDL_FOUND)
401                         set(WITH_SDL OFF)
402                 endif()
403         endif()
404
405         if(WITH_JACK)
406                 find_package(Jack)
407                 if(NOT JACK_FOUND)
408                         set(WITH_JACK OFF)
409                 endif()
410         endif()
411
412         # Codecs
413         if(WITH_CODEC_SNDFILE)
414                 find_package(SndFile)
415                 if(NOT SNDFILE_FOUND)
416                         set(WITH_CODEC_SNDFILE OFF)
417                 endif()
418         endif()
419
420         if(WITH_CODEC_FFMPEG)
421                 set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
422                 mark_as_advanced(FFMPEG)
423                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
424                 set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
425                 mark_as_advanced(FFMPEG_LIBRARIES)
426                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
427                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
428         endif()
429
430         if(WITH_INTERNATIONAL)
431                 find_library(INTL_LIBRARY
432                         NAMES intl
433                         PATHS
434                         /sw/lib
435                 )
436
437                 find_library(ICONV_LIBRARY
438                         NAMES iconv
439                         PATHS
440                         /sw/lib
441                 )
442                 mark_as_advanced(
443                         ICONV_LIBRARY
444                         INTL_LIBRARY
445                 )
446
447                 if(INTL_LIBRARY AND ICONV_LIBRARY)
448                         set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY})
449                 endif()
450         endif()
451
452         if(WITH_FFTW3)
453                 find_package(Fftw3)
454                 if(NOT FFTW3_FOUND)
455                         set(WITH_FFTW3 OFF)
456                 endif()
457         endif()
458
459         if(WITH_OPENCOLLADA)
460                 find_package(OpenCOLLADA)
461                 if(OPENCOLLADA_FOUND)
462                         find_package(XML2)
463                         find_package(PCRE)
464                 else()
465                         set(WITH_OPENCOLLADA OFF)
466                 endif()
467         endif()
468
469         if(WITH_MEM_JEMALLOC)
470                 find_package(JeMalloc)
471                 if(NOT JEMALLOC_FOUND)
472                         set(WITH_MEM_JEMALLOC OFF)
473                 endif()
474         endif()
475
476         if (WITH_INPUT_NDOF)
477                 find_package(Spacenav)
478                 if(NOT SPACENAV_FOUND)
479                         set(WITH_INPUT_NDOF OFF)
480                 endif()
481
482                 # use generic names within blenders buildsystem.
483                 if(SPACENAV_FOUND)
484                         set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS})
485                         set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES})
486                 endif()
487         endif()
488
489         # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
490         set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
491
492         if((NOT WITH_HEADLESS) AND (NOT WITH_GHOST_SDL))
493                 find_package(X11 REQUIRED)
494                 find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
495                 mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
496
497                 set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_X11_LIB}")
498
499                 if(WITH_X11_XINPUT)
500                         set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
501                 endif()
502         endif()
503
504         if(CMAKE_SYSTEM_NAME MATCHES "Linux")
505                 if(NOT WITH_PYTHON_MODULE)
506                         # BSD's dont use libdl.so
507                 set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -ldl")
508                         # binreloc is linux only
509                         set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
510                         set(WITH_BINRELOC ON)
511                 endif()
512         endif()
513
514         set(PLATFORM_LINKFLAGS "-pthread")
515
516         # lfs on glibc, all compilers should use
517         add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
518
519         # GNU Compiler
520         if(CMAKE_COMPILER_IS_GNUCC)
521                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
522         # CLang is the same as GCC for now.
523         elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
524                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
525         # Intel C++ Compiler
526         elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
527                 # think these next two are broken
528                 find_program(XIAR xiar)
529                 if(XIAR)
530                         set(CMAKE_AR "${XIAR}")
531                 endif()
532                 mark_as_advanced(XIAR)
533
534                 find_program(XILD xild)
535                 if(XILD)
536                         set(CMAKE_LINKER "${XILD}")
537                 endif()
538                 mark_as_advanced(XILD)
539
540                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
541                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel")
542
543                 # set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3")
544                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
545                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
546         endif()
547
548 elseif(WIN32)
549
550         # this file is included anyway when building under Windows with cl.exe
551         #  include(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
552
553         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
554
555         # Setup 64bit and 64bit windows systems
556         if(CMAKE_CL_64)
557                 message("64 bit compiler detected.")
558                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
559         endif()
560
561         add_definitions(-DWIN32)
562
563         if(WITH_INTERNATIONAL)
564                 set(ICONV ${LIBDIR}/iconv)
565                 set(ICONV_INCLUDE_DIRS ${ICONV}/include)
566                 set(ICONV_LIBRARIES iconv)
567                 set(ICONV_LIBPATH ${ICONV}/lib)
568         endif()
569
570         set(PNG "${LIBDIR}/png")
571         set(PNG_INCLUDE_DIR "${PNG}/include")
572         set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
573
574         set(JPEG "${LIBDIR}/jpeg")
575         set(JPEG_INCLUDE_DIR "${JPEG}/include")
576         set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
577
578         set(WINTAB_INC ${LIBDIR}/wintab/include)
579
580         if(WITH_OPENAL)
581                 set(OPENAL ${LIBDIR}/openal)
582                 set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
583                 set(OPENAL_LIBRARY wrap_oal)
584                 set(OPENAL_LIBPATH ${OPENAL}/lib)
585         endif()
586
587         if(WITH_CODEC_SNDFILE)
588                 set(SNDFILE ${LIBDIR}/sndfile)
589                 set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
590                 set(SNDFILE_LIBRARIES libsndfile-1)
591                 set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
592         endif()
593
594         if(WITH_SDL)
595                 set(SDL ${LIBDIR}/sdl)
596                 set(SDL_INCLUDE_DIR ${SDL}/include)
597                 set(SDL_LIBRARY SDL)
598                 set(SDL_LIBPATH ${SDL}/lib)
599         endif()
600
601         if(WITH_CODEC_QUICKTIME)
602                 set(QUICKTIME ${LIBDIR}/QTDevWin)
603                 set(QUICKTIME_INCLUDE_DIRS ${QUICKTIME}/CIncludes)
604                 set(QUICKTIME_LIBRARIES qtmlClient)
605                 set(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
606         endif()
607
608         if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
609                 add_definitions(-D__SSE__ -D__MMX__)
610         endif()
611
612         if(MSVC)
613                 if(CMAKE_CL_64)
614                         set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
615                 else()
616                         set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
617                 endif()
618
619                 add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB)
620
621                 set(CMAKE_CXX_FLAGS "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
622                 set(CMAKE_C_FLAGS   "/nologo /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
623
624                 if(CMAKE_CL_64)
625                         set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
626                 else()
627                         set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
628                 endif()
629                 set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
630                 set(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
631                 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
632                 if(CMAKE_CL_64)
633                         set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
634                 else()
635                         set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE)
636                 endif()
637                 set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
638                 set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE)
639                 set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
640
641                 if(WITH_INTERNATIONAL)
642                         set(GETTEXT ${LIBDIR}/gettext)
643                         set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
644                         set(GETTEXT_LIBPATH ${GETTEXT}/lib)
645                         set(GETTEXT_LIBRARIES gnu_gettext)
646                 endif()
647
648                 if(CMAKE_CL_64)
649                         set(PNG_LIBRARIES libpng)
650                 else()
651                         set(PNG_LIBRARIES libpng_st)
652                 endif()
653                 set(JPEG_LIBRARIES libjpeg)
654
655                 set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
656                 if(CMAKE_CL_64)
657                         set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz.lib)
658                 else()
659                         set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/zlib.lib)
660                 endif()
661
662                 set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
663                 set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
664
665                 set(FREETYPE ${LIBDIR}/freetype)
666                 set(FREETYPE_INCLUDE_DIRS
667                         ${LIBDIR}/freetype/include
668                         ${LIBDIR}/freetype/include/freetype2
669                 )
670                 set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
671
672                 if(WITH_FFTW3)
673                         set(FFTW3 ${LIBDIR}/fftw3)
674                         set(FFTW3_LIBRARIES libfftw)
675                         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
676                         set(FFTW3_LIBPATH ${FFTW3}/lib)
677                 endif()
678
679                 if(WITH_OPENCOLLADA)
680
681                         set(OPENCOLLADA_INCLUDE_DIRS
682                                 ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
683                                 ${LIBDIR}/opencollada/include/COLLADABaseUtils/include
684                                 ${LIBDIR}/opencollada/include/COLLADAFramework/include
685                                 ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
686                                 ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
687                         )
688
689                         set(OPENCOLLADA_LIBRARIES
690                                 ${LIBDIR}/opencollada/lib/OpenCOLLADASaxFrameworkLoader.lib
691                                 ${LIBDIR}/opencollada/lib/OpenCOLLADAFramework.lib
692                                 ${LIBDIR}/opencollada/lib/OpenCOLLADABaseUtils.lib
693                                 ${LIBDIR}/opencollada/lib/OpenCOLLADAStreamWriter.lib
694                                 ${LIBDIR}/opencollada/lib/MathMLSolver.lib
695                                 ${LIBDIR}/opencollada/lib/GeneratedSaxParser.lib
696                                 ${LIBDIR}/opencollada/lib/xml2.lib
697                                 ${LIBDIR}/opencollada/lib/buffer.lib
698                                 ${LIBDIR}/opencollada/lib/ftoa.lib
699                                 ${LIBDIR}/opencollada/lib/UTF.lib
700                         )
701                         set(PCRE_LIBRARIES
702                                 ${LIBDIR}/opencollada/lib/pcre.lib
703                         )
704                 endif()
705
706                 if(WITH_CODEC_FFMPEG)
707                         set(FFMPEG_INCLUDE_DIRS
708                                 ${LIBDIR}/ffmpeg/include
709                                 ${LIBDIR}/ffmpeg/include/msvc
710                         )
711                         set(FFMPEG_LIBRARIES
712                                 ${LIBDIR}/ffmpeg/lib/avcodec-53.lib
713                                 ${LIBDIR}/ffmpeg/lib/avformat-53.lib
714                                 ${LIBDIR}/ffmpeg/lib/avdevice-53.lib
715                                 ${LIBDIR}/ffmpeg/lib/avutil-51.lib
716                                 ${LIBDIR}/ffmpeg/lib/swscale-2.lib
717                         )
718                 endif()
719
720                 if(WITH_IMAGE_OPENEXR)
721                         if(MSVC90)
722                                 set(MSVC_LIB _vs2008)
723                                 set(MSVC_INC)
724                         elseif(MSVC10)
725                                 set(MSVC_LIB _vs2010)
726                                 set(MSVC_INC _vs2010)
727                         else()
728                                 set(MSVC_LIB msvc)
729                                 set(MSVC_INC)
730                         endif()
731                         set(OPENEXR ${LIBDIR}/openexr)
732                         set(OPENEXR_LIBPATH ${OPENEXR}/lib${MSVC_LIB})
733                         set(OPENEXR_LIBRARIES
734                                 ${OPENEXR_LIBPATH}/Iex.lib
735                                 ${OPENEXR_LIBPATH}/Half.lib
736                                 ${OPENEXR_LIBPATH}/IlmImf.lib
737                                 ${OPENEXR_LIBPATH}/Imath.lib
738                                 ${OPENEXR_LIBPATH}/IlmThread.lib
739                         )
740                         set(OPENEXR_INCUDE ${OPENEXR}/include${MSVC_INC})
741                         set(OPENEXR_INCLUDE_DIRS
742                                 ${OPENEXR_INCUDE}
743                                 ${OPENEXR_INCUDE}/IlmImf
744                                 ${OPENEXR_INCUDE}/Iex
745                                 ${OPENEXR_INCUDE}/Imath
746                         )
747                         unset(OPENEXR_INCUDE)
748                         unset(OPENEXR_LIBPATH)
749                 endif()
750
751                 if(WITH_IMAGE_TIFF)
752                         set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
753                         set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
754                 endif()
755
756                 if(WITH_JACK)
757                         set(JACK_INCLUDE_DIRS
758                                 ${LIBDIR}/jack/include/jack
759                                 ${LIBDIR}/jack/include
760                         )
761                         set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib)
762                 endif()
763
764                 if(WITH_PYTHON)
765                         # normally cached but not since we include them with blender
766                         set(PYTHON_VERSION 3.2) # CACHE STRING)
767                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") # CACHE PATH)
768                         set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python32.lib") #CACHE FILEPATH)
769
770                         # uncached vars
771                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
772                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
773                 endif()
774
775                 set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
776
777                 # MSVC only, Mingw doesnt need
778                 if(CMAKE_CL_64)
779                         set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
780                 else()
781                         set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
782                 endif()
783
784                 set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
785
786         else()
787                 # keep GCC specific stuff here
788                 if(CMAKE_COMPILER_IS_GNUCC)
789                         set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32")
790                         set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
791
792                         add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
793                 endif()
794
795                 add_definitions(-DFREE_WINDOWS)
796
797                 if(WITH_INTERNATIONAL)
798                         set(GETTEXT ${LIBDIR}/gcc/gettext)
799                         set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
800                         set(GETTEXT_LIBPATH ${GETTEXT}/lib)
801                         set(GETTEXT_LIBRARIES intl)
802                 endif()
803
804                 set(JPEG_LIBRARIES libjpeg)
805                 set(PNG_LIBRARIES png)
806
807                 set(ZLIB ${LIBDIR}/zlib)
808                 set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
809                 set(ZLIB_LIBPATH ${ZLIB}/lib)
810                 set(ZLIB_LIBRARIES z)
811
812                 set(PTHREADS ${LIBDIR}/pthreads)
813                 set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
814                 set(PTHREADS_LIBPATH ${PTHREADS}/lib)
815                 set(PTHREADS_LIBRARIES pthreadGC2)
816
817                 set(FREETYPE ${LIBDIR}/gcc/freetype)
818                 set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
819                 set(FREETYPE_LIBPATH ${FREETYPE}/lib)
820                 set(FREETYPE_LIBRARY freetype)
821
822                 if(WITH_FFTW3)
823                         set(FFTW3 ${LIBDIR}/gcc/fftw3)
824                         set(FFTW3_LIBRARIES fftw3)
825                         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
826                         set(FFTW3_LIBPATH ${FFTW3}/lib)
827                 endif()
828
829                 if(WITH_OPENCOLLADA)
830                         set(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
831                         set(OPENCOLLADA_INCLUDE_DIRS
832                                 ${LIBDIR}/gcc/opencollada/include/COLLADAStreamWriter/include
833                                 ${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include
834                                 ${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include
835                                 ${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include
836                                 ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include
837                         )
838                         set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
839                         set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
840                         set(PCRE_LIBRARIES pcre)
841                 endif()
842
843                 if(WITH_CODEC_FFMPEG)
844                         set(FFMPEG ${LIBDIR}/ffmpeg)
845                         set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
846                         set(FFMPEG_LIBRARIES avcodec-53 avformat-53 avdevice-53 avutil-51 swscale-2)
847                         set(FFMPEG_LIBPATH ${FFMPEG}/lib)
848                 endif()
849
850                 if(WITH_IMAGE_OPENEXR)
851                         set(OPENEXR ${LIBDIR}/gcc/openexr)
852                         set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
853                         set(OPENEXR_LIBRARIES Half IlmImf Imath IlmThread Iex)
854                         set(OPENEXR_LIBPATH ${OPENEXR}/lib)
855                 endif()
856
857                 if(WITH_IMAGE_TIFF)
858                         set(TIFF ${LIBDIR}/gcc/tiff)
859                         set(TIFF_LIBRARY tiff)
860                         set(TIFF_INCLUDE_DIR ${TIFF}/include)
861                         set(TIFF_LIBPATH ${TIFF}/lib)
862                 endif()
863
864                 if(WITH_JACK)
865                         set(JACK ${LIBDIR}/jack)
866                         set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
867                         set(JACK_LIBRARIES jack)
868                         set(JACK_LIBPATH ${JACK}/lib)
869
870                         # TODO, gives linking errors, force off
871                         set(WITH_JACK OFF)
872                 endif()
873
874                 if(WITH_PYTHON)
875                         # normally cached but not since we include them with blender
876                         set(PYTHON_VERSION 3.2) #  CACHE STRING)
877                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")  # CACHE PATH)
878                         set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python32mw.lib")  # CACHE FILEPATH)
879
880                         # uncached vars
881                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
882                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
883                 endif()
884
885                 set(PLATFORM_LINKFLAGS "--stack,2097152")
886
887         endif()
888
889         # used in many places so include globally, like OpenGL
890         blender_include_dirs("${PTHREADS_INCLUDE_DIRS}")
891
892 elseif(APPLE)
893
894         if (${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
895                 set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE)
896         endif()
897
898         if(WITH_LIBS10.5)
899                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
900         else()
901                 if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
902                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
903                 else()
904                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
905                 endif()
906         endif()
907
908
909         if(WITH_OPENAL)
910                 find_package(OpenAL)
911                 if(OPENAL_FOUND)
912                         set(WITH_OPENAL ON)
913                         set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
914                 else()
915                         set(WITH_OPENAL OFF)
916                 endif()
917         endif()
918
919         if(WITH_JACK)
920                 set(JACK /usr)
921                 set(JACK_INCLUDE_DIRS ${JACK}/include/jack)
922                 set(JACK_LIBRARIES jack)
923                 set(JACK_LIBPATH ${JACK}/lib)
924         endif()
925
926         if(WITH_CODEC_SNDFILE)
927                 set(SNDFILE ${LIBDIR}/sndfile)
928                 set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
929                 set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
930                 set(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)  # TODO, deprecate
931         endif()
932
933         if(WITH_PYTHON)
934                 # we use precompiled libraries for py 3.2 and up by default
935
936                 # normally cached but not since we include them with blender
937                 set(PYTHON_VERSION 3.2)
938                 set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
939                 # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
940                 set(PYTHON_LIBRARY python${PYTHON_VERSION})
941                 set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
942                 # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
943
944                 # uncached vars
945                 set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
946                 set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
947         endif()
948
949         if(WITH_INTERNATIONAL)
950                 set(GETTEXT ${LIBDIR}/gettext)
951                 set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include")
952                 set(GETTEXT_LIBRARIES intl iconv)
953                 set(GETTEXT_LIBPATH ${GETTEXT}/lib)
954         endif()
955
956         if(WITH_FFTW3)
957                 set(FFTW3 ${LIBDIR}/fftw3)
958                 set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
959                 set(FFTW3_LIBRARIES fftw3)
960                 set(FFTW3_LIBPATH ${FFTW3}/lib)
961         endif()
962
963         set(PNG_LIBRARIES png)
964         set(JPEG_LIBRARIES jpeg)
965
966         set(ZLIB /usr)
967         set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
968         set(ZLIB_LIBRARIES z bz2)
969
970         set(FREETYPE ${LIBDIR}/freetype)
971         set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
972         set(FREETYPE_LIBPATH ${FREETYPE}/lib)
973         set(FREETYPE_LIBRARY freetype)
974
975         if(WITH_IMAGE_OPENEXR)
976                 set(OPENEXR ${LIBDIR}/openexr)
977                 set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
978                 set(OPENEXR_LIBRARIES Iex Half IlmImf Imath IlmThread)
979                 set(OPENEXR_LIBPATH ${OPENEXR}/lib)
980         endif()
981
982         if(WITH_CODEC_FFMPEG)
983                 set(FFMPEG ${LIBDIR}/ffmpeg)
984                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
985                 set(FFMPEG_LIBRARIES avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
986                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
987                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
988         endif()
989
990         find_library(SYSTEMSTUBS_LIBRARY
991                 NAMES
992                 SystemStubs
993                 PATHS
994         )
995         mark_as_advanced(SYSTEMSTUBS_LIBRARY)
996         if(SYSTEMSTUBS_LIBRARY)
997                 set(PLATFORM_LINKLIBS stdc++ SystemStubs)
998         else()
999                 set(PLATFORM_LINKLIBS stdc++)
1000         endif()
1001
1002         if(WITH_COCOA)
1003                 set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
1004                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
1005                 if(USE_QTKIT)
1006                         set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
1007                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
1008                         if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
1009                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1010                                 #libSDL still needs 32bit carbon quicktime
1011                         endif()
1012                 elseif(WITH_CODEC_QUICKTIME)
1013                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1014                 endif()
1015
1016                 # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
1017                 # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
1018                 if(WITH_INPUT_NDOF)
1019                         # This thread it *should* work and check the framework - campbell
1020                         # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
1021                         find_library(3D_CONNEXION_CLIENT_LIBRARY
1022                                 NAMES 3DconnexionClient
1023                         )
1024                         if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
1025                                 set(WITH_INPUT_NDOF OFF)
1026                         endif()
1027
1028                         if(WITH_INPUT_NDOF)
1029                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework 3DconnexionClient")
1030                         endif()
1031                 endif()
1032
1033         else()
1034                 set(PLATFORM_CFLAGS "-pipe -funsigned-char")
1035                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
1036                 set(WITH_INPUT_NDOF OFF)  # unsupported
1037         endif()
1038
1039         if(WITH_OPENCOLLADA)
1040                 set(OPENCOLLADA ${LIBDIR}/opencollada)
1041
1042                 set(OPENCOLLADA_INCLUDE_DIRS
1043                         ${LIBDIR}/opencollada/include/COLLADAStreamWriter
1044                         ${LIBDIR}/opencollada/include/COLLADABaseUtils
1045                         ${LIBDIR}/opencollada/include/COLLADAFramework
1046                         ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
1047                         ${LIBDIR}/opencollada/include/GeneratedSaxParser
1048                 )
1049
1050                 set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
1051                 set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
1052                 #pcre is bundled with openCollada
1053                 #set(PCRE ${LIBDIR}/pcre)
1054                 #set(PCRE_LIBPATH ${PCRE}/lib)
1055                 set(PCRE_LIBRARIES pcre)
1056                 #libxml2 is used
1057                 #set(EXPAT ${LIBDIR}/expat)
1058                 #set(EXPAT_LIBPATH ${EXPAT}/lib)
1059                 set(EXPAT_LIB)
1060         endif()
1061
1062         if(WITH_SDL)
1063                 set(SDL ${LIBDIR}/sdl)
1064                 set(SDL_INCLUDE_DIR ${SDL}/include)
1065                 set(SDL_LIBRARY SDL)
1066                 set(SDL_LIBPATH ${SDL}/lib)
1067         endif()
1068
1069         set(PNG "${LIBDIR}/png")
1070         set(PNG_INCLUDE_DIR "${PNG}/include")
1071         set(PNG_LIBPATH ${PNG}/lib)
1072
1073         set(JPEG "${LIBDIR}/jpeg")
1074         set(JPEG_INCLUDE_DIR "${JPEG}/include")
1075         set(JPEG_LIBPATH ${JPEG}/lib)
1076
1077         if(WITH_IMAGE_TIFF)
1078                 set(TIFF ${LIBDIR}/tiff)
1079                 set(TIFF_INCLUDE_DIR ${TIFF}/include)
1080                 set(TIFF_LIBRARY tiff)
1081                 set(TIFF_LIBPATH ${TIFF}/lib)
1082         endif()
1083
1084         if (WITH_INPUT_NDOF)
1085                 # linker needs "-weak_framework 3DconnexionClient"
1086         endif()
1087
1088         set(EXETYPE MACOSX_BUNDLE)
1089
1090         set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
1091         set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
1092         if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
1093                 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1094                 set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1095         elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
1096                 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1097                 set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1098         else()
1099                 set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1100                 set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1101         endif()
1102 endif()
1103
1104 #-----------------------------------------------------------------------------
1105 # Common.
1106
1107 if(APPLE OR WIN32)
1108         if(NOT EXISTS "${LIBDIR}/")
1109                 message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
1110         endif()
1111 endif()
1112
1113 # See TEST_SSE_SUPPORT() for how this is defined.
1114
1115 if(WITH_RAYOPTIMIZATION)
1116         if(SUPPORT_SSE_BUILD)
1117                 set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
1118                 add_definitions(-D__SSE__ -D__MMX__)
1119         endif()
1120         if(SUPPORT_SSE2_BUILD)
1121                 set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}")
1122                 add_definitions(-D__SSE2__)
1123                 if(NOT SUPPORT_SSE_BUILD) # dont double up
1124                         add_definitions(-D__MMX__)
1125                 endif()
1126         endif()
1127 endif()
1128
1129
1130 # set the endian define
1131 if(MSVC)
1132         # for some reason this fails on msvc
1133         add_definitions(-D__LITTLE_ENDIAN__)
1134 else()
1135         include(TestBigEndian)
1136         test_big_endian(_SYSTEM_BIG_ENDIAN)
1137         if(_SYSTEM_BIG_ENDIAN)
1138                 add_definitions(-D__BIG_ENDIAN__)
1139         else()
1140                 add_definitions(-D__LITTLE_ENDIAN__)
1141         endif()
1142         unset(_SYSTEM_BIG_ENDIAN)
1143 endif()
1144
1145
1146 if(WITH_IMAGE_OPENJPEG)
1147         if(UNIX AND NOT APPLE)
1148                 # dealt with above
1149         else()
1150                 set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
1151         endif()
1152 endif()
1153
1154 if(WITH_IMAGE_REDCODE)
1155         set(REDCODE ${CMAKE_SOURCE_DIR}/extern)
1156         set(REDCODE_INC ${REDCODE})
1157 endif()
1158
1159 #-----------------------------------------------------------------------------
1160 # Blender WebPlugin
1161
1162 if(WITH_WEBPLUGIN)
1163         set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
1164         set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
1165
1166         set(WITH_PLAYER ON)
1167 endif()
1168
1169
1170 #-----------------------------------------------------------------------------
1171 # Configure OpenGL.
1172 find_package(OpenGL)
1173 blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
1174 # unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
1175 # unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
1176
1177 #-----------------------------------------------------------------------------
1178 # Configure OpenMP.
1179 if(WITH_OPENMP)
1180         find_package(OpenMP)
1181         if(OPENMP_FOUND)
1182                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
1183                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
1184
1185                 if(APPLE AND ${CMAKE_GENERATOR} MATCHES "Xcode")
1186                         set(CMAKE_XCODE_ATTRIBUTE_ENABLE_OPENMP_SUPPORT "YES")
1187                 endif()
1188         else()
1189                 set(WITH_OPENMP OFF)
1190         endif()
1191
1192         mark_as_advanced(
1193                 OpenMP_C_FLAGS
1194                 OpenMP_CXX_FLAGS
1195         )
1196 endif()
1197
1198 #-----------------------------------------------------------------------------
1199 # Configure GLEW
1200
1201 if(WITH_BUILTIN_GLEW)
1202         # set(GLEW_LIBRARY "")  # unused
1203         set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
1204 else()
1205         find_package(GLEW)
1206
1207         if(NOT GLEW_FOUND)
1208                 message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW")
1209         endif()
1210
1211         mark_as_advanced(
1212                 GLEW_LIBRARY
1213                 GLEW_INCLUDE_PATH
1214         )
1215 endif()
1216
1217 #-----------------------------------------------------------------------------
1218 # Configure Python.
1219
1220 if(WITH_PYTHON_MODULE)
1221         add_definitions(-DPy_ENABLE_SHARED)
1222 endif()
1223
1224 #-----------------------------------------------------------------------------
1225 # Extra compile flags
1226
1227 if(CMAKE_COMPILER_IS_GNUCC)
1228
1229         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1230         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
1231         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
1232         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
1233         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
1234         # system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
1235         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes)
1236         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
1237         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1238         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1239         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
1240         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
1241
1242         # # this causes too many warnings, disable
1243         # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
1244
1245         # disable because it gives warnings for printf() & friends.
1246         # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
1247         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
1248
1249         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1250         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1251         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1252
1253         # # this causes too many warnings, disable
1254         # ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
1255
1256         # flags to undo strict flags
1257         ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
1258         ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER        -Wno-unused-parameter)
1259         ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_BUT_SET_VARIABLE -Wno-unused-but-set-variable)
1260
1261 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
1262
1263         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1264         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1265         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1266
1267         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1268         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1269         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1270
1271         # disable numbered, false positives
1272         set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
1273         set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
1274
1275 endif()
1276
1277 # MSVC2010 fails to links C++ libs right
1278 if(MSVC10)
1279         if(WITH_IMAGE_OPENEXR)
1280                 message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
1281                 set(WITH_IMAGE_OPENEXR OFF)
1282         endif()
1283         if(WITH_OPENCOLLADA)
1284                 message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
1285                 set(WITH_OPENCOLLADA OFF)
1286         endif()
1287 endif()
1288
1289 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1290         if(WITH_IK_ITASC OR WITH_MOD_FLUID)
1291                 message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.")
1292                 set(WITH_IK_ITASC OFF)
1293                 set(WITH_MOD_FLUID OFF)
1294         endif()
1295 endif()
1296
1297
1298 # ensure python header is found since detection can fail, this could happen
1299 # with _any_ library but since we used a fixed python version this tends to
1300 # be most problematic.
1301 if(WITH_PYTHON)
1302         if(NOT EXISTS "${PYTHON_INCLUDE_DIR}/Python.h")
1303                 message(FATAL_ERROR "Missing: \"${PYTHON_INCLUDE_DIR}/Python.h\",\n"
1304                                                         "Set the cache entry 'PYTHON_INCLUDE_DIR' to point "
1305                                                         "to a valid python include path. Containing "
1306                                                         "Python.h for python version \"${PYTHON_VERSION}\"")
1307         endif()
1308 endif()
1309
1310
1311 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
1312 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
1313
1314 #-------------------------------------------------------------------------------
1315 # Global Defines
1316
1317 # better not set includes here but this debugging option is off by default.
1318 if(WITH_CXX_GUARDEDALLOC)
1319         include_directories(${CMAKE_SOURCE_DIR}/intern/guardedalloc)
1320 endif()
1321
1322 if(WITH_ASSERT_ABORT)
1323         add_definitions(-DWITH_ASSERT_ABORT)
1324 endif()
1325
1326 # message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
1327 # message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
1328
1329 #-----------------------------------------------------------------------------
1330 # Libraries
1331
1332 add_subdirectory(source)
1333 add_subdirectory(intern)
1334 add_subdirectory(extern)
1335
1336
1337 #-----------------------------------------------------------------------------
1338 # Blender Application
1339 if(WITH_BLENDER)
1340         add_subdirectory(source/creator)
1341 endif()
1342
1343
1344 #-----------------------------------------------------------------------------
1345 # Blender Player
1346 if(WITH_PLAYER)
1347         add_subdirectory(source/blenderplayer)
1348 endif()
1349
1350 #-----------------------------------------------------------------------------
1351 # CPack for generating packages
1352 include(build_files/cmake/packaging.cmake)
1353
1354
1355 #-----------------------------------------------------------------------------
1356 # Print Final Configuration
1357
1358 if(FIRST_RUN)
1359         set(_config_msg "\n* Blender Configuration *")
1360         macro(info_cfg_option
1361                 _setting)
1362                 set(_msg "   * ${_setting}")
1363                 string(LENGTH "${_msg}" _len)
1364                 while("28" GREATER "${_len}")
1365                         set(_msg "${_msg} ")
1366                          math(EXPR _len "${_len} + 1")
1367                 endwhile()
1368
1369                 set(_config_msg "${_config_msg}\n${_msg}${${_setting}}")
1370         endmacro()
1371
1372         macro(info_cfg_text
1373                 _text)
1374                 set(_config_msg "${_config_msg}\n\n  ${_text}")
1375
1376
1377         endmacro()
1378
1379         info_cfg_text("Build Options:")
1380         info_cfg_option(WITH_GAMEENGINE)
1381         info_cfg_option(WITH_PLAYER)
1382         info_cfg_option(WITH_BULLET)
1383         info_cfg_option(WITH_IK_ITASC)
1384         info_cfg_option(WITH_OPENCOLLADA)
1385         info_cfg_option(WITH_FFTW3)
1386         info_cfg_option(WITH_INTERNATIONAL)
1387         info_cfg_option(WITH_INPUT_NDOF)
1388
1389         info_cfg_text("Compiler Options:")
1390         info_cfg_option(WITH_BUILDINFO)
1391         info_cfg_option(WITH_OPENMP)
1392         info_cfg_option(WITH_RAYOPTIMIZATION)
1393
1394         info_cfg_text("System Options:")
1395         info_cfg_option(WITH_INSTALL_PORTABLE)
1396         info_cfg_option(WITH_X11_XINPUT)
1397         info_cfg_option(WITH_BUILTIN_GLEW)
1398
1399         info_cfg_text("Image Formats:")
1400         info_cfg_option(WITH_IMAGE_CINEON)
1401         info_cfg_option(WITH_IMAGE_DDS)
1402         info_cfg_option(WITH_IMAGE_HDR)
1403         info_cfg_option(WITH_IMAGE_OPENEXR)
1404         info_cfg_option(WITH_IMAGE_OPENJPEG)
1405         info_cfg_option(WITH_IMAGE_REDCODE)
1406         info_cfg_option(WITH_IMAGE_TIFF)
1407
1408         info_cfg_text("Audio:")
1409         info_cfg_option(WITH_OPENAL)
1410         info_cfg_option(WITH_SDL)
1411         info_cfg_option(WITH_JACK)
1412         info_cfg_option(WITH_CODEC_FFMPEG)
1413         info_cfg_option(WITH_CODEC_SNDFILE)
1414
1415         info_cfg_text("Compression:")
1416         info_cfg_option(WITH_LZMA)
1417         info_cfg_option(WITH_LZO)
1418
1419         info_cfg_text("Python:")
1420         info_cfg_option(WITH_PYTHON_INSTALL)
1421         info_cfg_option(WITH_PYTHON_MODULE)
1422         info_cfg_option(WITH_PYTHON_SAFETY)
1423
1424         info_cfg_text("Modifiers:")
1425         info_cfg_option(WITH_MOD_BOOLEAN)
1426         info_cfg_option(WITH_MOD_DECIMATE)
1427         info_cfg_option(WITH_MOD_FLUID)
1428
1429         info_cfg_text("")
1430
1431         message("${_config_msg}")
1432 endif()