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