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