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