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