Merging r39998 through r40043 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 # don't store paths to libs for portable distrobution
281 if(WITH_INSTALL_PORTABLE)
282         set(CMAKE_SKIP_BUILD_RPATH TRUE)
283 endif()
284
285 #-----------------------------------------------------------------------------
286 # Initialize un-cached vars, avoid unused warning
287
288 # linux only, not cached
289 set(WITH_BINRELOC OFF)
290
291 # MAXOSX only, set to avoid uninitialized 
292 set(EXETYPE)
293
294 # C/C++ flags
295 set(PLATFORM_CFLAGS)
296
297 # these are added to later on.
298 set(C_WARNINGS)
299 set(CXX_WARNINGS)
300
301 # libraries to link the binary with passed to target_link_libraries()
302 # known as LLIBS to scons
303 set(PLATFORM_LINKLIBS)
304
305 # Added to linker flags in setup_liblinks
306 # - CMAKE_EXE_LINKER_FLAGS
307 # - CMAKE_EXE_LINKER_FLAGS_DEBUG
308 set(PLATFORM_LINKFLAGS)
309 set(PLATFORM_LINKFLAGS_DEBUG)
310
311
312 # disabled for now, not supported
313 # option(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
314
315 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
316 # On Unix: 
317 #   cmake ../blender \
318 #         -D PYTHON_VERSION=3.2 \
319 #         -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
320 #         -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
321 #
322 # On Macs: 
323 #   cmake ../blender \
324 #         -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
325 #         -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \
326 #         -G Xcode
327 #
328 # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
329
330 #-----------------------------------------------------------------------------
331 #Platform specifics
332
333 if(UNIX AND NOT APPLE)
334         
335         # needed for ubuntu 11.04
336         if(EXISTS "/usr/lib/x86_64-linux-gnu")
337                 set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
338         endif()
339
340         find_package(JPEG REQUIRED)
341         find_package(PNG REQUIRED)
342         find_package(ZLIB REQUIRED)
343         find_package(Freetype REQUIRED)
344
345         if(WITH_PYTHON)
346                 # No way to set py32. remove for now.
347                 # find_package(PythonLibs)
348
349                 # Use our own instead, since wothout py is such a rare case,
350                 # require this package
351                 find_package(PythonLibsUnix REQUIRED)
352         endif()
353
354
355         if(WITH_IMAGE_OPENEXR)
356                 find_package(OpenEXR)  # our own module
357                 if(NOT OPENEXR_FOUND)
358                         set(WITH_IMAGE_OPENEXR OFF)
359                 endif()
360         endif()
361
362         if(WITH_IMAGE_OPENJPEG)
363                 find_package(OpenJPEG)
364                 if(NOT OPENJPEG_FOUND)
365                         set(WITH_IMAGE_OPENJPEG OFF)
366                 endif()
367         endif()
368
369         if(WITH_IMAGE_TIFF)
370                 find_package(TIFF)
371                 if(NOT TIFF_FOUND)
372                         set(WITH_IMAGE_TIFF OFF)
373                 endif()
374         endif()
375
376         # Audio IO
377         if(WITH_OPENAL)
378                 find_package(OpenAL)
379                 if(NOT OPENAL_FOUND)
380                         set(WITH_OPENAL OFF)
381                 endif()
382         endif()
383
384         if(WITH_SDL)
385                 find_package(SDL)
386                 mark_as_advanced(SDLMAIN_LIBRARY)
387                 mark_as_advanced(SDL_INCLUDE_DIR)
388                 mark_as_advanced(SDL_LIBRARY)
389                 mark_as_advanced(SDL_LIBRARY_TEMP)
390                 # unset(SDLMAIN_LIBRARY CACHE)
391                 if(NOT SDL_FOUND)
392                         set(WITH_SDL OFF)
393                 endif()
394         endif()
395
396         if(WITH_JACK)
397                 find_package(Jack)
398                 if(NOT JACK_FOUND)
399                         set(WITH_JACK OFF)
400                 endif()
401         endif()
402
403         # Codecs
404         if(WITH_CODEC_SNDFILE)
405                 find_package(SndFile)
406                 if(NOT SNDFILE_FOUND)
407                         set(WITH_CODEC_SNDFILE OFF)
408                 endif()
409         endif()
410
411         if(WITH_CODEC_FFMPEG)
412                 set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
413                 mark_as_advanced(FFMPEG)
414                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
415                 set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
416                 mark_as_advanced(FFMPEG_LIBRARIES)
417                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
418                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
419         endif()
420
421         if(WITH_INTERNATIONAL)
422                 find_library(INTL_LIBRARY
423                         NAMES intl
424                         PATHS
425                         /sw/lib
426                 )
427
428                 find_library(ICONV_LIBRARY
429                         NAMES iconv
430                         PATHS
431                         /sw/lib
432                 )
433                 mark_as_advanced(ICONV_LIBRARY)
434                 mark_as_advanced(INTL_LIBRARY)
435
436                 if(INTL_LIBRARY AND ICONV_LIBRARY)
437                         set(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
438                 endif()
439         endif()
440
441         if(WITH_FFTW3)
442                 find_package(Fftw3)
443                 if(NOT FFTW3_FOUND)
444                         set(WITH_FFTW3 OFF)
445                 endif()
446         endif()
447
448         if(WITH_SAMPLERATE)
449                 find_package(Samplerate)
450                 if(NOT SAMPLERATE_FOUND)
451                         set(WITH_SAMPLERATE OFF)
452                 endif()
453         endif()
454
455         if(WITH_OPENCOLLADA)
456                 find_package(OpenCOLLADA)
457                 if(OPENCOLLADA_FOUND)
458                         find_package(XML2)
459                         find_package(PCRE)
460                 else()
461                         set(WITH_OPENCOLLADA OFF)
462                 endif()
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
688                         set(OPENCOLLADA_INCLUDE_DIRS
689                                 ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
690                                 ${LIBDIR}/opencollada/include/COLLADABaseUtils/include
691                                 ${LIBDIR}/opencollada/include/COLLADAFramework/include
692                                 ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
693                                 ${LIBDIR}/opencollada/include/GeneratedSaxParser/include                        
694                         )
695
696                         set(OPENCOLLADA_LIBRARIES
697                                 ${LIBDIR}/opencollada/lib/OpenCOLLADASaxFrameworkLoader.lib
698                                 ${LIBDIR}/opencollada/lib/OpenCOLLADAFramework.lib
699                                 ${LIBDIR}/opencollada/lib/OpenCOLLADABaseUtils.lib
700                                 ${LIBDIR}/opencollada/lib/OpenCOLLADAStreamWriter.lib
701                                 ${LIBDIR}/opencollada/lib/MathMLSolver.lib
702                                 ${LIBDIR}/opencollada/lib/GeneratedSaxParser.lib
703                                 ${LIBDIR}/opencollada/lib/xml2.lib
704                                 ${LIBDIR}/opencollada/lib/buffer.lib
705                                 ${LIBDIR}/opencollada/lib/ftoa.lib
706                                 ${LIBDIR}/opencollada/lib/UTF.lib
707                         )
708                         set(PCRE_LIB
709                                 ${LIBDIR}/opencollada/lib/pcre.lib
710                         )
711                 endif()
712
713                 if(WITH_CODEC_FFMPEG)
714                         set(FFMPEG_INCLUDE_DIRS
715                                 ${LIBDIR}/ffmpeg/include
716                                 ${LIBDIR}/ffmpeg/include/msvc
717                         )
718                         set(FFMPEG_LIBRARIES
719                                 ${LIBDIR}/ffmpeg/lib/avcodec-53.lib
720                                 ${LIBDIR}/ffmpeg/lib/avformat-53.lib
721                                 ${LIBDIR}/ffmpeg/lib/avdevice-53.lib
722                                 ${LIBDIR}/ffmpeg/lib/avutil-51.lib
723                                 ${LIBDIR}/ffmpeg/lib/swscale-2.lib
724                         )
725                 endif()
726
727                 if(WITH_IMAGE_OPENEXR)
728                         if(MSVC90)
729                                 set(MSVC_LIB _vs2008)
730                                 set(MSVC_INC)
731                         elseif(MSVC10)
732                                 set(MSVC_LIB _vs2010)
733                                 set(MSVC_INC _vs2010)
734                         else()
735                                 set(MSVC_LIB msvc)
736                                 set(MSVC_INC)
737                         endif()
738                         set(OPENEXR ${LIBDIR}/openexr)
739                         set(OPENEXR_LIBPATH ${OPENEXR}/lib${MSVC_LIB})
740                         set(OPENEXR_LIBRARIES
741                                 ${OPENEXR_LIBPATH}/Iex.lib
742                                 ${OPENEXR_LIBPATH}/Half.lib
743                                 ${OPENEXR_LIBPATH}/IlmImf.lib
744                                 ${OPENEXR_LIBPATH}/Imath.lib
745                                 ${OPENEXR_LIBPATH}/IlmThread.lib
746                         )
747                         set(OPENEXR_INCUDE ${OPENEXR}/include${MSVC_INC})
748                         set(OPENEXR_INCLUDE_DIRS
749                                 ${OPENEXR_INCUDE}
750                                 ${OPENEXR_INCUDE}/IlmImf
751                                 ${OPENEXR_INCUDE}/Iex
752                                 ${OPENEXR_INCUDE}/Imath
753                         )
754                         unset(OPENEXR_INCUDE)
755                         unset(OPENEXR_LIBPATH)
756                 endif()
757
758                 if(WITH_IMAGE_TIFF)
759                         set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
760                         set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
761                 endif()
762
763                 if(WITH_JACK)
764                         set(JACK_INCLUDE_DIRS
765                                 ${LIBDIR}/jack/include/jack
766                                 ${LIBDIR}/jack/include
767                         )
768                         set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib)
769                 endif()
770
771                 if(WITH_PYTHON)
772                         # normally cached but not since we include them with blender
773                         set(PYTHON_VERSION 3.2) # CACHE STRING)
774                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}") # CACHE PATH)
775                         set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python32.lib") #CACHE FILEPATH)
776
777                         # uncached vars
778                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
779                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
780                 endif()
781
782                 set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
783
784                 # MSVC only, Mingw doesnt need
785                 if(CMAKE_CL_64)
786                         set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
787                 else()
788                         set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
789                 endif()
790
791                 set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
792
793         else()
794                 # keep GCC spesific stuff here
795                 if(CMAKE_COMPILER_IS_GNUCC)
796                         set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32")
797                         set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
798
799                         add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
800                 endif()
801
802                 add_definitions(-DFREE_WINDOWS)
803
804                 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
805                 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
806
807                 if(WITH_INTERNATIONAL)
808                         set(GETTEXT ${LIBDIR}/gcc/gettext)
809                         set(GETTEXT_INC ${GETTEXT}/include)
810                         set(GETTEXT_LIBPATH ${GETTEXT}/lib)
811                         set(GETTEXT_LIB intl)
812                 endif()
813
814                 set(JPEG_LIBRARIES libjpeg)
815                 set(PNG_LIBRARIES png)
816
817                 set(ZLIB ${LIBDIR}/zlib)
818                 set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
819                 set(ZLIB_LIBPATH ${ZLIB}/lib)
820                 set(ZLIB_LIBRARIES z)
821
822                 set(PTHREADS ${LIBDIR}/pthreads)
823                 set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
824                 set(PTHREADS_LIBPATH ${PTHREADS}/lib)
825                 set(PTHREADS_LIBRARIES pthreadGC2)
826                 
827                 set(FREETYPE ${LIBDIR}/gcc/freetype)
828                 set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
829                 set(FREETYPE_LIBPATH ${FREETYPE}/lib)
830                 set(FREETYPE_LIBRARY freetype)
831
832                 if(WITH_FFTW3)
833                         set(FFTW3 ${LIBDIR}/gcc/fftw3)
834                         set(FFTW3_LIBRARIES fftw3)
835                         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
836                         set(FFTW3_LIBPATH ${FFTW3}/lib)
837                 endif()
838
839                 if(WITH_OPENCOLLADA)
840                         set(OPENCOLLADA ${LIBDIR}/gcc/opencollada)
841                         set(OPENCOLLADA_INCLUDE_DIRS
842                                 ${LIBDIR}/gcc/opencollada/include/COLLADAStreamWriter/include
843                                 ${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include
844                                 ${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include
845                                 ${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include
846                                 ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include                    
847                         )
848                         set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
849                         set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
850                         set(PCRE_LIB pcre)
851                 endif()
852                 
853                 if(WITH_CODEC_FFMPEG)
854                         set(FFMPEG ${LIBDIR}/ffmpeg)
855                         set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
856                         set(FFMPEG_LIBRARIES avcodec-53 avformat-53 avdevice-53 avutil-51 swscale-2)
857                         set(FFMPEG_LIBPATH ${FFMPEG}/lib)
858                 endif()
859
860                 if(WITH_IMAGE_OPENEXR)
861                         set(OPENEXR ${LIBDIR}/gcc/openexr)
862                         set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
863                         set(OPENEXR_LIBRARIES Half IlmImf Imath IlmThread Iex)
864                         set(OPENEXR_LIBPATH ${OPENEXR}/lib)
865                 endif()
866
867                 if(WITH_IMAGE_TIFF)
868                         set(TIFF ${LIBDIR}/gcc/tiff)
869                         set(TIFF_LIBRARY tiff)
870                         set(TIFF_INCLUDE_DIR ${TIFF}/include)
871                         set(TIFF_LIBPATH ${TIFF}/lib)
872                 endif()
873
874                 if(WITH_JACK)
875                         set(JACK ${LIBDIR}/jack)
876                         set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
877                         set(JACK_LIBRARIES jack)
878                         set(JACK_LIBPATH ${JACK}/lib)
879                         
880                         # TODO, gives linking errors, force off
881                         set(WITH_JACK OFF)
882                 endif()
883
884                 if(WITH_PYTHON)
885                         # normally cached but not since we include them with blender
886                         set(PYTHON_VERSION 3.2) #  CACHE STRING)
887                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")  # CACHE PATH)
888                         set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python32mw.lib")  # CACHE FILEPATH)
889
890                         # uncached vars
891                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
892                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
893                 endif()
894
895                 set(PLATFORM_LINKFLAGS "--stack,2097152")
896
897         endif()
898
899         # used in many places so include globally, like OpenGL
900         blender_include_dirs("${PTHREADS_INCLUDE_DIRS}")
901
902 elseif(APPLE)
903
904         if (${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
905                 set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE)
906         endif()
907
908         if(WITH_LIBS10.5)
909                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
910         else()
911                 if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
912                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
913                 else()
914                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
915                 endif()
916         endif()
917         
918
919         if(WITH_OPENAL)
920                 find_package(OpenAL)
921                 if(OPENAL_FOUND)
922                         set(WITH_OPENAL ON)
923                         set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
924                 else()
925                         set(WITH_OPENAL OFF)
926                 endif()
927         endif()
928
929         if(WITH_JACK)
930                 set(JACK /usr)
931                 set(JACK_INCLUDE_DIRS ${JACK}/include/jack)
932                 set(JACK_LIBRARIES jack)
933                 set(JACK_LIBPATH ${JACK}/lib)
934         endif()
935
936         if(WITH_CODEC_SNDFILE)
937                 set(SNDFILE ${LIBDIR}/sndfile)
938                 set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
939                 set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
940                 set(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)  # TODO, deprecate
941         endif()
942
943         if(WITH_PYTHON)
944                 # we use precompiled libraries for py 3.2 and up by default
945
946                 # normally cached but not since we include them with blender
947                 set(PYTHON_VERSION 3.2)
948                 set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
949                 # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
950                 set(PYTHON_LIBRARY python${PYTHON_VERSION})
951                 set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
952                 # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
953
954                 # uncached vars
955                 set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
956                 set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
957         endif()
958
959         if(WITH_INTERNATIONAL)
960                 set(GETTEXT ${LIBDIR}/gettext)
961                 set(GETTEXT_INC "${GETTEXT}/include")
962                 set(GETTEXT_LIB intl iconv)
963                 set(GETTEXT_LIBPATH ${GETTEXT}/lib)
964         endif()
965
966         if(WITH_FFTW3)
967                 set(FFTW3 ${LIBDIR}/fftw3)
968                 set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
969                 set(FFTW3_LIBRARIES fftw3)
970                 set(FFTW3_LIBPATH ${FFTW3}/lib)
971         endif()
972
973         set(PNG_LIBRARIES png)
974         set(JPEG_LIBRARIES jpeg)
975
976         set(ZLIB /usr)
977         set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
978         set(ZLIB_LIBRARIES z bz2)
979
980         set(FREETYPE ${LIBDIR}/freetype)
981         set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
982         set(FREETYPE_LIBPATH ${FREETYPE}/lib)
983         set(FREETYPE_LIBRARY freetype)
984
985         if(WITH_IMAGE_OPENEXR)
986                 set(OPENEXR ${LIBDIR}/openexr)
987                 set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
988                 set(OPENEXR_LIBRARIES Iex Half IlmImf Imath IlmThread)
989                 set(OPENEXR_LIBPATH ${OPENEXR}/lib)
990         endif()
991
992         if(WITH_CODEC_FFMPEG)
993                 set(FFMPEG ${LIBDIR}/ffmpeg)
994                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
995                 set(FFMPEG_LIBRARIES avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
996                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
997                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
998         endif()
999
1000         if(WITH_SAMPLERATE)
1001                 set(SAMPLERATE ${LIBDIR}/samplerate)
1002                 set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
1003                 set(SAMPLERATE_LIBRARIES samplerate)
1004                 set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
1005         endif()
1006
1007         find_library(SYSTEMSTUBS_LIBRARY 
1008                 NAMES 
1009                 SystemStubs 
1010                 PATHS
1011         )
1012         mark_as_advanced(SYSTEMSTUBS_LIBRARY)
1013         if(SYSTEMSTUBS_LIBRARY)
1014                 set(PLATFORM_LINKLIBS stdc++ SystemStubs)
1015         else()
1016                 set(PLATFORM_LINKLIBS stdc++)
1017         endif()
1018
1019         if(WITH_COCOA)
1020                 set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
1021                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
1022                 if(USE_QTKIT)
1023                         set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
1024                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
1025                         if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
1026                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1027                                 #libSDL still needs 32bit carbon quicktime 
1028                         endif()
1029                 elseif(WITH_CODEC_QUICKTIME)
1030                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1031                 endif()
1032
1033                 # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED! 
1034                 # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
1035                 if(WITH_INPUT_NDOF)
1036                         # This thread it *should* work and check the framework - campbell
1037                         # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
1038                         find_library(3D_CONNEXION_CLIENT_LIBRARY
1039                                 NAMES 3DconnexionClient
1040                         )
1041                         if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
1042                                 set(WITH_INPUT_NDOF OFF)
1043                         endif()
1044
1045                         if(WITH_INPUT_NDOF)
1046                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework 3DconnexionClient")
1047                         endif()
1048                 endif()
1049
1050         else()
1051                 set(PLATFORM_CFLAGS "-pipe -funsigned-char")
1052                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
1053                 set(WITH_INPUT_NDOF OFF)  # unsupported
1054         endif()
1055
1056         if(WITH_OPENCOLLADA)
1057                 set(OPENCOLLADA ${LIBDIR}/opencollada)
1058
1059                 set(OPENCOLLADA_INCLUDE_DIRS
1060                         ${LIBDIR}/opencollada/include/COLLADAStreamWriter
1061                         ${LIBDIR}/opencollada/include/COLLADABaseUtils
1062                         ${LIBDIR}/opencollada/include/COLLADAFramework
1063                         ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
1064                         ${LIBDIR}/opencollada/include/GeneratedSaxParser
1065                 )
1066
1067                 set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
1068                 set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa" )
1069                 #pcre is bundled with openCollada
1070                 #set(PCRE ${LIBDIR}/pcre)
1071                 #set(PCRE_LIBPATH ${PCRE}/lib)
1072                 set(PCRE_LIB pcre)
1073                 #libxml2 is used
1074                 #set(EXPAT ${LIBDIR}/expat)
1075                 #set(EXPAT_LIBPATH ${EXPAT}/lib)
1076                 set(EXPAT_LIB)
1077         endif()
1078
1079         if(WITH_SDL)
1080                 set(SDL ${LIBDIR}/sdl)
1081                 set(SDL_INCLUDE_DIR ${SDL}/include)
1082                 set(SDL_LIBRARY SDL)
1083                 set(SDL_LIBPATH ${SDL}/lib)
1084         endif()
1085
1086         set(PNG "${LIBDIR}/png")
1087         set(PNG_INCLUDE_DIR "${PNG}/include")
1088         set(PNG_LIBPATH ${PNG}/lib)
1089
1090         set(JPEG "${LIBDIR}/jpeg")
1091         set(JPEG_INCLUDE_DIR "${JPEG}/include")
1092         set(JPEG_LIBPATH ${JPEG}/lib)
1093
1094         if(WITH_IMAGE_TIFF)
1095                 set(TIFF ${LIBDIR}/tiff)
1096                 set(TIFF_INCLUDE_DIR ${TIFF}/include)
1097                 set(TIFF_LIBRARY tiff)
1098                 set(TIFF_LIBPATH ${TIFF}/lib)
1099         endif()
1100
1101         if (WITH_INPUT_NDOF)
1102                 # linker needs "-weak_framework 3DconnexionClient"
1103         endif()
1104
1105         set(EXETYPE MACOSX_BUNDLE)
1106
1107         set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
1108         set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
1109         if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
1110                 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1111                 set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1112         elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
1113                 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1114                 set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1115         else()
1116                 set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1117                 set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1118         endif()
1119 endif()
1120
1121 #-----------------------------------------------------------------------------
1122 # Common.
1123
1124 if(APPLE OR WIN32)
1125         if(NOT EXISTS "${LIBDIR}/")
1126                 message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
1127         endif()
1128 endif()
1129
1130 # See TEST_SSE_SUPPORT() for how this is defined.
1131
1132 if(WITH_RAYOPTIMIZATION)
1133         if(CMAKE_COMPILER_IS_GNUCC)
1134                 set(_sse "-msse")
1135                 set(_sse2 "-msse2")
1136         elseif(MSVC)
1137                 set(_sse "/arch:SSE")
1138                 set(_sse2 "/arch:SSE2")
1139         else()
1140                 message(WARNING "SSE flags for this compiler not known")
1141                 set(_sse)
1142                 set(_sse2)
1143         endif()
1144
1145         if(SUPPORT_SSE_BUILD)
1146                 set(PLATFORM_CFLAGS " ${_sse} ${PLATFORM_CFLAGS}")
1147                 add_definitions(-D__SSE__ -D__MMX__)
1148         endif()
1149         if(SUPPORT_SSE2_BUILD)
1150                 set(PLATFORM_CFLAGS " ${_sse2} ${PLATFORM_CFLAGS}")
1151                 add_definitions(-D__SSE2__)
1152                 if(NOT SUPPORT_SSE_BUILD) # dont double up
1153                         add_definitions(-D__MMX__)
1154                 endif()
1155         endif()
1156         unset(_sse)
1157         unset(_sse2)
1158 endif()
1159
1160 if(WITH_IMAGE_OPENJPEG)
1161         if(UNIX AND NOT APPLE)
1162                 # dealt with above
1163         else()
1164                 set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
1165         endif()
1166 endif()
1167
1168 if(WITH_IMAGE_REDCODE)
1169         set(REDCODE ${CMAKE_SOURCE_DIR}/extern)
1170         set(REDCODE_INC ${REDCODE})
1171 endif()
1172
1173 #-----------------------------------------------------------------------------
1174 # Blender WebPlugin
1175
1176 if(WITH_WEBPLUGIN) 
1177         set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
1178         set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
1179
1180         set(WITH_PLAYER ON)
1181 endif()
1182
1183
1184 #-----------------------------------------------------------------------------
1185 # Configure OpenGL.
1186 find_package(OpenGL)
1187 blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
1188 # unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake 
1189 # unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake 
1190
1191 #-----------------------------------------------------------------------------
1192 # Configure OpenMP.
1193 if(WITH_OPENMP)
1194         find_package(OpenMP)    
1195         if(OPENMP_FOUND)
1196                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
1197                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
1198
1199                 if(APPLE AND ${CMAKE_GENERATOR} MATCHES "Xcode")
1200                         set(CMAKE_XCODE_ATTRIBUTE_ENABLE_OPENMP_SUPPORT "YES")
1201                 endif()
1202         else()
1203                 set(WITH_OPENMP OFF)
1204         endif()
1205
1206         mark_as_advanced(OpenMP_C_FLAGS)
1207         mark_as_advanced(OpenMP_CXX_FLAGS)
1208 endif() 
1209
1210 #-----------------------------------------------------------------------------
1211 # Configure GLEW
1212
1213 if(WITH_BUILTIN_GLEW)
1214         # set(GLEW_LIBRARY "")  # unused
1215         set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
1216 else()
1217         find_package(GLEW)
1218
1219         if(NOT GLEW_FOUND)
1220                 message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW")
1221         endif()
1222
1223         mark_as_advanced(GLEW_LIBRARY)
1224         mark_as_advanced(GLEW_INCLUDE_PATH)
1225 endif()
1226
1227 #-----------------------------------------------------------------------------
1228 # Configure Python.
1229
1230 if(WITH_PYTHON_MODULE)
1231         add_definitions(-DPy_ENABLE_SHARED)
1232 endif() 
1233
1234 #-----------------------------------------------------------------------------
1235 # Extra compile flags
1236
1237 if((NOT WIN32) AND (NOT MSVC))
1238         # used for internal debug checks
1239         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
1240         set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
1241         
1242         # assert() checks for this.
1243         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
1244         set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
1245         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG")
1246
1247         set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
1248         set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
1249         set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DNDEBUG")
1250 endif()
1251
1252 if(CMAKE_COMPILER_IS_GNUCC)
1253
1254         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1255         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
1256         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
1257         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
1258         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
1259         # system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
1260         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes)
1261         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
1262         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1263         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1264         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
1265         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
1266         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
1267         # disable because it gives warnings for printf() & friends.
1268         # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
1269         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
1270
1271         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1272         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1273         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1274         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
1275
1276 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
1277
1278         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1279         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1280         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1281
1282         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1283         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1284         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1285
1286 endif()
1287
1288 # MSVC2010 fails to links C++ libs right
1289 if(MSVC10)
1290         if(WITH_IMAGE_OPENEXR)
1291                 message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
1292                 set(WITH_IMAGE_OPENEXR OFF)
1293         endif()
1294         if(WITH_OPENCOLLADA)
1295                 message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
1296                 set(WITH_OPENCOLLADA OFF)
1297         endif()
1298 endif()
1299
1300 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1301         if(WITH_IK_ITASC OR WITH_MOD_FLUID)
1302                 message(WARNING "Using Clang as CXX compiler: disabling WITH_IK_ITASC and WITH_MOD_FLUID, these features will be missing.")
1303                 set(WITH_IK_ITASC OFF)
1304                 set(WITH_MOD_FLUID OFF)
1305         endif()
1306 endif()
1307
1308
1309 # ensure python header is found since detection can fail, this could happen
1310 # with _any_ library but since we used a fixed python version this tends to
1311 # be most problematic.
1312 if(WITH_PYTHON)
1313         if(NOT EXISTS "${PYTHON_INCLUDE_DIR}/Python.h")
1314                 message(FATAL_ERROR "Missing: \"${PYTHON_INCLUDE_DIR}/Python.h\",\n"
1315                                                         "Set the cache entry 'PYTHON_INCLUDE_DIR' to point "
1316                                                         "to a valid python include path. Containing "
1317                                                         "Python.h for python version \"${PYTHON_VERSION}\"")
1318         endif()
1319 endif()
1320
1321
1322 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
1323 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
1324
1325 #-------------------------------------------------------------------------------
1326 # Global Defines
1327
1328 # better not set includes here but this debugging option is off by default.
1329 if(WITH_CXX_GUARDEDALLOC)
1330         include_directories(${CMAKE_SOURCE_DIR}/intern/guardedalloc)
1331 endif()
1332
1333 if(WITH_ASSERT_ABORT)
1334         add_definitions(-DWITH_ASSERT_ABORT)
1335 endif()
1336
1337 # message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
1338 # message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
1339
1340 #-----------------------------------------------------------------------------
1341 # Libraries
1342
1343 add_subdirectory(source)
1344 add_subdirectory(intern)
1345 add_subdirectory(extern)
1346
1347
1348 #-----------------------------------------------------------------------------
1349 # Blender Application
1350 if(WITH_BLENDER)
1351         add_subdirectory(source/creator)
1352 endif()
1353
1354
1355 #-----------------------------------------------------------------------------
1356 # Blender Player
1357 if(WITH_PLAYER)
1358         add_subdirectory(source/blenderplayer)
1359 endif()
1360
1361 #-----------------------------------------------------------------------------
1362 # CPack for generating packages
1363 include(build_files/cmake/packaging.cmake)
1364
1365
1366 #-----------------------------------------------------------------------------
1367 # Print Final Configuration
1368
1369 if(FIRST_RUN)
1370         set(_config_msg "\n* Blender Configuration *")
1371         macro(info_cfg_option
1372                 _setting)
1373                 set(_msg "   * ${_setting}")
1374                 string(LENGTH "${_msg}" _len)
1375                 while("28" GREATER "${_len}")
1376                         set(_msg "${_msg} ")
1377                          math(EXPR _len "${_len} + 1")
1378                 endwhile()
1379
1380                 set(_config_msg "${_config_msg}\n${_msg}${${_setting}}")
1381         endmacro()
1382
1383         macro(info_cfg_text
1384                 _text)
1385                 set(_config_msg "${_config_msg}\n\n  ${_text}")
1386                 
1387                 
1388         endmacro()
1389
1390         info_cfg_text("Build Options:")
1391         info_cfg_option(WITH_GAMEENGINE)
1392         info_cfg_option(WITH_PLAYER)
1393         info_cfg_option(WITH_BULLET)
1394         info_cfg_option(WITH_IK_ITASC)
1395         info_cfg_option(WITH_OPENCOLLADA)
1396         info_cfg_option(WITH_FFTW3)
1397         info_cfg_option(WITH_INTERNATIONAL)
1398         info_cfg_option(WITH_INPUT_NDOF)
1399
1400         info_cfg_text("Compiler Options:")
1401         info_cfg_option(WITH_BUILDINFO)
1402         info_cfg_option(WITH_OPENMP)
1403         info_cfg_option(WITH_RAYOPTIMIZATION)
1404
1405         info_cfg_text("System Options:")
1406         info_cfg_option(WITH_INSTALL_PORTABLE)
1407         info_cfg_option(WITH_X11_XINPUT)
1408         info_cfg_option(WITH_BUILTIN_GLEW)
1409
1410         info_cfg_text("Image Formats:")
1411         info_cfg_option(WITH_IMAGE_CINEON)
1412         info_cfg_option(WITH_IMAGE_DDS)
1413         info_cfg_option(WITH_IMAGE_HDR)
1414         info_cfg_option(WITH_IMAGE_OPENEXR)
1415         info_cfg_option(WITH_IMAGE_OPENJPEG)
1416         info_cfg_option(WITH_IMAGE_REDCODE)
1417         info_cfg_option(WITH_IMAGE_TIFF)
1418
1419         info_cfg_text("Audio:")
1420         info_cfg_option(WITH_OPENAL)
1421         info_cfg_option(WITH_SDL)
1422         info_cfg_option(WITH_JACK)
1423         info_cfg_option(WITH_CODEC_FFMPEG)
1424         info_cfg_option(WITH_CODEC_SNDFILE)
1425         info_cfg_option(WITH_SAMPLERATE)
1426
1427         info_cfg_text("Compression:")
1428         info_cfg_option(WITH_LZMA)
1429         info_cfg_option(WITH_LZO)
1430
1431         info_cfg_text("Python:")
1432         info_cfg_option(WITH_PYTHON_INSTALL)
1433         info_cfg_option(WITH_PYTHON_MODULE)
1434         info_cfg_option(WITH_PYTHON_SAFETY)
1435
1436         info_cfg_text("Modifiers:")
1437         info_cfg_option(WITH_MOD_BOOLEAN)
1438         info_cfg_option(WITH_MOD_DECIMATE)
1439         info_cfg_option(WITH_MOD_FLUID)
1440
1441         info_cfg_text("")
1442
1443         message("${_config_msg}")
1444 endif()