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