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