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