Image.gl_touch - routine to prevent the image to be cleared by blender cache garbage...
[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 (experimental, 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         set(PLATFORM_DEFAULT ON)
153 else()
154         set(PLATFORM_DEFAULT OFF)
155 endif()
156 option(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" ${PLATFORM_DEFAULT})
157 unset(PLATFORM_DEFAULT)
158
159
160 if(UNIX AND NOT APPLE)
161         option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"   ON)
162         option(WITH_X11_XF86VMODE "Enable X11 video mode switching"     ON)
163         option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
164         option(WITH_XDG_USER_DIRS    "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
165         mark_as_advanced(WITH_XDG_USER_DIRS)
166
167         # freebsd doesn't seems to support XDND
168         if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
169                 option(WITH_GHOST_XDND   "Enable drag'n'drop support on Linux using XDND protocol" ON)
170         endif()
171 else()
172         # not an option for other OS's
173         set(WITH_BUILTIN_GLEW ON)
174 endif()
175
176 # Modifiers
177 option(WITH_MOD_FLUID           "Enable Elbeem Modifier (Fluid Simulation)" ON)
178 option(WITH_MOD_SMOKE           "Enable Smoke Modifier (Smoke Simulation)" ON)
179 option(WITH_MOD_DECIMATE        "Enable Decimate Modifier" ON)
180 option(WITH_MOD_BOOLEAN         "Enable Boolean Modifier" ON)
181 option(WITH_MOD_REMESH          "Enable Remesh Modifier" ON)
182 option(WITH_MOD_CLOTH_ELTOPO    "Enable Experimental cloth solver" OFF)
183 mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
184 option(WITH_MOD_OCEANSIM        "Enable Ocean Modifier" OFF)
185
186 # Image format support
187 option(WITH_IMAGE_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
188 option(WITH_IMAGE_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
189 option(WITH_IMAGE_TIFF          "Enable LibTIFF Support" ON)
190 option(WITH_IMAGE_DDS           "Enable DDS Image Support" ON)
191 option(WITH_IMAGE_CINEON        "Enable CINEON and DPX Image Support" ON)
192 option(WITH_IMAGE_HDR           "Enable HDR Image Support" ON)
193 option(WITH_IMAGE_REDCODE       "Enable RedCode Image Support" OFF)
194 option(WITH_IMAGE_FRAMESERVER   "Enable image FrameServer Support for rendering" ON)
195
196 # Audio/Video format support
197 option(WITH_CODEC_FFMPEG        "Enable FFMPeg Support (http://ffmpeg.org)" OFF)
198
199 option(WITH_CODEC_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
200 if(APPLE OR (WIN32 AND NOT UNIX))
201         option(WITH_CODEC_QUICKTIME     "Enable Quicktime Support" OFF)
202 endif()
203
204 # 3D format support
205 # disable opencollada on non-apple unix because opencollada has no package for debian
206 option(WITH_OPENCOLLADA         "Enable OpenCollada Support (http://www.opencollada.org)"       OFF)
207
208 # Sound output
209 option(WITH_SDL           "Enable SDL for sound and joystick support" ON)
210 option(WITH_OPENAL        "Enable OpenAL Support (http://www.openal.org)" ON)
211 option(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
212
213 # Compression
214 option(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON)
215 option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)" ON)
216
217 # Camera/motion tracking
218 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
219
220 # Mesh boolean lib
221 option(WITH_CARVE         "Enable Carve library to handle mesh boolean operations" ON)
222
223 # Misc
224 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
225 option(WITH_RAYOPTIMIZATION     "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
226 if(UNIX AND NOT APPLE)
227         option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
228 endif()
229 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
230 option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
231 set(PYTHON_NUMPY_PATH            "" CACHE PATH "Python to python site-packages or dist-packages containing 'numpy' module")
232 mark_as_advanced(PYTHON_NUMPY_PATH)
233
234 option(WITH_MINGW64                   "Use the 64-bit version of MinGW" OFF)
235 mark_as_advanced(WITH_MINGW64)
236
237 # Cycles
238 option(WITH_CYCLES                                      "Enable cycles Render Engine" ON)
239 option(WITH_CYCLES_TEST                         "Build cycles test application" OFF)
240 option(WITH_CYCLES_CUDA_BINARIES        "Build cycles CUDA binaries" OFF)
241 if(WIN32 AND NOT CMAKE_CL_64 AND NOT WITH_MINGW64)
242         set(PLATFORM_DEFAULT sm_20 sm_21)
243 else()
244         set(PLATFORM_DEFAULT sm_13 sm_20 sm_21)
245 endif()
246 set(CYCLES_CUDA_BINARIES_ARCH ${PLATFORM_DEFAULT} CACHE STRING "CUDA architectures to build binaries for")
247 mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
248 unset(PLATFORM_DEFAULT)
249
250 # disable for now, but plan to support on all platforms eventually
251 option(WITH_MEM_JEMALLOC   "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
252 mark_as_advanced(WITH_MEM_JEMALLOC)
253
254 # Debug
255 option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
256 mark_as_advanced(WITH_CXX_GUARDEDALLOC)
257
258 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
259 mark_as_advanced(WITH_ASSERT_ABORT)
260
261
262 if(APPLE)
263         if(NOT CMAKE_OSX_ARCHITECTURES)
264                 set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
265                 "Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
266                 FORCE)
267         endif()
268         
269         execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
270         if (${MAC_SYS} MATCHES 11)
271                 set(OSX_SYSTEM 10.7)
272         elseif(${MAC_SYS} MATCHES 10)
273                 set(OSX_SYSTEM 10.6)
274         elseif(${MAC_SYS} MATCHES 9)
275                 set(OSX_SYSTEM 10.5)
276         else()
277                 set(OSX_SYSTEM unsupported)
278         endif()
279         message(STATUS "Detected system-version: " ${OSX_SYSTEM})
280         
281         if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
282                         set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "" FORCE) # 10.5 is our minimum target, if you have higher sdk, weak linking happens
283         endif()
284
285         if(${CMAKE_GENERATOR} MATCHES "Xcode")
286         
287                 ##### workaround for actual official cmake incompatibility with xcode 4.3 ##### 
288                 if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
289                         message("Official cmake does not yet support Xcode 4.3, get a patched version here: http://www.jensverwiebe.de/Blender/CMake%202.8-7patched.zip")
290                 endif()
291                 ### end workaround for actual official cmake incompatibility with xcode 4.3 ### 
292                 
293                 if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
294                         # Xcode 4 defaults to the Apple LLVM Compiler.
295                         # Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
296                         set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
297                         message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
298                 endif()
299         else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
300                 execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR)
301                 string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
302                 unset(XCODE_VERS_BUILD_NR)
303         endif()
304         
305         message(STATUS "Detected Xcode-version: " ${XCODE_VERSION})
306         
307         option(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
308         option(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
309         option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
310 endif()
311
312
313 #-----------------------------------------------------------------------------
314 # Check for conflicting/unsupported configurations
315
316 if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_TEST)
317         message(FATAL_ERROR "At least one of WITH_BLENDER or WITH_PLAYER must be enabled, nothing to do!")
318 endif()
319
320 if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
321         message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
322 endif()
323
324 if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK OR WITH_GAMEENGINE))
325         message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG/WITH_GAMEENGINE require WITH_AUDASPACE")
326 endif()
327
328 if(NOT WITH_SDL AND WITH_GHOST_SDL)
329         message(FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL to be ON")
330 endif()
331
332 if(WITH_IMAGE_REDCODE AND ((NOT WITH_IMAGE_OPENJPEG) OR (NOT WITH_CODEC_FFMPEG)))
333         message(FATAL_ERROR "WITH_IMAGE_REDCODE requires WITH_IMAGE_OPENJPEG and WITH_CODEC_FFMPEG")
334 endif()
335
336 # python module, needs some different options
337 if(WITH_PYTHON_MODULE AND WITH_PLAYER)
338         message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
339 endif()
340
341 if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
342         message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
343 endif()
344
345
346 if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
347         message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
348 endif()
349
350 # may as well build python module without a UI
351 if(WITH_PYTHON_MODULE)
352         set(WITH_HEADLESS ON)
353 endif()
354
355 # auto enable openimageio for cycles
356 if(WITH_CYCLES)
357         set(WITH_OPENIMAGEIO ON)
358 endif()
359
360 # auto enable boost for cycles and carve
361 if(WITH_CYCLES OR WITH_CARVE)
362         set(WITH_BOOST ON)
363 endif()
364
365 # don't store paths to libs for portable distrobution
366 if(WITH_INSTALL_PORTABLE)
367         set(CMAKE_SKIP_BUILD_RPATH TRUE)
368 endif()
369
370 if(WITH_GHOST_SDL OR WITH_HEADLESS)
371         set(WITH_GHOST_XDND OFF)
372 endif()
373
374 if(MINGW)
375         if(WITH_CODEC_QUICKTIME)
376                 message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
377                                     "because it is currently unsupported, remove this "
378                                     "line if youre a developer who wants to add support.")
379         endif()
380 endif()
381
382 TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
383
384
385 #-----------------------------------------------------------------------------
386 # Check for valid directories
387 # ... svn extern paths can be missing because of svn-git.
388
389 if(WITH_INTERNATIONAL)
390         if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
391                 message(WARNING "Translation path '${CMAKE_SOURCE_DIR}/release/datafiles/locale' is missing, "
392                                                 "This is an 'svn external', which are known not to work with bridges to other version "
393                                                 "control systems, disabling 'WITH_INTERNATIONAL'.")
394                 set(WITH_INTERNATIONAL OFF)
395         endif()
396 endif()
397
398 if(WITH_PYTHON)
399         if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons")
400                 message(WARNING "Addons path '${CMAKE_SOURCE_DIR}/release/scripts/addons' is missing, "
401                                                 "This is an 'svn external', which are known not to work with bridges to other version "
402                                                 "control systems: * CONTINUING WITHOUT ADDONS *")
403         endif()
404 endif()
405
406 #-----------------------------------------------------------------------------
407 # Initialize un-cached vars, avoid unused warning
408
409 # linux only, not cached
410 set(WITH_BINRELOC OFF)
411
412 # MAXOSX only, set to avoid uninitialized
413 set(EXETYPE "")
414
415 # C/C++ flags
416 set(PLATFORM_CFLAGS)
417
418 # these are added to later on.
419 set(C_WARNINGS)
420 set(CXX_WARNINGS)
421
422 # for gcc -Wno-blah-blah
423 set(CC_REMOVE_STRICT_FLAGS)
424
425 # libraries to link the binary with passed to target_link_libraries()
426 # known as LLIBS to scons
427 set(PLATFORM_LINKLIBS "")
428
429 # Added to linker flags in setup_liblinks
430 # - CMAKE_EXE_LINKER_FLAGS
431 # - CMAKE_EXE_LINKER_FLAGS_DEBUG
432 set(PLATFORM_LINKFLAGS "")
433 set(PLATFORM_LINKFLAGS_DEBUG "")
434
435
436 # disabled for now, not supported
437 # option(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
438
439 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
440 # On Unix:
441 #   cmake ../blender \
442 #         -D PYTHON_VERSION=3.2 \
443 #         -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
444 #         -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
445 #
446 # On Macs:
447 #   cmake ../blender \
448 #         -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
449 #         -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \
450 #         -G Xcode
451 #
452 # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
453
454 #-----------------------------------------------------------------------------
455 #Platform specifics
456
457 if(UNIX AND NOT APPLE)
458
459         # needed for ubuntu 11.04
460         if(EXISTS "/usr/lib/x86_64-linux-gnu")
461                 set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
462         endif()
463
464         # set lib directory if it exists
465         if(CMAKE_SYSTEM_NAME MATCHES "Linux")
466                 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
467                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/linux64)
468                 else()
469                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/linux)
470                 endif()
471
472                 if(NOT EXISTS ${LIBDIR})
473                         unset(LIBDIR)
474                 endif()
475         endif()
476
477         find_package(JPEG REQUIRED)
478         find_package(PNG REQUIRED)
479         find_package(ZLIB REQUIRED)
480         find_package(Freetype REQUIRED)
481
482         if(WITH_PYTHON)
483                 # No way to set py32. remove for now.
484                 # find_package(PythonLibs)
485
486                 # Use our own instead, since wothout py is such a rare case,
487                 # require this package
488                 find_package(PythonLibsUnix REQUIRED)
489         endif()
490
491
492         if(WITH_IMAGE_OPENEXR)
493                 find_package(OpenEXR)  # our own module
494                 if(NOT OPENEXR_FOUND)
495                         set(WITH_IMAGE_OPENEXR OFF)
496                 endif()
497         endif()
498
499         if(WITH_IMAGE_OPENJPEG)
500                 find_package(OpenJPEG)
501                 if(NOT OPENJPEG_FOUND)
502                         set(WITH_IMAGE_OPENJPEG OFF)
503                 endif()
504         endif()
505
506         if(WITH_IMAGE_TIFF)
507                 find_package(TIFF)
508                 if(NOT TIFF_FOUND)
509                         set(WITH_IMAGE_TIFF OFF)
510                 endif()
511         endif()
512
513         # Audio IO
514         if(WITH_OPENAL)
515                 find_package(OpenAL)
516                 if(NOT OPENAL_FOUND)
517                         set(WITH_OPENAL OFF)
518                 endif()
519         endif()
520
521         if(WITH_SDL)
522                 find_package(SDL)
523                 mark_as_advanced(
524                         SDLMAIN_LIBRARY
525                         SDL_INCLUDE_DIR
526                         SDL_LIBRARY
527                         SDL_LIBRARY_TEMP
528                 )
529                 # unset(SDLMAIN_LIBRARY CACHE)
530                 if(NOT SDL_FOUND)
531                         set(WITH_SDL OFF)
532                 endif()
533         endif()
534
535         if(WITH_JACK)
536                 find_package(Jack)
537                 if(NOT JACK_FOUND)
538                         set(WITH_JACK OFF)
539                 endif()
540         endif()
541
542         # Codecs
543         if(WITH_CODEC_SNDFILE)
544                 find_package(SndFile)
545                 if(NOT SNDFILE_FOUND)
546                         set(WITH_CODEC_SNDFILE OFF)
547                 endif()
548         endif()
549
550         if(WITH_CODEC_FFMPEG)
551                 # use lib dir if available and nothing else specified
552                 if(LIBDIR AND NOT FFMPEG)
553                         set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
554                         # XXX, some distros might need 'theoraenc theoradec' too
555                         set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale dirac_encoder mp3lame ogg orc-0.4 schroedinger-1.0 theora vorbis vorbisenc vpx x264 xvidcore faad asound CACHE STRING "FFMPEG Libraries")
556                 else()
557                         set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
558                         set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
559                 endif()
560
561                 mark_as_advanced(FFMPEG)
562                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
563                 mark_as_advanced(FFMPEG_LIBRARIES)
564                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
565                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
566         endif()
567
568         if(WITH_INTERNATIONAL)
569                 find_library(INTL_LIBRARY
570                         NAMES intl
571                         PATHS
572                         /sw/lib
573                 )
574
575                 find_library(ICONV_LIBRARY
576                         NAMES iconv
577                         PATHS
578                         /sw/lib
579                 )
580                 mark_as_advanced(
581                         ICONV_LIBRARY
582                         INTL_LIBRARY
583                 )
584
585                 if(INTL_LIBRARY AND ICONV_LIBRARY)
586                         set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY})
587                 endif()
588         endif()
589
590         if(WITH_FFTW3)
591                 find_package(Fftw3)
592                 if(NOT FFTW3_FOUND)
593                         set(WITH_FFTW3 OFF)
594                 endif()
595         endif()
596
597         if(WITH_OPENCOLLADA)
598                 find_package(OpenCOLLADA)
599                 if(OPENCOLLADA_FOUND)
600                         find_package(XML2)
601                         find_package(PCRE)
602                 else()
603                         set(WITH_OPENCOLLADA OFF)
604                 endif()
605         endif()
606
607         if(WITH_MEM_JEMALLOC)
608                 find_package(JeMalloc)
609                 if(NOT JEMALLOC_FOUND)
610                         set(WITH_MEM_JEMALLOC OFF)
611                 endif()
612         endif()
613
614         if (WITH_INPUT_NDOF)
615                 find_package(Spacenav)
616                 if(NOT SPACENAV_FOUND)
617                         set(WITH_INPUT_NDOF OFF)
618                 endif()
619
620                 # use generic names within blenders buildsystem.
621                 if(SPACENAV_FOUND)
622                         set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS})
623                         set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES})
624                 endif()
625         endif()
626
627         if(WITH_BOOST)
628                 # uses in build instructions to override include and library variables
629                 if(NOT BOOST_CUSTOM)
630                         # use lib dir if available and nothing else specified
631                         if(LIBDIR AND NOT BOOST_ROOT)
632                                 set(BOOST_ROOT ${LIBDIR}/boost)
633                                 set(Boost_USE_MULTITHREADED OFF)
634                         else()
635                                 set(Boost_USE_MULTITHREADED ON)
636                         endif()
637                         find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
638                         mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
639                 endif()
640
641                 set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
642                 set(BOOST_LIBRARIES ${Boost_LIBRARIES})
643                 set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS})
644                 set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
645         endif()
646
647         if(WITH_OPENIMAGEIO)
648                 # use lib dir if available and nothing else specified
649                 if(LIBDIR AND NOT OPENIMAGEIO_ROOT_DIR)
650                         set(OPENIMAGEIO_ROOT_DIR ${LIBDIR}/oiio)
651                 endif()
652
653                 find_package(OpenImageIO)
654
655                 set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
656                 set(OPENIMAGEIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
657                 set(OPENIMAGEIO_DEFINITIONS)
658
659                 if(NOT OPENIMAGEIO_FOUND)
660                         set(WITH_OPENIMAGEIO OFF)
661                         set(WITH_CYCLES OFF)
662                         message(STATUS "OpenImageIO not found, disabling WITH_CYCLES")
663                 endif()
664         endif()
665
666         # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
667         set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
668
669         if((NOT WITH_HEADLESS) AND (NOT WITH_GHOST_SDL))
670                 find_package(X11 REQUIRED)
671                 find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
672                 mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
673
674                 set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_X11_LIB}")
675
676                 if(WITH_X11_XINPUT)
677                         set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
678                 endif()
679
680                 if(WITH_X11_XF86VMODE)
681                         # XXX, why dont cmake make this available?
682                         FIND_LIBRARY(X11_Xxf86vmode_LIB Xxf86vm   ${X11_LIB_SEARCH_PATH})
683                         mark_as_advanced(X11_Xxf86vmode_LIB)
684                         if(X11_Xxf86vmode_LIB)
685                                 set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xxf86vmode_LIB}")
686                         else()
687                                 set(WITH_X11_XF86VMODE OFF)
688                         endif()
689                 endif()
690         endif()
691
692         if(CMAKE_SYSTEM_NAME MATCHES "Linux")
693                 if(NOT WITH_PYTHON_MODULE)
694                         # BSD's dont use libdl.so
695                 set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -ldl")
696                         # binreloc is linux only
697                         set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
698                         set(WITH_BINRELOC ON)
699                 endif()
700         endif()
701
702         set(PLATFORM_LINKFLAGS "-pthread")
703
704         # lfs on glibc, all compilers should use
705         add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
706
707         # GNU Compiler
708         if(CMAKE_COMPILER_IS_GNUCC)
709                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
710         # CLang is the same as GCC for now.
711         elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
712                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
713         # Solaris CC
714         elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") 
715                 set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
716                 
717         # Intel C++ Compiler
718         elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
719                 # think these next two are broken
720                 find_program(XIAR xiar)
721                 if(XIAR)
722                         set(CMAKE_AR "${XIAR}")
723                 endif()
724                 mark_as_advanced(XIAR)
725
726                 find_program(XILD xild)
727                 if(XILD)
728                         set(CMAKE_LINKER "${XILD}")
729                 endif()
730                 mark_as_advanced(XILD)
731
732                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
733                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel")
734
735                 # set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3")
736                 set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
737                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
738         endif()
739
740 elseif(WIN32)
741
742         # this file is included anyway when building under Windows with cl.exe
743         #  include(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
744
745         if(CMAKE_COMPILER_IS_GNUCC)
746                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
747
748                 # Setup 64bit and 64bit windows systems         
749                 if(WITH_MINGW64)
750                         message("Set 64 bit compiler for MinGW.")
751                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
752                 endif()
753         else()
754                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
755
756                 # Setup 64bit and 64bit windows systems
757                 if(CMAKE_CL_64)
758                         message("64 bit compiler detected.")
759                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
760                 endif()
761         endif()
762                 
763         add_definitions(-DWIN32)
764
765         if(WITH_INTERNATIONAL)
766                 set(ICONV ${LIBDIR}/iconv)
767                 set(ICONV_INCLUDE_DIRS ${ICONV}/include)
768                 set(ICONV_LIBRARIES iconv)
769                 set(ICONV_LIBPATH ${ICONV}/lib)
770         endif()
771
772         set(JPEG "${LIBDIR}/jpeg")
773         set(JPEG_INCLUDE_DIR "${JPEG}/include")
774         set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
775
776         set(WINTAB_INC ${LIBDIR}/wintab/include)
777
778         if(WITH_OPENAL)
779                 set(OPENAL ${LIBDIR}/openal)
780                 set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
781                 set(OPENAL_LIBRARY wrap_oal)
782                 set(OPENAL_LIBPATH ${OPENAL}/lib)
783         endif()
784
785         if(WITH_CODEC_SNDFILE)
786                 set(SNDFILE ${LIBDIR}/sndfile)
787                 set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
788                 set(SNDFILE_LIBRARIES libsndfile-1)
789                 set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
790         endif()
791
792         if(WITH_SDL)
793                 set(SDL ${LIBDIR}/sdl)
794                 set(SDL_INCLUDE_DIR ${SDL}/include)
795                 set(SDL_LIBRARY SDL)
796                 set(SDL_LIBPATH ${SDL}/lib)
797         endif()
798
799         if(WITH_CODEC_QUICKTIME)
800                 set(QUICKTIME ${LIBDIR}/QTDevWin)
801                 set(QUICKTIME_INCLUDE_DIRS ${QUICKTIME}/CIncludes)
802                 set(QUICKTIME_LIBRARIES qtmlClient)
803                 set(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
804         endif()
805
806         if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
807                 add_definitions(-D__SSE__ -D__MMX__)
808         endif()
809
810         if(MSVC)
811                 set(PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
812
813                 add_definitions(/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB)
814
815                 set(CMAKE_CXX_FLAGS "/nologo /J /Gd /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
816                 set(CMAKE_C_FLAGS   "/nologo /J /Gd"       CACHE STRING "MSVC MT C++ flags " FORCE)
817
818                 if(CMAKE_CL_64)
819                         set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /RTC1 /MTd /Zi" CACHE STRING "MSVC MT flags " FORCE)
820                 else()
821                         set(CMAKE_CXX_FLAGS_DEBUG "/Od /Gm /RTC1 /MTd /ZI" CACHE STRING "MSVC MT flags " FORCE)
822                 endif()
823                 set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /MT" CACHE STRING "MSVC MT flags " FORCE)
824                 set(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /Ob1 /MT" CACHE STRING "MSVC MT flags " FORCE)
825                 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /MT /Zi" CACHE STRING "MSVC MT flags " FORCE)
826                 if(CMAKE_CL_64)
827                         set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /RTC1 /MTd /Zi" CACHE STRING "MSVC MT flags " FORCE)
828                 else()
829                         set(CMAKE_C_FLAGS_DEBUG "/Od /Gm /RTC1 /MTd /ZI" CACHE STRING "MSVC MT flags " FORCE)
830                 endif()
831                 set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT" CACHE STRING "MSVC MT flags " FORCE)
832                 set(CMAKE_C_FLAGS_MINSIZEREL "/O1 /Ob1 /MT" CACHE STRING "MSVC MT flags " FORCE)
833                 set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Ob1 /MT /Zi" CACHE STRING "MSVC MT flags " FORCE)
834
835                 # most msvc warnings are C & C++
836                 set(_WARNINGS "/W3 /wd4018 /wd4244 /wd4305 /wd4800 /wd4181 /wd4065 /wd4267 /we4013 /wd4200")
837                 set(C_WARNINGS "${_WARNINGS}")
838                 set(CXX_WARNINGS "${_WARNINGS}")
839                 unset(_WARNINGS)
840
841                 if(WITH_INTERNATIONAL)
842                         set(GETTEXT ${LIBDIR}/gettext)
843                         set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
844                         set(GETTEXT_LIBPATH ${GETTEXT}/lib)
845                         set(GETTEXT_LIBRARIES gnu_gettext)
846                 endif()
847                 
848                 if(WITH_MOD_CLOTH_ELTOPO)
849                         set(LAPACK ${LIBDIR}/lapack)
850                         # set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
851                         set_lib_path(LAPACK_LIBPATH ${LAPACK}/lib)      
852                         set(LAPACK_LIBRARIES
853                                 ${LIBDIR}/lapack/lib/libf2c.lib
854                                 ${LIBDIR}/lapack/lib/clapack_nowrap.lib
855                                 ${LIBDIR}/lapack/lib/BLAS_nowrap.lib
856                         )
857                 endif()
858
859                 set(PNG_LIBRARIES libpng)
860                 set(JPEG_LIBRARIES libjpeg)
861                 
862                 set(PNG "${LIBDIR}/png")
863                 set(PNG_INCLUDE_DIR "${PNG}/include")
864                 set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
865
866                 set(ZLIB_INCLUDE_DIRS ${LIBDIR}/zlib/include)
867                 if(CMAKE_CL_64)
868                         set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/libz.lib)
869                 else()
870                         set(ZLIB_LIBRARIES ${LIBDIR}/zlib/lib/zlib.lib)
871                 endif()
872
873                 set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
874                 set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
875
876                 set(FREETYPE ${LIBDIR}/freetype)
877                 set(FREETYPE_INCLUDE_DIRS
878                         ${LIBDIR}/freetype/include
879                         ${LIBDIR}/freetype/include/freetype2
880                 )
881                 set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib)
882
883                 if(WITH_FFTW3)
884                         set(FFTW3 ${LIBDIR}/fftw3)
885                         set(FFTW3_LIBRARIES libfftw)
886                         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
887                         set(FFTW3_LIBPATH ${FFTW3}/lib)
888                 endif()
889
890                 if(WITH_OPENCOLLADA)
891
892                         set(OPENCOLLADA_INCLUDE_DIRS
893                                 ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
894                                 ${LIBDIR}/opencollada/include/COLLADABaseUtils/include
895                                 ${LIBDIR}/opencollada/include/COLLADAFramework/include
896                                 ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
897                                 ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
898                         )
899                         
900                         set_lib_path(OPENCOLLADA_LIBPATH "opencollada/lib")
901
902                         set(OPENCOLLADA_LIBRARIES
903                                 ${OPENCOLLADA_LIBPATH}/OpenCOLLADASaxFrameworkLoader.lib
904                                 ${OPENCOLLADA_LIBPATH}/OpenCOLLADAFramework.lib
905                                 ${OPENCOLLADA_LIBPATH}/OpenCOLLADABaseUtils.lib
906                                 ${OPENCOLLADA_LIBPATH}/OpenCOLLADAStreamWriter.lib
907                                 ${OPENCOLLADA_LIBPATH}/MathMLSolver.lib
908                                 ${OPENCOLLADA_LIBPATH}/GeneratedSaxParser.lib
909                                 ${OPENCOLLADA_LIBPATH}/xml2.lib
910                                 ${OPENCOLLADA_LIBPATH}/buffer.lib
911                                 ${OPENCOLLADA_LIBPATH}/ftoa.lib
912                                 ${OPENCOLLADA_LIBPATH}/UTF.lib
913                         )
914                         set(PCRE_LIBRARIES
915                                 ${OPENCOLLADA_LIBPATH}/pcre.lib
916                         )
917                         
918                         unset(OPENCOLLADA_LIBPATH)
919                         
920                 endif()
921
922                 if(WITH_CODEC_FFMPEG)
923                         set(FFMPEG_INCLUDE_DIRS
924                                 ${LIBDIR}/ffmpeg/include
925                                 ${LIBDIR}/ffmpeg/include/msvc
926                         )
927                         set(FFMPEG_LIBRARIES
928                                 ${LIBDIR}/ffmpeg/lib/avcodec-53.lib
929                                 ${LIBDIR}/ffmpeg/lib/avformat-53.lib
930                                 ${LIBDIR}/ffmpeg/lib/avdevice-53.lib
931                                 ${LIBDIR}/ffmpeg/lib/avutil-51.lib
932                                 ${LIBDIR}/ffmpeg/lib/swscale-2.lib
933                         )
934                 endif()
935
936                 if(WITH_IMAGE_OPENEXR)
937                         set_lib_path(OPENEXR "openexr")
938                         set_lib_path(OPENEXR_LIBPATH "openexr/lib")
939                         set(OPENEXR_LIBRARIES
940                                 ${OPENEXR_LIBPATH}/Iex.lib
941                                 ${OPENEXR_LIBPATH}/Half.lib
942                                 ${OPENEXR_LIBPATH}/IlmImf.lib
943                                 ${OPENEXR_LIBPATH}/Imath.lib
944                                 ${OPENEXR_LIBPATH}/IlmThread.lib
945                         )
946                         set_lib_path(OPENEXR_INCUDE "openexr/include")
947                         set(OPENEXR_INCLUDE_DIRS
948                                 ${OPENEXR_INCUDE}
949                                 ${OPENEXR_INCUDE}/IlmImf
950                                 ${OPENEXR_INCUDE}/Iex
951                                 ${OPENEXR_INCUDE}/Imath
952                         )
953                         unset(OPENEXR_INCUDE)
954                         unset(OPENEXR_LIBPATH)
955                 endif()
956
957                 if(WITH_IMAGE_TIFF)
958                         set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
959                         set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
960                 endif()
961
962                 if(WITH_JACK)
963                         set(JACK_INCLUDE_DIRS
964                                 ${LIBDIR}/jack/include/jack
965                                 ${LIBDIR}/jack/include
966                         )
967                         set(JACK_LIBRARIES ${LIBDIR}/jack/lib/libjack.lib)
968                 endif()
969
970                 if(WITH_PYTHON)
971                         # normally cached but not since we include them with blender
972                         set(PYTHON_VERSION 3.2) # CACHE STRING)
973                         set_lib_path(PYTHON_INCLUDE_DIR "python/include/python${PYTHON_VERSION}")
974                         set_lib_path(PYTHON_LIBRARY "python/lib/python32.lib") #CACHE FILEPATH)
975                         
976                         # uncached vars
977                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
978                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
979                 endif()
980
981                 if(WITH_BOOST)
982                         set(BOOST ${LIBDIR}/boost)
983                         set(BOOST_INCLUDE_DIR ${BOOST}/include)
984                         if(MSVC10)
985                                 set(BOOST_POSTFIX "vc100-mt-s-1_47.lib")
986                                 set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_47.lib")
987                         else()
988                                 set(BOOST_POSTFIX "vc90-mt-s-1_47.lib")
989                                 set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_47.lib")                                 
990                         endif()
991                         set(BOOST_LIBRARIES
992                                 optimized libboost_date_time-${BOOST_POSTFIX} optimized libboost_filesystem-${BOOST_POSTFIX}
993                                 optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
994                                 debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
995                                 debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
996                         if(MSVC10)
997                                 set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
998                         else()
999                                 set(BOOST_LIBPATH ${BOOST}/lib)
1000                         endif()
1001                         set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
1002                 endif()
1003                         
1004                 if(WITH_OPENIMAGEIO)
1005                         set(OPENIMAGEIO ${LIBDIR}/openimageio)
1006                         set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
1007                         set(OPENIMAGEIO_LIBRARIES OpenImageIO)
1008                         set_lib_path(OPENIMAGEIO_LIBPATH "openimageio/lib")
1009                         set(OPENIMAGEIO_DEFINITIONS)
1010                 endif()
1011
1012                 set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
1013
1014                 # MSVC only, Mingw doesnt need
1015                 if(CMAKE_CL_64)
1016                         set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
1017                 else()
1018                         set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
1019                 endif()
1020
1021                 set(PLATFORM_LINKFLAGS_DEBUG "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
1022
1023                 # used in many places so include globally, like OpenGL
1024                 blender_include_dirs("${PTHREADS_INCLUDE_DIRS}")
1025
1026         elseif(CMAKE_COMPILER_IS_GNUCC)
1027         # keep GCC specific stuff here          
1028                 set(PLATFORM_LINKLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi")
1029                 set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
1030
1031                 if(WITH_MINGW64)
1032                         #We need to take care though not to have these on debug builds because they may play funky with gdb
1033                         if(CMAKE_BUILD_TYPE MATCHES "Release")
1034                                 set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -ftree-vectorize")
1035                         endif()
1036                         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
1037                         set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
1038                         
1039                         add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
1040                 endif()
1041
1042                 add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
1043
1044
1045                 add_definitions(-DFREE_WINDOWS)
1046
1047                 if(WITH_INTERNATIONAL)
1048                         set(GETTEXT ${LIBDIR}/gettext)
1049                         set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
1050                         set(GETTEXT_LIBPATH ${GETTEXT}/lib)
1051                         set(GETTEXT_LIBRARIES intl)
1052                 endif()
1053                 
1054                 set(PNG "${LIBDIR}/png")
1055                 set(PNG_INCLUDE_DIR "${PNG}/include")
1056                 set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
1057
1058                 if(WITH_MINGW64)
1059                         set(JPEG_LIBRARIES jpeg)
1060                 else()
1061                         set(JPEG_LIBRARIES libjpeg)
1062                 endif()
1063                 set(PNG_LIBRARIES png)
1064
1065                 set(ZLIB ${LIBDIR}/zlib)
1066                 set(ZLIB_INCLUDE_DIRS ${ZLIB}/include)
1067                 set(ZLIB_LIBPATH ${ZLIB}/lib)
1068                 set(ZLIB_LIBRARIES z)
1069
1070                 #comes with own pthread library
1071                 if(NOT WITH_MINGW64)
1072                         set(PTHREADS ${LIBDIR}/pthreads)
1073                         set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
1074                         set(PTHREADS_LIBPATH ${PTHREADS}/lib)
1075                         set(PTHREADS_LIBRARIES pthreadGC2)
1076                 endif()
1077                 
1078                 set(FREETYPE ${LIBDIR}/freetype)
1079                 set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
1080                 set(FREETYPE_LIBPATH ${FREETYPE}/lib)
1081                 set(FREETYPE_LIBRARY freetype)
1082
1083                 if(WITH_FFTW3)
1084                         set(FFTW3 ${LIBDIR}/fftw3)
1085                         set(FFTW3_LIBRARIES fftw3)
1086                         set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
1087                         set(FFTW3_LIBPATH ${FFTW3}/lib)
1088                 endif()
1089
1090                 if(WITH_OPENCOLLADA)
1091                         set(OPENCOLLADA ${LIBDIR}/opencollada)
1092                         set(OPENCOLLADA_INCLUDE_DIRS
1093                                 ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
1094                                 ${LIBDIR}/opencollada/include/COLLADABaseUtils/include
1095                                 ${LIBDIR}/opencollada/include/COLLADAFramework/include
1096                                 ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
1097                                 ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
1098                         )
1099                         set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
1100                         if(WITH_MINGW64)
1101                                 set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml)
1102                         else()
1103                                 set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
1104                         endif()
1105                         set(PCRE_LIBRARIES pcre)
1106                 endif()
1107
1108                 if(WITH_CODEC_FFMPEG)
1109                         set(FFMPEG ${LIBDIR}/ffmpeg)
1110                         set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
1111                         if(WITH_MINGW64)
1112                                 set(FFMPEG_LIBRARIES avcodec.dll avformat.dll avdevice.dll avutil.dll swscale.dll swresample.dll)
1113                         else()
1114                                 set(FFMPEG_LIBRARIES avcodec-53 avformat-53 avdevice-53 avutil-51 swscale-2)
1115                         endif()
1116                         set(FFMPEG_LIBPATH ${FFMPEG}/lib)
1117                 endif()
1118
1119                 if(WITH_IMAGE_OPENEXR)
1120                         set(OPENEXR ${LIBDIR}/openexr)
1121                         set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
1122                         set(OPENEXR_LIBRARIES Half IlmImf Imath IlmThread Iex)
1123                         set(OPENEXR_LIBPATH ${OPENEXR}/lib)
1124                 endif()
1125
1126                 if(WITH_IMAGE_TIFF)
1127                         set(TIFF ${LIBDIR}/tiff)
1128                         set(TIFF_LIBRARY tiff)
1129                         set(TIFF_INCLUDE_DIR ${TIFF}/include)
1130                         set(TIFF_LIBPATH ${TIFF}/lib)
1131                 endif()
1132
1133                 if(WITH_JACK)
1134                         set(JACK ${LIBDIR}/jack)
1135                         set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
1136                         set(JACK_LIBRARIES jack)
1137                         set(JACK_LIBPATH ${JACK}/lib)
1138
1139                         # TODO, gives linking errors, force off
1140                         set(WITH_JACK OFF)
1141                 endif()
1142
1143                 if(WITH_PYTHON)
1144                         # normally cached but not since we include them with blender
1145                         set(PYTHON_VERSION 3.2) #  CACHE STRING)
1146                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")  # CACHE PATH)
1147                         set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python32mw.lib")  # CACHE FILEPATH)
1148
1149                         # uncached vars
1150                         set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
1151                         set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
1152                 endif()
1153
1154                 if(WITH_BOOST)
1155                         set(BOOST ${LIBDIR}/boost)
1156                         set(BOOST_INCLUDE_DIR ${BOOST}/include)
1157                         if(WITH_MINGW64)
1158                                 set(BOOST_POSTFIX "mgw47-mt-s-1_49")
1159                                 set(BOOST_DEBUG_POSTFIX "mgw47-mt-sd-1_49")
1160                         else()
1161                                 set(BOOST_POSTFIX "mgw46-mt-s-1_47")
1162                                 set(BOOST_DEBUG_POSTFIX "mgw46-mt-sd-1_47")
1163                         endif()         
1164                         set(BOOST_LIBRARIES
1165                                 optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
1166                                 boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
1167                                 debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
1168                                 boost_regex-${BOOST_DEBUG_POSTFIX} boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
1169                         set(BOOST_LIBPATH ${BOOST}/lib)
1170                         set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
1171                 endif()
1172                         
1173                 if(WITH_OPENIMAGEIO)
1174                         set(OPENIMAGEIO ${LIBDIR}/openimageio)
1175                         set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
1176                         set(OPENIMAGEIO_LIBRARIES OpenImageIO)
1177                         set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
1178                         set(OPENIMAGEIO_DEFINITIONS)
1179                 endif()
1180                 
1181                 set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
1182
1183                 ## DISABLE - causes linking errors 
1184                 ## for re-distrobution, so users dont need mingw installed
1185                 # set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")
1186
1187         endif()
1188
1189 elseif(APPLE)
1190
1191         if(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5" OR ${CMAKE_OSX_DEPLOYMENT_TARGET} STRGREATER "10.5")
1192                 set(WITH_LIBS10.5 ON CACHE BOOL "Use 10.5 libs" FORCE) # valid also for 10.6/10.7
1193         endif()
1194
1195         if(${XCODE_VERSION} VERSION_LESS 4.3)
1196                 set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)  # use guaranteed existing sdk
1197         else()
1198                 # note: i don't use xcode-select path on purpose, cause also /Applications/Xcode.app would be allowed
1199                 # absolute pathes are more foolproof here !
1200                 set(OSX_SYSROOT_PREFIX /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform)
1201                 set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
1202                 set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
1203         endif() 
1204         
1205         if(WITH_LIBS10.5)
1206                 set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal)
1207         else()
1208                 if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
1209                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386)
1210                 else()
1211                         set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
1212                 endif()
1213         endif()
1214
1215
1216         if(WITH_OPENAL)
1217                 find_package(OpenAL)
1218                 if(OPENAL_FOUND)
1219                         set(WITH_OPENAL ON)
1220                         set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
1221                 else()
1222                         set(WITH_OPENAL OFF)
1223                 endif()
1224         endif()
1225
1226         if(WITH_JACK)
1227                 set(JACK /usr)
1228                 set(JACK_INCLUDE_DIRS ${JACK}/include/jack)
1229                 set(JACK_LIBRARIES jack)
1230                 set(JACK_LIBPATH ${JACK}/lib)
1231         endif()
1232
1233         if(WITH_CODEC_SNDFILE)
1234                 set(SNDFILE ${LIBDIR}/sndfile)
1235                 set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
1236                 set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
1237                 set(SNDFILE_LIBPATH ${SNDFILE}/lib ${FFMPEG}/lib)  # TODO, deprecate
1238         endif()
1239
1240         if(WITH_PYTHON)
1241                 if(NOT WITH_PYTHON_MODULE)
1242                         # we use precompiled libraries for py 3.2 and up by default
1243
1244                         # normally cached but not since we include them with blender
1245                         set(PYTHON_VERSION 3.2)
1246                         set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
1247                         # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
1248                         set(PYTHON_LIBRARY python${PYTHON_VERSION})
1249                         set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
1250                         # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
1251                 else()
1252                         # module must be compiled against Python framework
1253
1254                         # normally cached but not since we include them with blender
1255                         set(PYTHON_VERSION 3.2)
1256                         set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
1257                         set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
1258                         #set(PYTHON_LIBRARY python${PYTHON_VERSION})
1259                         set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-3.2m")
1260                         #set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
1261                 endif()
1262                 
1263                 # uncached vars
1264                 set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
1265                 set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
1266         endif()
1267
1268         if(WITH_INTERNATIONAL)
1269                 set(GETTEXT ${LIBDIR}/gettext)
1270                 set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include")
1271                 set(GETTEXT_LIBRARIES intl iconv)
1272                 set(GETTEXT_LIBPATH ${GETTEXT}/lib)
1273         endif()
1274
1275         if(WITH_FFTW3)
1276                 set(FFTW3 ${LIBDIR}/fftw3)
1277                 set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
1278                 set(FFTW3_LIBRARIES fftw3)
1279                 set(FFTW3_LIBPATH ${FFTW3}/lib)
1280         endif()
1281
1282         set(PNG_LIBRARIES png)
1283         set(JPEG_LIBRARIES jpeg)
1284
1285         set(ZLIB /usr)
1286         set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
1287         set(ZLIB_LIBRARIES z bz2)
1288
1289         set(FREETYPE ${LIBDIR}/freetype)
1290         set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
1291         set(FREETYPE_LIBPATH ${FREETYPE}/lib)
1292         set(FREETYPE_LIBRARY freetype)
1293
1294         if(WITH_IMAGE_OPENEXR)
1295                 set(OPENEXR ${LIBDIR}/openexr)
1296                 set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
1297                 set(OPENEXR_LIBRARIES Iex Half IlmImf Imath IlmThread)
1298                 set(OPENEXR_LIBPATH ${OPENEXR}/lib)
1299         endif()
1300
1301         if(WITH_CODEC_FFMPEG)
1302                 set(FFMPEG ${LIBDIR}/ffmpeg)
1303                 set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
1304                 set(FFMPEG_LIBRARIES avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
1305                 set(FFMPEG_LIBPATH ${FFMPEG}/lib)
1306                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
1307         endif()
1308
1309         find_library(SYSTEMSTUBS_LIBRARY
1310                 NAMES
1311                 SystemStubs
1312                 PATHS
1313         )
1314         mark_as_advanced(SYSTEMSTUBS_LIBRARY)
1315         if(SYSTEMSTUBS_LIBRARY)
1316                 set(PLATFORM_LINKLIBS stdc++ SystemStubs)
1317         else()
1318                 set(PLATFORM_LINKLIBS stdc++)
1319         endif()
1320
1321         if(WITH_COCOA)
1322                 set(PLATFORM_CFLAGS "-pipe -funsigned-char -DGHOST_COCOA")
1323                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio")
1324                 if(USE_QTKIT)
1325                         set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DUSE_QTKIT")
1326                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
1327                         if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
1328                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1329                                 #libSDL still needs 32bit carbon quicktime
1330                         endif()
1331                 elseif(WITH_CODEC_QUICKTIME)
1332                         set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
1333                 endif()
1334
1335                 # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
1336                 # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
1337                 if(WITH_INPUT_NDOF)
1338                         # This thread it *should* work and check the framework - campbell
1339                         # http://www.cmake.org/pipermail/cmake/2005-December/007740.html
1340                         find_library(3D_CONNEXION_CLIENT_LIBRARY
1341                                 NAMES 3DconnexionClient
1342                         )
1343                         if(NOT 3D_CONNEXION_CLIENT_LIBRARY)
1344                                 set(WITH_INPUT_NDOF OFF)
1345                         endif()
1346
1347                         if(WITH_INPUT_NDOF)
1348                                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -weak_framework 3DconnexionClient")
1349                         endif()
1350                 endif()
1351
1352         else()
1353                 set(PLATFORM_CFLAGS "-pipe -funsigned-char")
1354                 set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
1355                 set(WITH_INPUT_NDOF OFF)  # unsupported
1356         endif()
1357         
1358         if(WITH_PYTHON_MODULE)
1359                 set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/python")# force cmake to link right framework
1360         endif()
1361         
1362         if(WITH_OPENCOLLADA)
1363                 set(OPENCOLLADA ${LIBDIR}/opencollada)
1364
1365                 set(OPENCOLLADA_INCLUDE_DIRS
1366                         ${LIBDIR}/opencollada/include/COLLADAStreamWriter
1367                         ${LIBDIR}/opencollada/include/COLLADABaseUtils
1368                         ${LIBDIR}/opencollada/include/COLLADAFramework
1369                         ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
1370                         ${LIBDIR}/opencollada/include/GeneratedSaxParser
1371                 )
1372
1373                 set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
1374                 set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2 -lbuffer -lftoa")
1375                 #pcre is bundled with openCollada
1376                 #set(PCRE ${LIBDIR}/pcre)
1377                 #set(PCRE_LIBPATH ${PCRE}/lib)
1378                 set(PCRE_LIBRARIES pcre)
1379                 #libxml2 is used
1380                 #set(EXPAT ${LIBDIR}/expat)
1381                 #set(EXPAT_LIBPATH ${EXPAT}/lib)
1382                 set(EXPAT_LIB)
1383         endif()
1384
1385         if(WITH_SDL)
1386                 set(SDL ${LIBDIR}/sdl)
1387                 set(SDL_INCLUDE_DIR ${SDL}/include)
1388                 set(SDL_LIBRARY SDL)
1389                 set(SDL_LIBPATH ${SDL}/lib)
1390         endif()
1391
1392         set(PNG "${LIBDIR}/png")
1393         set(PNG_INCLUDE_DIR "${PNG}/include")
1394         set(PNG_LIBPATH ${PNG}/lib)
1395
1396         set(JPEG "${LIBDIR}/jpeg")
1397         set(JPEG_INCLUDE_DIR "${JPEG}/include")
1398         set(JPEG_LIBPATH ${JPEG}/lib)
1399
1400         if(WITH_IMAGE_TIFF)
1401                 set(TIFF ${LIBDIR}/tiff)
1402                 set(TIFF_INCLUDE_DIR ${TIFF}/include)
1403                 set(TIFF_LIBRARY tiff)
1404                 set(TIFF_LIBPATH ${TIFF}/lib)
1405         endif()
1406
1407         if (WITH_INPUT_NDOF)
1408                 # linker needs "-weak_framework 3DconnexionClient"
1409         endif()
1410
1411         if(WITH_BOOST)
1412                 set(BOOST ${LIBDIR}/boost)
1413                 set(BOOST_INCLUDE_DIR ${BOOST}/include)
1414                 set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
1415                 set(BOOST_LIBPATH ${BOOST}/lib)
1416                 set(BOOST_DEFINITIONS)
1417         endif()
1418
1419         if(WITH_OPENIMAGEIO)
1420                 set(OPENIMAGEIO ${LIBDIR}/openimageio)
1421                 set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
1422                 set(OPENIMAGEIO_LIBRARIES OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
1423                 set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
1424                 set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
1425         endif()
1426
1427         set(EXETYPE MACOSX_BUNDLE)
1428
1429         set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
1430         set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
1431         if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
1432                 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1433                 set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
1434         elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
1435                 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1436                 set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
1437         else()
1438                 set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1439                 set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
1440         endif()
1441 endif()
1442
1443 #-----------------------------------------------------------------------------
1444 # Common.
1445
1446 if(APPLE OR WIN32)
1447         if(NOT EXISTS "${LIBDIR}/")
1448                 message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
1449         endif()
1450 endif()
1451
1452 # See TEST_SSE_SUPPORT() for how this is defined.
1453
1454 if(WITH_RAYOPTIMIZATION)
1455         if(SUPPORT_SSE_BUILD)
1456                 set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
1457                 add_definitions(-D__SSE__ -D__MMX__)
1458         endif()
1459         if(SUPPORT_SSE2_BUILD)
1460                 set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}")
1461                 add_definitions(-D__SSE2__)
1462                 if(NOT SUPPORT_SSE_BUILD) # dont double up
1463                         add_definitions(-D__MMX__)
1464                 endif()
1465         endif()
1466 endif()
1467
1468
1469 # set the endian define
1470 if(MSVC)
1471         # for some reason this fails on msvc
1472         add_definitions(-D__LITTLE_ENDIAN__)
1473 else()
1474         include(TestBigEndian)
1475         test_big_endian(_SYSTEM_BIG_ENDIAN)
1476         if(_SYSTEM_BIG_ENDIAN)
1477                 add_definitions(-D__BIG_ENDIAN__)
1478         else()
1479                 add_definitions(-D__LITTLE_ENDIAN__)
1480         endif()
1481         unset(_SYSTEM_BIG_ENDIAN)
1482 endif()
1483
1484
1485 if(WITH_IMAGE_OPENJPEG)
1486         if(UNIX AND NOT APPLE)
1487                 # dealt with above
1488         else()
1489                 set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
1490         endif()
1491 endif()
1492
1493 if(WITH_IMAGE_REDCODE)
1494         set(REDCODE ${CMAKE_SOURCE_DIR}/extern)
1495         set(REDCODE_INC ${REDCODE})
1496 endif()
1497
1498 #-----------------------------------------------------------------------------
1499 # Blender WebPlugin
1500
1501 if(WITH_WEBPLUGIN)
1502         set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
1503         set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
1504
1505         set(WITH_PLAYER ON)
1506 endif()
1507
1508
1509 #-----------------------------------------------------------------------------
1510 # Configure OpenGL.
1511 find_package(OpenGL)
1512 blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
1513 # unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
1514 # unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
1515
1516 #-----------------------------------------------------------------------------
1517 # Configure OpenMP.
1518 if(WITH_OPENMP)
1519         find_package(OpenMP)
1520         if(OPENMP_FOUND)
1521                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
1522                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
1523
1524                 if(APPLE AND ${CMAKE_GENERATOR} MATCHES "Xcode")
1525                         set(CMAKE_XCODE_ATTRIBUTE_ENABLE_OPENMP_SUPPORT "YES")
1526                 endif()
1527         else()
1528                 set(WITH_OPENMP OFF)
1529         endif()
1530
1531         mark_as_advanced(
1532                 OpenMP_C_FLAGS
1533                 OpenMP_CXX_FLAGS
1534         )
1535 endif()
1536
1537 #-----------------------------------------------------------------------------
1538 # Configure GLEW
1539
1540 if(WITH_BUILTIN_GLEW)
1541         # set(GLEW_LIBRARY "")  # unused
1542         set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
1543 else()
1544         find_package(GLEW)
1545
1546         if(NOT GLEW_FOUND)
1547                 message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW")
1548         endif()
1549
1550         mark_as_advanced(
1551                 GLEW_LIBRARY
1552                 GLEW_INCLUDE_PATH
1553         )
1554 endif()
1555
1556 #-----------------------------------------------------------------------------
1557 # Configure Python.
1558
1559 if(WITH_PYTHON_MODULE)
1560         add_definitions(-DPy_ENABLE_SHARED)
1561 endif()
1562
1563 #-----------------------------------------------------------------------------
1564 # Extra compile flags
1565
1566 if(CMAKE_COMPILER_IS_GNUCC)
1567
1568         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1569         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
1570         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
1571         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
1572         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
1573         # system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
1574         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes)
1575         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
1576         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1577         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1578         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
1579         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
1580
1581         # # this causes too many warnings, disable
1582         # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
1583
1584         # disable because it gives warnings for printf() & friends.
1585         # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
1586
1587         if(NOT APPLE)
1588                 ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
1589         endif()
1590
1591         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1592         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1593         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1594
1595         # # this causes too many warnings, disable
1596         # ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
1597
1598         # flags to undo strict flags
1599         ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
1600         ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER        -Wno-unused-parameter)
1601
1602         if(NOT APPLE)
1603                 ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
1604         endif()
1605
1606 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
1607
1608         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
1609         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
1610         ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
1611
1612         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
1613         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
1614         ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
1615
1616         # disable numbered, false positives
1617         set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
1618         set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
1619
1620 endif()
1621
1622 # MSVC2010 fails to links C++ libs right
1623 if(MSVC10)
1624         if(WITH_IMAGE_OPENEXR)
1625                 message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
1626         endif()
1627         if(WITH_OPENCOLLADA)
1628                 message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
1629         endif()
1630 endif()
1631
1632 # ensure python header is found since detection can fail, this could happen
1633 # with _any_ library but since we used a fixed python version this tends to
1634 # be most problematic.
1635 if(WITH_PYTHON)
1636         if(NOT EXISTS "${PYTHON_INCLUDE_DIR}/Python.h")
1637                 message(FATAL_ERROR "Missing: \"${PYTHON_INCLUDE_DIR}/Python.h\",\n"
1638                                                         "Set the cache entry 'PYTHON_INCLUDE_DIR' to point "
1639                                                         "to a valid python include path. Containing "
1640                                                         "Python.h for python version \"${PYTHON_VERSION}\"")
1641         endif()
1642
1643         if(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
1644                 # set but invalid
1645                 if(NOT ${PYTHON_NUMPY_PATH} STREQUAL "")
1646                         if(NOT EXISTS "${PYTHON_NUMPY_PATH}/numpy")
1647                                 message(WARNING "PYTHON_NUMPY_PATH is invalid, numpy not found in '${PYTHON_NUMPY_PATH}' "
1648                                                 "WITH_PYTHON_INSTALL_NUMPY option will be ignored when installing python")
1649                                 set(WITH_PYTHON_INSTALL_NUMPY OFF)
1650                         endif()
1651                 # not set, so initialize
1652                 else()
1653                         string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}")
1654                         list(GET _PY_VER_SPLIT 0 _PY_VER_MAJOR)
1655
1656                         # re-cache
1657                         unset(PYTHON_NUMPY_PATH CACHE)
1658                         find_path(PYTHON_NUMPY_PATH
1659                           NAMES
1660                             numpy
1661                           HINTS
1662                             "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
1663                             "${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
1664                           PATH_SUFFIXES
1665                             site-packages
1666                             dist-packages
1667                            NO_DEFAULT_PATH
1668                         )
1669
1670                         if(NOT EXISTS "${PYTHON_NUMPY_PATH}")
1671                                 message(WARNING "'numpy' path could not be found in:\n"
1672                                                 "'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/numpy', "
1673                                                 "'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/site-packages/numpy', "
1674                                                 "'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/dist-packages/numpy', "
1675                                                 "'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/dist-packages/numpy', "
1676                                                 "WITH_PYTHON_INSTALL_NUMPY option will be ignored when installing python")
1677                                 set(WITH_PYTHON_INSTALL_NUMPY OFF)
1678                         else()
1679                                 message(STATUS "numpy found at '${PYTHON_NUMPY_PATH}'")
1680                         endif()
1681
1682                         unset(_PY_VER_SPLIT)
1683                         unset(_PY_VER_MAJOR)
1684                 endif()
1685         endif()
1686 endif()
1687
1688
1689 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
1690 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
1691
1692 #-------------------------------------------------------------------------------
1693 # Global Defines
1694
1695 # better not set includes here but this debugging option is off by default.
1696 if(WITH_CXX_GUARDEDALLOC)
1697         include_directories(${CMAKE_SOURCE_DIR}/intern/guardedalloc)
1698 endif()
1699
1700 if(WITH_ASSERT_ABORT)
1701         add_definitions(-DWITH_ASSERT_ABORT)
1702 endif()
1703
1704 # message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
1705 # message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
1706
1707 #-----------------------------------------------------------------------------
1708 # Libraries
1709
1710 add_subdirectory(source)
1711 add_subdirectory(intern)
1712 add_subdirectory(extern)
1713
1714
1715 #-----------------------------------------------------------------------------
1716 # Blender Application
1717 if(WITH_BLENDER)
1718         add_subdirectory(source/creator)
1719 endif()
1720
1721
1722 #-----------------------------------------------------------------------------
1723 # Blender Player
1724 if(WITH_PLAYER)
1725         add_subdirectory(source/blenderplayer)
1726 endif()
1727
1728 #-----------------------------------------------------------------------------
1729 # CPack for generating packages
1730 include(build_files/cmake/packaging.cmake)
1731
1732
1733 #-----------------------------------------------------------------------------
1734 # Print Final Configuration
1735
1736 if(FIRST_RUN)
1737         set(_config_msg "\n* Blender Configuration *")
1738         macro(info_cfg_option
1739                 _setting)
1740                 set(_msg "   * ${_setting}")
1741                 string(LENGTH "${_msg}" _len)
1742                 while("32" GREATER "${_len}")
1743                         set(_msg "${_msg} ")
1744                          math(EXPR _len "${_len} + 1")
1745                 endwhile()
1746
1747                 set(_config_msg "${_config_msg}\n${_msg}${${_setting}}")
1748         endmacro()
1749
1750         macro(info_cfg_text
1751                 _text)
1752                 set(_config_msg "${_config_msg}\n\n  ${_text}")
1753
1754
1755         endmacro()
1756
1757         info_cfg_text("Build Options:")
1758         info_cfg_option(WITH_GAMEENGINE)
1759         info_cfg_option(WITH_PLAYER)
1760         info_cfg_option(WITH_BULLET)
1761         info_cfg_option(WITH_IK_ITASC)
1762         info_cfg_option(WITH_OPENCOLLADA)
1763         info_cfg_option(WITH_FFTW3)
1764         info_cfg_option(WITH_INTERNATIONAL)
1765         info_cfg_option(WITH_INPUT_NDOF)
1766         info_cfg_option(WITH_CYCLES)
1767
1768         info_cfg_text("Compiler Options:")
1769         info_cfg_option(WITH_BUILDINFO)
1770         info_cfg_option(WITH_OPENMP)
1771         info_cfg_option(WITH_RAYOPTIMIZATION)
1772
1773         info_cfg_text("System Options:")
1774         info_cfg_option(WITH_INSTALL_PORTABLE)
1775         info_cfg_option(WITH_X11_XF86VMODE)
1776         info_cfg_option(WITH_X11_XINPUT)
1777         info_cfg_option(WITH_BUILTIN_GLEW)
1778         info_cfg_option(WITH_MEM_JEMALLOC)
1779
1780         info_cfg_text("Image Formats:")
1781         info_cfg_option(WITH_IMAGE_CINEON)
1782         info_cfg_option(WITH_IMAGE_DDS)
1783         info_cfg_option(WITH_IMAGE_HDR)
1784         info_cfg_option(WITH_IMAGE_OPENEXR)
1785         info_cfg_option(WITH_IMAGE_OPENJPEG)
1786         info_cfg_option(WITH_IMAGE_REDCODE)
1787         info_cfg_option(WITH_IMAGE_TIFF)
1788
1789         info_cfg_text("Audio:")
1790         info_cfg_option(WITH_OPENAL)
1791         info_cfg_option(WITH_SDL)
1792         info_cfg_option(WITH_JACK)
1793         info_cfg_option(WITH_CODEC_FFMPEG)
1794         info_cfg_option(WITH_CODEC_SNDFILE)
1795
1796         info_cfg_text("Compression:")
1797         info_cfg_option(WITH_LZMA)
1798         info_cfg_option(WITH_LZO)
1799
1800         info_cfg_text("Python:")
1801         info_cfg_option(WITH_PYTHON_INSTALL)
1802         info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
1803         info_cfg_option(WITH_PYTHON_MODULE)
1804         info_cfg_option(WITH_PYTHON_SAFETY)
1805
1806         info_cfg_text("Modifiers:")
1807         info_cfg_option(WITH_MOD_BOOLEAN)
1808         info_cfg_option(WITH_MOD_REMESH)
1809         info_cfg_option(WITH_MOD_DECIMATE)
1810         info_cfg_option(WITH_MOD_FLUID)
1811         info_cfg_option(WITH_MOD_OCEANSIM)
1812
1813         info_cfg_text("")
1814
1815         message("${_config_msg}")
1816 endif()