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