2008-04-16 22:40:48 +00:00
# ***** BEGIN GPL LICENSE BLOCK *****
2006-11-17 02:27:12 +00:00
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
2008-04-16 22:40:48 +00:00
# of the License, or (at your option) any later version.
2006-11-17 02:27:12 +00:00
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2006-11-17 02:27:12 +00:00
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
2008-04-16 22:40:48 +00:00
# ***** END GPL LICENSE BLOCK *****
2006-11-17 02:27:12 +00:00
2006-12-13 02:57:57 +00:00
#-----------------------------------------------------------------------------
2011-09-30 15:51:58 +00:00
# We don't allow in-source builds. This causes no end of troubles because
# all out-of-source builds will use the CMakeCache.txt file there and even
2011-02-19 12:05:20 +00:00
# build the libs and objects in it.
2006-12-13 02:57:57 +00:00
2010-12-08 08:43:06 +00:00
if ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
2011-04-21 05:49:47 +00:00
if ( NOT DEFINED WITH_IN_SOURCE_BUILD )
message ( FATAL_ERROR
" C M a k e g e n e r a t i o n f o r b l e n d e r i s n o t a l l o w e d w i t h i n t h e s o u r c e d i r e c t o r y ! "
" \ n R e m o v e t h e C M a k e C a c h e . t x t f i l e a n d t r y a g a i n f r o m a n o t h e r f o l d e r , e . g . : "
" \ n "
" \ n r m C M a k e C a c h e . t x t "
" \ n c d . . "
" \ n m k d i r c m a k e - m a k e "
" \ n c d c m a k e - m a k e "
" \ n c m a k e . . / b l e n d e r "
" \ n "
" \ n A l t e r n a t e l y d e f i n e W I T H _ I N _ S O U R C E _ B U I L D t o f o r c e t h i s option ( not recommended! ) "
)
endif ( )
2010-12-08 08:43:06 +00:00
endif ( )
2006-12-13 02:57:57 +00:00
2015-11-09 15:52:29 +00:00
cmake_minimum_required ( VERSION 2.8 )
2011-06-19 13:49:20 +00:00
if ( NOT EXECUTABLE_OUTPUT_PATH )
2015-06-16 23:16:17 +00:00
set ( FIRST_RUN TRUE )
else ( )
set ( FIRST_RUN FALSE )
2011-06-19 13:49:20 +00:00
endif ( )
2011-04-05 23:31:01 +00:00
# this starts out unset
2011-06-17 02:22:38 +00:00
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules" )
2016-08-09 13:19:11 +00:00
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform" )
2011-04-05 23:31:01 +00:00
2011-06-27 13:18:08 +00:00
# avoid having empty buildtype
set ( CMAKE_BUILD_TYPE_INIT "Release" )
2010-06-07 14:28:37 +00:00
# quiet output for Makefiles, 'make -s' helps too
2010-12-08 08:43:06 +00:00
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
2010-06-07 14:28:37 +00:00
2011-10-26 00:51:29 +00:00
# global compile definitions since add_definitions() adds for all.
2015-11-09 19:30:26 +00:00
if ( NOT ( ${ CMAKE_VERSION } VERSION_LESS 3.0 ) )
set_property ( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$ < $ < C O N F I G : D e b u g > : D E B U G ; _ D E B U G >
$ < $ < C O N F I G : R e l e a s e > : N D E B U G >
$ < $ < C O N F I G : M i n S i z e R e l > : N D E B U G >
$ < $ < C O N F I G : R e l W i t h D e b I n f o > : N D E B U G >
)
else ( )
# keep until CMake-3.0 is min requirement
set_property ( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG )
set_property ( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG )
set_property ( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG )
set_property ( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG )
endif ( )
2011-10-26 00:51:29 +00:00
2011-08-22 12:24:14 +00:00
#-----------------------------------------------------------------------------
# Set policy
2015-11-09 15:52:29 +00:00
# see "cmake --help-policy CMP0003"
# So library linking is more sane
cmake_policy ( SET CMP0003 NEW )
# So BUILDINFO and BLENDERPATH strings are automatically quoted
cmake_policy ( SET CMP0005 NEW )
# So syntax problems are errors
cmake_policy ( SET CMP0010 NEW )
# Input directories must have CMakeLists.txt
cmake_policy ( SET CMP0014 NEW )
2011-08-22 12:24:14 +00:00
2011-05-23 14:56:14 +00:00
#-----------------------------------------------------------------------------
# Load some macros.
include ( build_files/cmake/macros.cmake )
2011-04-09 11:16:37 +00:00
2011-05-23 14:56:14 +00:00
#-----------------------------------------------------------------------------
# Initialize project.
2006-11-17 02:27:12 +00:00
2011-05-23 14:56:14 +00:00
blender_project_hack_pre ( )
2011-04-09 11:16:37 +00:00
2011-05-23 14:56:14 +00:00
project ( Blender )
2011-04-09 11:16:37 +00:00
2011-05-23 14:56:14 +00:00
blender_project_hack_post ( )
2011-04-09 11:16:37 +00:00
2011-01-21 00:06:30 +00:00
enable_testing ( )
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Redirect output files
2012-05-19 13:55:54 +00:00
set ( EXECUTABLE_OUTPUT_PATH ${ CMAKE_BINARY_DIR } /bin CACHE INTERNAL "" FORCE )
set ( LIBRARY_OUTPUT_PATH ${ CMAKE_BINARY_DIR } /lib CACHE INTERNAL "" FORCE )
2014-06-18 12:49:17 +00:00
set ( TESTS_OUTPUT_DIR ${ EXECUTABLE_OUTPUT_PATH } /tests CACHE INTERNAL "" FORCE )
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Set default config options
2010-06-06 13:32:58 +00:00
2010-12-08 08:43:06 +00:00
get_blender_version ( )
2010-07-14 20:26:46 +00:00
2014-11-13 22:32:01 +00:00
#-----------------------------------------------------------------------------
# Platform Specific Defaults
# list of var-names
set ( _init_vars )
# initialize to ON
macro ( option_defaults_init )
foreach ( _var ${ ARGV } )
set ( ${ _var } ON )
list ( APPEND _init_vars "${_var}" )
endforeach ( )
2015-06-16 23:16:17 +00:00
unset ( _var )
2014-11-13 22:32:01 +00:00
endmacro ( )
# remove from namespace
macro ( option_defaults_clear )
foreach ( _var ${ _init_vars } )
unset ( ${ _var } )
endforeach ( )
unset ( _var )
unset ( _init_vars )
endmacro ( )
# values to initialize WITH_****
option_defaults_init (
_ i n i t _ B U I L D I N F O
_ i n i t _ C O D E C _ F F M P E G
_ i n i t _ C Y C L E S _ O S L
2016-09-13 20:55:18 +00:00
_ i n i t _ C Y C L E S _ O P E N S U B D I V
2014-11-13 22:32:01 +00:00
_ i n i t _ I M A G E _ O P E N E X R
_ i n i t _ I N P U T _ N D O F
_ i n i t _ J A C K
_ i n i t _ O P E N C O L L A D A
_ i n i t _ O P E N C O L O R I O
_ i n i t _ S D L
_ i n i t _ F F T W 3
_ i n i t _ G A M E E N G I N E
2015-08-05 10:42:00 +00:00
_ i n i t _ O P E N S U B D I V
2014-11-13 22:32:01 +00:00
)
# customize...
2016-04-23 14:16:15 +00:00
if ( UNIX AND NOT APPLE )
2014-11-13 22:32:01 +00:00
# some of these libraries are problematic on Linux
# disable less important dependencies by default
set ( _init_CODEC_FFMPEG OFF )
set ( _init_CYCLES_OSL OFF )
2016-09-13 20:55:18 +00:00
set ( _init_CYCLES_OPENSUBDIV OFF )
2014-11-13 22:32:01 +00:00
set ( _init_IMAGE_OPENEXR OFF )
set ( _init_JACK OFF )
set ( _init_OPENCOLLADA OFF )
set ( _init_OPENCOLORIO OFF )
set ( _init_SDL OFF )
set ( _init_FFTW3 OFF )
2015-08-05 10:42:00 +00:00
set ( _init_OPENSUBDIV OFF )
2015-07-28 07:47:21 +00:00
elseif ( WIN32 )
set ( _init_JACK OFF )
elseif ( APPLE )
set ( _init_JACK OFF )
2015-08-05 10:42:00 +00:00
set ( _init_OPENSUBDIV OFF )
2014-11-13 22:32:01 +00:00
endif ( )
2014-11-26 12:24:56 +00:00
#-----------------------------------------------------------------------------
# Options
# First platform spesific non-cached vars
if ( UNIX AND NOT APPLE )
set ( WITH_X11 ON )
endif ( )
2010-06-06 13:32:58 +00:00
# Blender internal features
2011-07-13 08:15:06 +00:00
option ( WITH_BLENDER "Build blender (disable to build only the blender player)" ON )
mark_as_advanced ( WITH_BLENDER )
2011-03-11 01:24:16 +00:00
option ( WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON )
2011-04-28 06:20:47 +00:00
2011-03-11 01:24:16 +00:00
option ( WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON )
2013-06-10 00:42:16 +00:00
option ( WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON )
2011-04-06 01:51:43 +00:00
mark_as_advanced ( WITH_PYTHON ) # dont want people disabling this unless they really know what they are doing.
2012-09-28 06:45:20 +00:00
mark_as_advanced ( WITH_PYTHON_SECURITY ) # some distributions see this as a security issue, rather than have them patch it, make a build option.
2011-04-28 06:20:47 +00:00
2011-03-11 01:24:16 +00:00
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 )
2015-03-05 04:23:22 +00:00
mark_as_advanced ( WITH_PYTHON_SAFETY )
2015-03-24 08:09:51 +00:00
option ( WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF )
2013-03-24 12:13:13 +00:00
if ( APPLE )
2013-02-22 22:24:38 +00:00
option ( WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF )
endif ( )
2014-11-13 22:32:01 +00:00
option ( WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ${ _init_BUILDINFO } )
2014-08-01 17:07:41 +00:00
if ( ${ CMAKE_VERSION } VERSION_LESS 2.8.8 )
# add_library OBJECT arg unsupported
set ( WITH_BUILDINFO OFF )
endif ( )
2016-05-10 16:43:58 +00:00
set ( BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducable builds (empty string disables this option)" )
set ( BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducable builds (empty string disables this option)" )
2016-09-06 13:21:23 +00:00
set ( CPACK_OVERRIDE_PACKAGENAME "" CACHE STRING "Use instead of the standard packagename (empty string disables this option)" )
mark_as_advanced ( CPACK_OVERRIDE_PACKAGENAME )
2016-05-10 16:43:58 +00:00
mark_as_advanced ( BUILDINFO_OVERRIDE_DATE )
mark_as_advanced ( BUILDINFO_OVERRIDE_TIME )
2014-08-01 17:07:41 +00:00
2011-03-11 01:24:16 +00:00
option ( WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON )
2012-08-18 13:36:29 +00:00
option ( WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON )
2014-11-13 22:32:01 +00:00
option ( WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${ _init_FFTW3 } )
2010-12-08 08:43:06 +00:00
option ( WITH_BULLET "Enable Bullet (Physics Engine)" ON )
2013-01-03 00:23:52 +00:00
option ( WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced ( WITH_SYSTEM_BULLET )
2014-11-13 22:32:01 +00:00
option ( WITH_GAMEENGINE "Enable Game Engine" ${ _init_GAMEENGINE } )
2016-06-11 21:47:35 +00:00
if ( APPLE )
set ( WITH_GAMEENGINE_DECKLINK OFF )
else ( )
option ( WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON )
endif ( )
2010-12-08 08:43:06 +00:00
option ( WITH_PLAYER "Build Player" OFF )
2014-11-13 22:32:01 +00:00
option ( WITH_OPENCOLORIO "Enable OpenColorIO color management" ${ _init_OPENCOLORIO } )
2015-07-18 08:35:03 +00:00
# Compositor
option ( WITH_COMPOSITOR "Enable the tile based nodal compositor" ON )
2011-06-04 14:12:55 +00:00
2015-08-05 10:42:00 +00:00
option ( WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" _init_OPENSUBDIV )
2015-07-20 14:08:06 +00:00
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
option ( WITH_OPENVDB "Enable features relying on OpenVDB" OFF )
option ( WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF )
2011-07-13 06:04:54 +00:00
# GHOST Windowing Library Options
option ( WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF )
mark_as_advanced ( WITH_GHOST_DEBUG )
2011-06-23 09:27:56 +00:00
2016-01-18 09:20:08 +00:00
option ( WITH_GHOST_SDL "Enable building Blender against SDL for windowing rather than the native APIs" OFF )
2011-07-13 06:04:54 +00:00
mark_as_advanced ( WITH_GHOST_SDL )
2011-07-12 13:17:54 +00:00
2014-11-13 18:43:15 +00:00
if ( WITH_X11 )
option ( WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON )
endif ( )
2011-07-13 06:04:54 +00:00
# Misc...
2011-06-04 14:12:55 +00:00
option ( WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF )
mark_as_advanced ( WITH_HEADLESS )
2011-10-23 15:43:12 +00:00
option ( WITH_AUDASPACE "Build with blenders audio library (only disable if you know what you're doing!)" ON )
2015-06-16 08:03:35 +00:00
option ( WITH_SYSTEM_AUDASPACE "Build with external audaspace library installed on the system (only enable if you know what you're doing!)" OFF )
2011-07-13 06:04:54 +00:00
mark_as_advanced ( WITH_AUDASPACE )
2015-06-16 08:03:35 +00:00
mark_as_advanced ( WITH_SYSTEM_AUDASPACE )
if ( NOT WITH_AUDASPACE )
set ( WITH_SYSTEM_AUDASPACE OFF )
endif ( )
2011-07-13 06:04:54 +00:00
2014-04-14 09:38:34 +00:00
option ( WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON )
2015-12-02 13:09:06 +00:00
if ( UNIX AND NOT APPLE )
option ( WITH_OPENMP_STATIC "Link OpenMP statically (only used by the release environment)" OFF )
mark_as_advanced ( WITH_OPENMP_STATIC )
endif ( )
2010-06-06 13:32:58 +00:00
2014-10-07 20:46:19 +00:00
if ( WITH_X11 )
option ( WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON )
option ( WITH_X11_XF86VMODE "Enable X11 video mode switching" ON )
2016-06-09 19:07:58 +00:00
option ( WITH_X11_ALPHA "Enable X11 transparent background" ON )
2014-10-07 20:46:19 +00:00
endif ( )
if ( UNIX AND NOT APPLE )
option ( WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON )
option ( WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON )
2011-04-06 01:51:43 +00:00
else ( )
# not an option for other OS's
2012-06-23 13:42:14 +00:00
set ( WITH_SYSTEM_GLEW OFF )
2014-10-07 20:46:19 +00:00
set ( WITH_SYSTEM_GLES OFF )
2011-03-25 04:56:48 +00:00
endif ( )
2012-06-23 14:23:44 +00:00
# (unix defaults to System OpenJPEG On)
2014-11-13 22:32:01 +00:00
option ( WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF )
2012-06-23 14:23:44 +00:00
2015-03-19 04:41:41 +00:00
if ( UNIX AND NOT APPLE )
option ( WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF )
endif ( )
2012-06-23 14:23:44 +00:00
2010-10-23 15:40:13 +00:00
# Modifiers
2012-10-29 15:43:54 +00:00
option ( WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON )
option ( WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON )
option ( WITH_MOD_BOOLEAN "Enable Boolean Modifier" ON )
option ( WITH_MOD_REMESH "Enable Remesh Modifier" ON )
2012-11-27 09:52:20 +00:00
# option(WITH_MOD_CLOTH_ELTOPO "Enable Experimental cloth solver" OFF) # this is now only available in a branch
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
2011-11-13 14:16:43 +00:00
option ( WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF )
2010-10-23 15:40:13 +00:00
2010-06-06 13:32:58 +00:00
# Image format support
2014-11-13 22:32:01 +00:00
option ( WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON )
option ( WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ${ _init_IMAGE_OPENEXR } )
2010-12-08 08:43:06 +00:00
option ( WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON )
2012-04-12 08:36:07 +00:00
option ( WITH_IMAGE_TIFF "Enable LibTIFF Support" ON )
2010-12-08 08:43:06 +00:00
option ( WITH_IMAGE_DDS "Enable DDS Image Support" ON )
option ( WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON )
option ( WITH_IMAGE_HDR "Enable HDR Image Support" ON )
2011-07-21 23:06:51 +00:00
option ( WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON )
2010-06-06 13:32:58 +00:00
2010-11-30 18:52:39 +00:00
# Audio/Video format support
2012-10-08 02:51:42 +00:00
option ( WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON )
2014-11-13 22:32:01 +00:00
option ( WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${ _init_CODEC_FFMPEG } )
2010-12-08 08:43:06 +00:00
option ( WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF )
2013-11-17 08:23:18 +00:00
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
# Alembic support
option ( WITH_ALEMBIC "Enable Alembic Support" OFF )
option ( WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF )
2013-11-06 01:45:15 +00:00
if ( APPLE )
2016-11-05 13:23:00 +00:00
option ( WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF )
2010-12-08 08:43:06 +00:00
endif ( )
2006-11-17 02:27:12 +00:00
2010-06-06 13:32:58 +00:00
# 3D format support
2013-11-18 16:12:19 +00:00
# Disable opencollada when we don't have precompiled libs
2014-11-13 22:32:01 +00:00
option ( WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${ _init_OPENCOLLADA } )
2009-11-19 11:49:42 +00:00
2010-06-06 13:32:58 +00:00
# Sound output
2014-11-13 22:32:01 +00:00
option ( WITH_SDL "Enable SDL for sound and joystick support" ${ _init_SDL } )
2010-12-08 08:43:06 +00:00
option ( WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON )
2016-10-22 12:20:47 +00:00
option ( WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ${ _init_JACK } )
2013-03-27 07:19:54 +00:00
if ( UNIX AND NOT APPLE )
2016-10-22 12:20:47 +00:00
option ( WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF )
2013-03-27 07:19:54 +00:00
endif ( )
2014-11-17 11:35:36 +00:00
if ( UNIX AND NOT APPLE )
option ( WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF )
endif ( )
2010-06-06 13:32:58 +00:00
# Compression
2010-12-08 08:43:06 +00:00
option ( WITH_LZO "Enable fast LZO compression (used for pointcache)" ON )
option ( WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON )
2015-03-13 11:33:31 +00:00
if ( UNIX AND NOT APPLE )
2015-03-13 11:46:15 +00:00
option ( WITH_SYSTEM_LZO "Use the system LZO library" OFF )
2015-03-13 11:33:31 +00:00
endif ( )
2010-06-06 13:32:58 +00:00
2011-11-07 12:55:18 +00:00
# Camera/motion tracking
2015-07-18 08:35:03 +00:00
option ( WITH_LIBMV "Enable Libmv structure from motion library" ON )
2016-01-26 10:47:53 +00:00
option ( WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF )
2014-11-13 22:32:01 +00:00
mark_as_advanced ( WITH_LIBMV_SCHUR_SPECIALIZATIONS )
2011-11-07 12:55:18 +00:00
2012-12-20 07:57:26 +00:00
# Freestyle
option ( WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON )
2010-06-06 13:32:58 +00:00
# Misc
2014-12-06 23:58:17 +00:00
if ( WIN32 )
option ( WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON )
endif ( )
2014-11-13 22:32:01 +00:00
option ( WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${ _init_INPUT_NDOF } )
2011-09-30 15:51:58 +00:00
option ( WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON )
2011-03-06 11:41:30 +00:00
if ( UNIX AND NOT APPLE )
option ( WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON )
2012-11-19 19:43:03 +00:00
option ( WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF )
2013-02-23 20:42:15 +00:00
if ( WITH_STATIC_LIBS )
option ( WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF )
mark_as_advanced ( WITH_BOOST_ICU )
endif ( )
2011-03-06 11:41:30 +00:00
endif ( )
2016-03-15 12:50:44 +00:00
2010-12-08 08:43:06 +00:00
option ( WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON )
2016-03-15 12:50:44 +00:00
if ( WITH_PYTHON_INSTALL )
option ( WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON )
set ( PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module" )
mark_as_advanced ( PYTHON_NUMPY_PATH )
if ( UNIX AND NOT APPLE )
option ( WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON )
set ( PYTHON_REQUESTS_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'requests' module" )
mark_as_advanced ( PYTHON_REQUESTS_PATH )
endif ( )
endif ( )
2014-10-15 08:53:12 +00:00
option ( WITH_CPU_SSE "Enable SIMD instruction if they're detected on the host machine" ON )
mark_as_advanced ( WITH_CPU_SSE )
2012-05-01 23:22:58 +00:00
2011-04-28 13:47:27 +00:00
# Cycles
2015-07-18 08:35:03 +00:00
option ( WITH_CYCLES "Enable Cycles Render Engine" ON )
option ( WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF )
option ( WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF )
2014-11-13 22:32:01 +00:00
option ( WITH_CYCLES_OSL "Build Cycles with OSL support" ${ _init_CYCLES_OSL } )
2016-09-13 20:55:18 +00:00
option ( WITH_CYCLES_OPENSUBDIV "Build Cycles with OpenSubdiv support" ${ _init_CYCLES_OPENSUBDIV } )
2015-07-18 08:35:03 +00:00
option ( WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF )
2016-10-03 20:14:43 +00:00
set ( CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for" )
2011-11-13 14:16:43 +00:00
mark_as_advanced ( CYCLES_CUDA_BINARIES_ARCH )
2012-05-22 12:30:37 +00:00
unset ( PLATFORM_DEFAULT )
2015-07-18 08:35:03 +00:00
option ( WITH_CYCLES_LOGGING "Build Cycles with logging support" ON )
option ( WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF )
2016-03-25 15:09:05 +00:00
option ( WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF )
2014-10-04 13:00:26 +00:00
mark_as_advanced ( WITH_CYCLES_LOGGING )
mark_as_advanced ( WITH_CYCLES_DEBUG )
2016-03-25 15:09:05 +00:00
mark_as_advanced ( WITH_CYCLES_NATIVE_ONLY )
2011-04-28 13:47:27 +00:00
2016-01-14 07:24:09 +00:00
option ( WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON )
mark_as_advanced ( WITH_CUDA_DYNLOAD )
2012-10-06 11:00:45 +00:00
# LLVM
option ( WITH_LLVM "Use LLVM" OFF )
2014-08-06 10:48:06 +00:00
if ( APPLE )
option ( LLVM_STATIC "Link with LLVM static libraries" ON ) # we prefer static llvm build on Apple, dyn build possible though
else ( )
option ( LLVM_STATIC "Link with LLVM static libraries" OFF )
endif ( )
2013-04-15 16:18:35 +00:00
mark_as_advanced ( LLVM_STATIC )
2012-10-06 11:00:45 +00:00
2011-05-12 11:16:32 +00:00
# disable for now, but plan to support on all platforms eventually
2015-02-14 10:13:48 +00:00
option ( WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON )
2011-05-12 11:16:32 +00:00
mark_as_advanced ( WITH_MEM_JEMALLOC )
2013-10-03 12:22:44 +00:00
# currently only used for BLI_mempool
option ( WITH_MEM_VALGRIND "Enable extended valgrind support for better reporting" OFF )
mark_as_advanced ( WITH_MEM_VALGRIND )
2010-12-08 09:02:08 +00:00
# Debug
2011-03-11 01:24:16 +00:00
option ( WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF )
2010-12-08 09:02:08 +00:00
mark_as_advanced ( WITH_CXX_GUARDEDALLOC )
2011-01-09 15:12:08 +00:00
option ( WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF )
2010-12-15 10:22:26 +00:00
mark_as_advanced ( WITH_ASSERT_ABORT )
2013-11-21 16:38:52 +00:00
option ( WITH_BOOST "Enable features depending on boost" ON )
2013-01-31 23:25:06 +00:00
2014-06-18 12:49:17 +00:00
# Unit testsing
option ( WITH_GTESTS "Enable GTest unit testing" OFF )
2017-02-10 13:52:54 +00:00
option ( WITH_OPENGL_TESTS "Enable OpenGL related unit testing (Experimental)" OFF )
2014-06-18 12:49:17 +00:00
2014-11-13 13:07:34 +00:00
# Documentation
if ( UNIX AND NOT APPLE )
option ( WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF )
endif ( )
2014-10-07 20:46:19 +00:00
# OpenGL
2014-10-07 22:11:23 +00:00
option ( WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
2014-10-07 20:46:19 +00:00
option ( WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF )
option ( WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF )
option ( WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option ( WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF )
option ( WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF )
mark_as_advanced (
W I T H _ G L E W _ M X
W I T H _ G L E W _ E S
W I T H _ G L _ E G L
W I T H _ G L _ P R O F I L E _ C O M P A T
W I T H _ G L _ P R O F I L E _ C O R E
W I T H _ G L _ P R O F I L E _ E S 2 0
)
2014-11-13 14:03:30 +00:00
if ( WITH_GL_PROFILE_COMPAT )
2014-10-07 20:46:19 +00:00
set ( WITH_GLU ON )
else ( )
set ( WITH_GLU OFF )
endif ( )
if ( WIN32 )
option ( WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF )
mark_as_advanced ( WITH_GL_ANGLE )
endif ( )
if ( WITH_GLEW_ES AND WITH_SYSTEM_GLEW )
message ( WARNING Ignoring WITH_SYSTEM_GLEW and using WITH_GLEW_ES )
set ( WITH_SYSTEM_GLEW OFF )
endif ( )
2015-12-27 15:57:31 +00:00
if ( WIN32 )
2014-11-08 10:32:32 +00:00
getDefaultWindowsPrefixBase ( CMAKE_GENERIC_PROGRAM_FILES )
set ( CPACK_INSTALL_PREFIX ${ CMAKE_GENERIC_PROGRAM_FILES } / $ {} )
endif ( )
2016-01-29 16:43:40 +00:00
# Experimental support of C11 and C++11
2016-05-22 11:41:55 +00:00
#
# We default options to whatever default standard in the current compiler.
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0" ) AND ( NOT WITH_CXX11 ) )
set ( _c11_init ON )
set ( _cxx11_init ON )
else ( )
set ( _c11_init OFF )
set ( _cxx11_init OFF )
endif ( )
option ( WITH_C11 "Build with C11 standard enabled, for development use only!" ${ _c11_init } )
2016-01-29 16:43:40 +00:00
mark_as_advanced ( WITH_C11 )
2016-05-22 11:41:55 +00:00
option ( WITH_CXX11 "Build with C++11 standard enabled, for development use only!" ${ _cxx11_init } )
2016-03-13 04:01:52 +00:00
mark_as_advanced ( WITH_CXX11 )
2015-02-09 17:23:21 +00:00
2016-11-02 09:42:15 +00:00
# Compiler toolchain
if ( CMAKE_COMPILER_IS_GNUCC )
option ( WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON )
mark_as_advanced ( WITH_LINKER_GOLD )
endif ( )
Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 10:05:57 +00:00
# Dependency graph
option ( WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON )
2015-06-17 04:25:05 +00:00
mark_as_advanced ( WITH_LEGACY_DEPSGRAPH )
Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 10:05:57 +00:00
2017-03-05 17:05:00 +00:00
if ( WIN32 )
# Use hardcoded paths or find_package to find externals
option ( WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF )
mark_as_advanced ( WITH_WINDOWS_FIND_MODULES )
2016-08-23 14:47:23 +00:00
2017-03-05 17:05:00 +00:00
option ( WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF )
mark_as_advanced ( WITH_WINDOWS_CODESIGN )
2016-08-31 12:26:05 +00:00
2017-03-05 17:05:00 +00:00
set ( WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning." )
mark_as_advanced ( WINDOWS_CODESIGN_PFX )
2016-08-31 12:26:05 +00:00
2017-03-05 17:05:00 +00:00
set ( WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning." )
mark_as_advanced ( WINDOWS_CODESIGN_PFX_PASSWORD )
endif ( )
2016-08-31 12:26:05 +00:00
2014-11-13 22:32:01 +00:00
# avoid using again
option_defaults_clear ( )
# end option(...)
2014-11-11 20:44:26 +00:00
2014-11-08 10:32:32 +00:00
# By default we want to install to the directory we are compiling our executables
# unless specified otherwise, which we currently do not allow
2014-11-13 14:03:30 +00:00
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
2015-12-27 15:57:31 +00:00
if ( WIN32 )
2014-11-13 14:03:30 +00:00
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } /\ ${ BUILD_TYPE } CACHE PATH "default install path" FORCE )
2014-11-13 13:10:30 +00:00
elseif ( APPLE )
2014-11-13 14:03:30 +00:00
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } /\ ${ BUILD_TYPE } CACHE PATH "default install path" FORCE )
2014-11-13 13:10:30 +00:00
else ( )
2014-11-13 14:03:30 +00:00
if ( WITH_INSTALL_PORTABLE )
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } CACHE PATH "default install path" FORCE )
2014-11-13 13:10:30 +00:00
endif ( )
endif ( )
2014-11-08 10:32:32 +00:00
endif ( )
2014-11-11 20:44:26 +00:00
2014-11-08 10:32:32 +00:00
2014-10-07 20:46:19 +00:00
# Apple
2010-12-08 08:43:06 +00:00
if ( APPLE )
2016-03-10 06:56:07 +00:00
# require newer cmake on osx because of version handling,
# older cmake cannot handle 2 digit subversion!
cmake_minimum_required ( VERSION 3.0.0 )
2015-11-09 15:52:29 +00:00
2011-03-07 21:28:36 +00:00
if ( NOT CMAKE_OSX_ARCHITECTURES )
set ( CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
2016-05-18 01:58:08 +00:00
" C h o o s e t h e a r c h i t e c t u r e y o u w a n t t o b u i l d B l e n d e r f o r : i 3 8 6 , x 8 6 _ 6 4 o r p p c "
F O R C E )
2011-03-07 21:28:36 +00:00
endif ( )
2016-03-10 06:56:07 +00:00
if ( NOT DEFINED OSX_SYSTEM )
execute_process (
C O M M A N D x c o d e b u i l d - v e r s i o n - s d k m a c o s x S D K V e r s i o n
O U T P U T _ V A R I A B L E O S X _ S Y S T E M
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2013-11-15 22:20:16 +00:00
endif ( )
2016-03-10 06:56:07 +00:00
2016-05-18 01:58:08 +00:00
# workaround for incorrect cmake xcode lookup for developer previews - XCODE_VERSION does not
# take xcode-select path into account but would always look into /Applications/Xcode.app
# while dev versions are named Xcode<version>-DP<preview_number>
execute_process (
C O M M A N D x c o d e - s e l e c t - - p r i n t - p a t h
O U T P U T _ V A R I A B L E X C O D E _ C H E C K O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2013-09-13 21:13:57 +00:00
string ( REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${ XCODE_CHECK } ) # truncate to bundlepath in any case
if ( ${ CMAKE_GENERATOR } MATCHES "Xcode" )
2013-09-15 10:56:36 +00:00
2016-05-18 01:58:08 +00:00
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if ( ${ XCODE_VERSION } VERSION_GREATER 4.2 )
# reduce to XCode name without dp extension
string ( SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME )
2013-09-15 10:56:36 +00:00
if ( ${ DP_NAME } MATCHES Xcode5 )
set ( XCODE_VERSION 5 )
endif ( )
endif ( )
2013-09-13 14:57:57 +00:00
2012-11-11 18:06:10 +00:00
##### cmake incompatibility with xcode 4.3 and higher #####
2012-03-15 15:32:56 +00:00
if ( ${ XCODE_VERSION } MATCHES '' ) # cmake fails due looking for xcode in the wrong path, thus will be empty var
2012-11-11 18:06:10 +00:00
message ( FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher" )
2012-03-15 15:32:56 +00:00
endif ( )
2012-11-11 18:06:10 +00:00
### end cmake incompatibility with xcode 4.3 and higher ###
2012-03-15 15:32:56 +00:00
2012-03-14 23:42:46 +00:00
if ( ${ XCODE_VERSION } VERSION_EQUAL 4 OR ${ XCODE_VERSION } VERSION_GREATER 4 AND ${ XCODE_VERSION } VERSION_LESS 4.3 )
2012-02-20 14:19:45 +00:00
# Xcode 4 defaults to the Apple LLVM Compiler.
2012-03-14 23:42:46 +00:00
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
2012-02-20 14:19:45 +00:00
set ( CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42" )
message ( STATUS "Setting compiler to: " ${ CMAKE_XCODE_ATTRIBUTE_GCC_VERSION } )
endif ( )
2012-03-10 16:21:48 +00:00
else ( ) # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
2012-05-17 14:00:54 +00:00
execute_process ( COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR )
string ( SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION ) # truncate away build-nr
unset ( XCODE_VERS_BUILD_NR )
2012-02-02 11:08:48 +00:00
endif ( )
2015-10-10 15:30:19 +00:00
message ( STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}" )
2012-11-11 17:04:12 +00:00
if ( ${ XCODE_VERSION } VERSION_LESS 4.3 )
2016-05-18 01:58:08 +00:00
# use guaranteed existing sdk
set ( CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX ${ OSX_SYSTEM } .sdk CACHE PATH "" FORCE )
2012-11-11 17:04:12 +00:00
else ( )
2016-05-18 01:58:08 +00:00
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
2013-09-13 14:57:57 +00:00
# so i use a selfcomposed bundlepath here
set ( OSX_SYSROOT_PREFIX ${ XCODE_BUNDLE } /Contents/Developer/Platforms/MacOSX.platform )
message ( STATUS "OSX_SYSROOT_PREFIX: " ${ OSX_SYSROOT_PREFIX } )
2012-11-11 17:04:12 +00:00
set ( OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX ${ OSX_SYSTEM } .sdk ) # use guaranteed existing sdk
set ( CMAKE_OSX_SYSROOT ${ OSX_SYSROOT_PREFIX } / ${ OSX_DEVELOPER_PREFIX } CACHE PATH "" FORCE )
2014-01-23 11:34:56 +00:00
if ( ${ CMAKE_GENERATOR } MATCHES "Xcode" )
2016-05-18 01:58:08 +00:00
# to silence sdk not found warning, just overrides CMAKE_OSX_SYSROOT
set ( CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx ${ OSX_SYSTEM } )
2014-01-23 11:34:56 +00:00
endif ( )
2016-12-04 19:23:55 +00:00
# QuickTime framework is no longer available in SDK 10.12+
if ( WITH_CODEC_QUICKTIME AND ${ OSX_SYSTEM } VERSION_GREATER 10.11 )
set ( WITH_CODEC_QUICKTIME OFF )
message ( STATUS "QuickTime not supported by SDK ${OSX_SYSTEM}, disabling WITH_CODEC_QUICKTIME" )
endif ( )
2012-11-11 17:04:12 +00:00
endif ( )
2013-11-19 23:38:51 +00:00
2014-01-23 11:34:56 +00:00
if ( OSX_SYSTEM MATCHES 10.9 )
2016-05-18 01:58:08 +00:00
# make sure syslibs and headers are looked up in sdk ( expecially for 10.9 openGL atm. )
set ( CMAKE_FIND_ROOT_PATH ${ CMAKE_OSX_SYSROOT } )
2014-01-23 11:34:56 +00:00
endif ( )
2013-11-19 23:38:51 +00:00
2016-09-14 09:41:20 +00:00
if ( WITH_CXX11 )
# 10.9 is our min. target, if you use higher sdk, weak linking happens
if ( CMAKE_OSX_DEPLOYMENT_TARGET )
if ( ${ CMAKE_OSX_DEPLOYMENT_TARGET } VERSION_LESS 10.9 )
message ( STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11" )
set ( CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE )
endif ( )
else ( )
set ( CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE )
endif ( )
else ( )
if ( NOT CMAKE_OSX_DEPLOYMENT_TARGET )
# 10.6 is our min. target, if you use higher sdk, weak linking happens
set ( CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE )
endif ( )
2012-11-11 17:04:12 +00:00
endif ( )
2012-03-10 16:21:48 +00:00
2012-11-11 18:06:10 +00:00
if ( NOT ${ CMAKE_GENERATOR } MATCHES "Xcode" )
# force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else ( cmake bug ? )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
2013-05-19 16:47:41 +00:00
add_definitions ( "-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}" )
2012-11-11 18:06:10 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
endif ( )
2010-06-06 13:32:58 +00:00
2012-03-13 22:27:21 +00:00
2011-06-08 01:53:12 +00:00
#-----------------------------------------------------------------------------
# Check for conflicting/unsupported configurations
2013-08-27 02:37:48 +00:00
if ( NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" A t l e a s t o n e o f W I T H _ B L E N D E R o r W I T H _ P L A Y E R o r "
" W I T H _ C Y C L E S _ S T A N D A L O N E m u s t b e e n a b l e d , n o t h i n g t o d o ! "
)
2011-07-13 08:15:06 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
if ( NOT WITH_GAMEENGINE AND WITH_PLAYER )
message ( FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE" )
endif ( )
2006-11-17 02:27:12 +00:00
2012-11-12 04:50:45 +00:00
if ( NOT WITH_AUDASPACE )
if ( WITH_OPENAL )
message ( FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE" )
endif ( )
if ( WITH_JACK )
message ( FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE" )
endif ( )
if ( WITH_GAMEENGINE )
message ( FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE" )
endif ( )
2011-06-23 09:27:56 +00:00
endif ( )
2011-07-13 06:04:54 +00:00
if ( NOT WITH_SDL AND WITH_GHOST_SDL )
2012-11-12 04:50:45 +00:00
message ( FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL" )
2011-07-12 13:17:54 +00:00
endif ( )
2011-02-22 14:27:46 +00:00
# python module, needs some different options
if ( WITH_PYTHON_MODULE AND WITH_PLAYER )
message ( FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF" )
endif ( )
if ( WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL )
message ( FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF" )
endif ( )
2012-04-12 05:34:17 +00:00
2011-06-04 14:12:55 +00:00
# may as well build python module without a UI
if ( WITH_PYTHON_MODULE )
set ( WITH_HEADLESS ON )
endif ( )
2013-08-07 22:40:03 +00:00
if ( NOT WITH_PYTHON )
set ( WITH_CYCLES OFF )
endif ( )
2014-11-13 12:36:33 +00:00
# enable boost for cycles, audaspace or i18n
2013-01-31 23:25:06 +00:00
# otherwise if the user disabled
if ( NOT WITH_BOOST )
# Explicitly disabled. so disable all deps.
2013-04-29 00:44:33 +00:00
macro ( set_and_warn
_ s e t t i n g _ v a l )
if ( ${ ${_setting } } )
2017-01-27 04:24:58 +00:00
message ( STATUS "'WITH_BOOST' is disabled: forcing 'set(${_setting} ${_val})'" )
2013-04-29 00:49:44 +00:00
endif ( )
2013-04-29 00:44:33 +00:00
set ( ${ _setting } ${ _val } )
endmacro ( )
set_and_warn ( WITH_CYCLES OFF )
set_and_warn ( WITH_AUDASPACE OFF )
set_and_warn ( WITH_INTERNATIONAL OFF )
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
set_and_warn ( WITH_OPENVDB OFF )
2016-01-26 14:41:06 +00:00
set_and_warn ( WITH_OPENCOLORIO OFF )
set_and_warn ( WITH_MOD_BOOLEAN OFF )
2013-04-29 00:44:33 +00:00
set_and_warn ( WITH_OPENAL OFF ) # depends on AUDASPACE
set_and_warn ( WITH_GAMEENGINE OFF ) # depends on AUDASPACE
2016-01-26 14:42:53 +00:00
set_and_warn ( WITH_PLAYER OFF ) # depends on GAMEENGINE
2016-05-18 01:58:08 +00:00
elseif ( WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
W I T H _ O P E N V D B O R W I T H _ O P E N C O L O R I O O R W I T H _ M O D _ B O O L E A N )
2013-01-31 23:25:06 +00:00
# Keep enabled
else ( )
2016-02-19 09:18:38 +00:00
# New dependency graph needs either Boost or C++11 for function bindings.
2016-11-02 09:32:46 +00:00
if ( NOT WITH_CXX11 )
2016-02-19 09:18:38 +00:00
# Enabled but we don't need it
set ( WITH_BOOST OFF )
endif ( )
2011-08-16 16:15:34 +00:00
endif ( )
2013-03-27 18:44:46 +00:00
# auto enable openimageio for cycles
if ( WITH_CYCLES )
set ( WITH_OPENIMAGEIO ON )
2015-06-13 23:34:42 +00:00
# auto enable llvm for cycles_osl
if ( WITH_CYCLES_OSL )
set ( WITH_LLVM ON CACHE BOOL "" FORCE )
endif ( )
2015-06-13 23:50:33 +00:00
else ( )
set ( WITH_CYCLES_OSL OFF )
2013-03-27 18:44:46 +00:00
endif ( )
# auto enable openimageio linking dependencies
if ( WITH_OPENIMAGEIO )
set ( WITH_IMAGE_OPENEXR ON )
set ( WITH_IMAGE_TIFF ON )
endif ( )
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
# auto enable alembic linking dependencies
if ( WITH_ALEMBIC )
set ( WITH_IMAGE_OPENEXR ON )
endif ( )
2012-09-28 06:45:20 +00:00
# don't store paths to libs for portable distribution
2011-08-23 20:19:08 +00:00
if ( WITH_INSTALL_PORTABLE )
set ( CMAKE_SKIP_BUILD_RPATH TRUE )
endif ( )
2012-03-13 14:28:58 +00:00
if ( WITH_GHOST_SDL OR WITH_HEADLESS )
2014-10-07 20:46:19 +00:00
set ( WITH_X11 OFF )
set ( WITH_X11_XINPUT OFF )
2012-09-16 10:39:19 +00:00
set ( WITH_X11_XF86VMODE OFF )
2016-06-09 19:07:58 +00:00
set ( WITH_X11_ALPHA OFF )
2014-10-07 20:46:19 +00:00
set ( WITH_GHOST_XDND OFF )
2015-03-20 16:02:09 +00:00
set ( WITH_INPUT_IME OFF )
2012-03-13 14:28:58 +00:00
endif ( )
2014-10-15 08:53:12 +00:00
if ( WITH_CPU_SSE )
TEST_SSE_SUPPORT ( COMPILER_SSE_FLAG COMPILER_SSE2_FLAG )
else ( )
message ( STATUS "SSE and SSE2 optimizations are DISABLED!" )
set ( COMPILER_SSE_FLAG )
set ( COMPILER_SSE2_FLAG )
endif ( )
2012-03-13 22:27:21 +00:00
2016-03-11 08:05:44 +00:00
if ( WITH_BUILDINFO )
find_package ( Git )
if ( NOT GIT_FOUND )
2016-03-11 09:49:23 +00:00
message ( WARNING "Git was not found, disabling WITH_BUILDINFO" )
2016-03-11 08:05:44 +00:00
set ( WITH_BUILDINFO OFF )
endif ( )
endif ( )
2016-01-14 07:38:46 +00:00
TEST_SHARED_PTR_SUPPORT ( )
TEST_UNORDERED_MAP_SUPPORT ( )
2015-06-16 08:03:35 +00:00
if ( WITH_AUDASPACE )
if ( WITH_SYSTEM_AUDASPACE )
2015-07-29 14:12:46 +00:00
set ( AUDASPACE_DEFINITIONS
- D W I T H _ A U D A S P A C E
- D W I T H _ S Y S T E M _ A U D A S P A C E
" - D A U D _ D E V I C E _ H = < A U D _ D e v i c e . h > "
" - D A U D _ S P E C I A L _ H = < A U D _ S p e c i a l . h > "
" - D A U D _ S O U N D _ H = < A U D _ S o u n d . h > "
" - D A U D _ H A N D L E _ H = < A U D _ H a n d l e . h > "
" - D A U D _ S E Q U E N C E _ H = < A U D _ S e q u e n c e . h > "
" - D A U D _ T Y P E S _ H = < A U D _ T y p e s . h > "
" - D A U D _ P Y T H O N _ H = < p y t h o n / P y A P I . h > "
)
2015-06-16 08:03:35 +00:00
else ( )
set ( AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern" )
set ( AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern" )
2015-07-29 14:12:46 +00:00
set ( AUDASPACE_DEFINITIONS
- D W I T H _ A U D A S P A C E
" - D A U D _ D E V I C E _ H = < A U D _ C - A P I . h > "
" - D A U D _ S P E C I A L _ H = < A U D _ C - A P I . h > "
" - D A U D _ S O U N D _ H = < A U D _ C - A P I . h > "
" - D A U D _ H A N D L E _ H = < A U D _ C - A P I . h > "
" - D A U D _ S E Q U E N C E _ H = < A U D _ C - A P I . h > "
" - D A U D _ T Y P E S _ H = < A U D _ S p a c e . h > "
)
2015-06-16 08:03:35 +00:00
endif ( )
endif ( )
2012-03-14 00:30:20 +00:00
#-----------------------------------------------------------------------------
# Check for valid directories
2014-01-28 12:00:28 +00:00
# ... a partial checkout may cause this.
2014-02-15 20:53:53 +00:00
#
# note: we need to check for a known subdir in both cases.
# since uninitialized git submodules will give blank dirs
2012-03-14 00:30:20 +00:00
if ( WITH_INTERNATIONAL )
2014-02-15 20:53:53 +00:00
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/release/datafiles/locale/languages" )
2016-05-18 01:58:08 +00:00
message ( WARNING
" T r a n s l a t i o n p a t h ' $ { C M A K E _ S O U R C E _ D I R } / r e l e a s e / d a t a f i l e s / l o c a l e ' i s m i s s i n g , "
" T h i s i s a ' g i t s u b m o d u l e ' , w h i c h a r e k n o w n n o t t o w o r k w i t h b r i d g e s t o o t h e r v e r s i o n "
" c o n t r o l s y s t e m s , d i s a b l i n g ' W I T H _ I N T E R N A T I O N A L ' . "
)
2012-03-14 00:30:20 +00:00
set ( WITH_INTERNATIONAL OFF )
endif ( )
endif ( )
if ( WITH_PYTHON )
2014-02-15 20:53:53 +00:00
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules" )
2016-05-18 01:58:08 +00:00
message ( WARNING
" A d d o n s p a t h ' $ { C M A K E _ S O U R C E _ D I R } / r e l e a s e / s c r i p t s / a d d o n s ' i s m i s s i n g , "
" T h i s i s a ' g i t s u b m o d u l e ' , w h i c h a r e k n o w n n o t t o w o r k w i t h b r i d g e s t o o t h e r v e r s i o n "
" c o n t r o l s y s t e m s : * C O N T I N U I N G W I T H O U T A D D O N S * "
)
2012-03-14 00:30:20 +00:00
endif ( )
endif ( )
2011-02-22 06:23:07 +00:00
#-----------------------------------------------------------------------------
# Initialize un-cached vars, avoid unused warning
2011-02-21 13:13:08 +00:00
# linux only, not cached
set ( WITH_BINRELOC OFF )
2016-12-29 06:09:11 +00:00
# MACOSX only, set to avoid uninitialized
2011-10-01 19:52:33 +00:00
set ( EXETYPE "" )
2011-06-28 02:49:49 +00:00
# C/C++ flags
set ( PLATFORM_CFLAGS )
2011-06-14 00:24:50 +00:00
2011-02-22 06:23:07 +00:00
# these are added to later on.
2011-06-28 02:49:49 +00:00
set ( C_WARNINGS )
set ( CXX_WARNINGS )
2011-10-30 04:48:00 +00:00
# for gcc -Wno-blah-blah
set ( CC_REMOVE_STRICT_FLAGS )
2011-06-28 02:49:49 +00:00
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
2011-10-01 19:52:33 +00:00
set ( PLATFORM_LINKLIBS "" )
2011-06-28 02:49:49 +00:00
# Added to linker flags in setup_liblinks
# - CMAKE_EXE_LINKER_FLAGS
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
2011-10-01 19:52:33 +00:00
set ( PLATFORM_LINKFLAGS "" )
set ( PLATFORM_LINKFLAGS_DEBUG "" )
2011-02-22 06:23:07 +00:00
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
#Platform specifics
2014-10-07 20:46:19 +00:00
if ( WITH_X11 )
find_package ( X11 REQUIRED )
find_path ( X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${ X11_INC_SEARCH_PATH } )
mark_as_advanced ( X11_XF86keysym_INCLUDE_PATH )
list ( APPEND PLATFORM_LINKLIBS ${ X11_X11_LIB } )
if ( WITH_X11_XINPUT )
if ( X11_Xinput_LIB )
list ( APPEND PLATFORM_LINKLIBS ${ X11_Xinput_LIB } )
else ( )
set ( WITH_X11_XINPUT OFF )
endif ( )
endif ( )
if ( WITH_X11_XF86VMODE )
# XXX, why dont cmake make this available?
find_library ( X11_Xxf86vmode_LIB Xxf86vm ${ X11_LIB_SEARCH_PATH } )
mark_as_advanced ( X11_Xxf86vmode_LIB )
if ( X11_Xxf86vmode_LIB )
list ( APPEND PLATFORM_LINKLIBS ${ X11_Xxf86vmode_LIB } )
else ( )
set ( WITH_X11_XF86VMODE OFF )
endif ( )
endif ( )
2016-06-09 19:07:58 +00:00
if ( WITH_X11_ALPHA )
find_library ( X11_Xrender_LIB Xrender ${ X11_LIB_SEARCH_PATH } )
mark_as_advanced ( X11_Xrender_LIB )
2017-03-11 15:40:04 +00:00
if ( X11_Xrender_LIB )
2016-06-09 19:07:58 +00:00
list ( APPEND PLATFORM_LINKLIBS ${ X11_Xrender_LIB } )
else ( )
set ( WITH_X11_ALPHA OFF )
endif ( )
endif ( )
2014-10-07 20:46:19 +00:00
endif ( )
2015-07-28 07:47:21 +00:00
# ----------------------------------------------------------------------------
# Main Platform Checks
#
# - UNIX
# - WIN32
# - APPLE
2010-12-08 08:43:06 +00:00
if ( UNIX AND NOT APPLE )
2016-08-09 13:19:11 +00:00
include ( platform_unix )
2010-12-08 08:43:06 +00:00
elseif ( WIN32 )
2016-08-09 13:19:11 +00:00
include ( platform_win32 )
2010-12-08 08:43:06 +00:00
elseif ( APPLE )
2016-08-09 13:19:11 +00:00
include ( platform_apple )
2010-12-08 08:43:06 +00:00
endif ( )
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Common.
2010-08-11 08:23:48 +00:00
2012-12-05 15:46:31 +00:00
if ( NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM )
message ( FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON" )
endif ( )
2012-07-01 15:26:25 +00:00
if ( WITH_CYCLES )
if ( NOT WITH_OPENIMAGEIO )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" C y c l e s r e q u i r e s W I T H _ O P E N I M A G E I O , t h e l i b r a r y m a y n o t h a v e b e e n f o u n d . "
" C o n f i g u r e O I I O o r d i s a b l e W I T H _ C Y C L E S "
)
2012-07-01 15:26:25 +00:00
endif ( )
if ( NOT WITH_BOOST )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" C y c l e s r e q u i r e s W I T H _ B O O S T , t h e l i b r a r y m a y n o t h a v e b e e n f o u n d . "
" C o n f i g u r e B O O S T o r d i s a b l e W I T H _ C Y C L E S "
)
2012-07-01 15:26:25 +00:00
endif ( )
2012-10-06 11:00:45 +00:00
2012-11-15 17:16:27 +00:00
if ( WITH_CYCLES_OSL )
2012-10-06 11:00:45 +00:00
if ( NOT WITH_LLVM )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" C y c l e s O S L r e q u i r e s W I T H _ L L V M , t h e l i b r a r y m a y n o t h a v e b e e n f o u n d . "
" C o n f i g u r e L L V M o r d i s a b l e W I T H _ C Y C L E S _ O S L "
)
2012-10-06 11:00:45 +00:00
endif ( )
endif ( )
2012-07-01 15:26:25 +00:00
endif ( )
2012-11-11 16:54:26 +00:00
if ( WITH_INTERNATIONAL )
if ( NOT WITH_BOOST )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" I n t e r n a t i o n a l i z a t i o n r e q u i r e s W I T H _ B O O S T , t h e l i b r a r y m a y n o t h a v e b e e n f o u n d . "
" C o n f i g u r e B O O S T o r d i s a b l e W I T H _ I N T E R N A T I O N A L "
)
2012-11-11 16:54:26 +00:00
endif ( )
endif ( )
2012-07-01 15:26:25 +00:00
2011-08-01 06:11:41 +00:00
# See TEST_SSE_SUPPORT() for how this is defined.
2016-05-05 17:25:08 +00:00
# Do it globally, SSE2 is required for quite some time now.
# Doing it now allows to use SSE/SSE2 in inline headers.
if ( SUPPORT_SSE_BUILD )
set ( PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}" )
add_definitions ( -D__SSE__ -D__MMX__ )
endif ( )
if ( SUPPORT_SSE2_BUILD )
2016-10-19 16:06:45 +00:00
set ( PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}" )
2016-05-05 17:25:08 +00:00
add_definitions ( -D__SSE2__ )
if ( NOT SUPPORT_SSE_BUILD ) # dont double up
add_definitions ( -D__MMX__ )
2010-12-08 08:43:06 +00:00
endif ( )
endif ( )
2011-09-19 08:02:17 +00:00
# set the endian define
2012-08-07 12:03:43 +00:00
if ( MSVC )
2011-09-27 01:32:27 +00:00
# for some reason this fails on msvc
2011-09-19 08:02:17 +00:00
add_definitions ( -D__LITTLE_ENDIAN__ )
2012-08-07 13:51:19 +00:00
# OSX-Note: as we do crosscompiling with specific set architecture,
# endianess-detection and autosetting is counterproductive
# so we just set endianess according CMAKE_OSX_ARCHITECTURES
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64 )
add_definitions ( -D__LITTLE_ENDIAN__ )
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64 )
add_definitions ( -D__BIG_ENDIAN__ )
2011-09-27 01:32:27 +00:00
else ( )
include ( TestBigEndian )
test_big_endian ( _SYSTEM_BIG_ENDIAN )
if ( _SYSTEM_BIG_ENDIAN )
add_definitions ( -D__BIG_ENDIAN__ )
else ( )
add_definitions ( -D__LITTLE_ENDIAN__ )
endif ( )
unset ( _SYSTEM_BIG_ENDIAN )
2011-09-19 08:02:17 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
if ( WITH_IMAGE_OPENJPEG )
2012-06-23 14:23:44 +00:00
if ( WITH_SYSTEM_OPENJPEG )
2011-06-19 07:46:24 +00:00
# dealt with above
2015-09-16 14:08:26 +00:00
set ( OPENJPEG_DEFINES "" )
2011-02-15 19:04:51 +00:00
else ( )
2011-06-19 07:46:24 +00:00
set ( OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg" )
2015-09-16 14:08:26 +00:00
set ( OPENJPEG_DEFINES "-DOPJ_STATIC" )
2011-02-15 19:04:51 +00:00
endif ( )
2015-09-17 09:17:00 +00:00
# Special handling of Windows platform where openjpeg is always static.
if ( WIN32 )
set ( OPENJPEG_DEFINES "-DOPJ_STATIC" )
endif ( )
2010-12-08 08:43:06 +00:00
endif ( )
2006-11-17 02:27:12 +00:00
2015-03-19 04:41:41 +00:00
if ( NOT WITH_SYSTEM_EIGEN3 )
set ( EIGEN3_INCLUDE_DIRS ${ CMAKE_SOURCE_DIR } /extern/Eigen3 )
endif ( )
2008-10-07 17:13:35 +00:00
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Configure OpenGL.
2014-10-07 20:46:19 +00:00
2010-12-08 08:43:06 +00:00
find_package ( OpenGL )
2011-06-08 05:39:58 +00:00
blender_include_dirs_sys ( "${OPENGL_INCLUDE_DIR}" )
2014-10-07 20:46:19 +00:00
if ( WITH_GLU )
list ( APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}" )
list ( APPEND GL_DEFINITIONS -DWITH_GLU )
endif ( )
if ( WITH_SYSTEM_GLES )
find_package_wrapper ( OpenGLES )
endif ( )
if ( WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE )
list ( APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}" )
elseif ( WITH_GL_PROFILE_ES20 )
if ( WITH_SYSTEM_GLES )
if ( NOT OPENGLES_LIBRARY )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" U n a b l e t o f i n d O p e n G L E S l i b r a r i e s . "
" I n s t a l l t h e m o r d i s a b l e W I T H _ S Y S T E M _ G L E S . "
)
2014-10-07 20:46:19 +00:00
endif ( )
list ( APPEND BLENDER_GL_LIBRARIES OPENGLES_LIBRARY )
else ( )
set ( OPENGLES_LIBRARY "" CACHE FILEPATH "OpenGL ES 2.0 library file" )
mark_as_advanced ( OPENGLES_LIBRARY )
list ( APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}" )
2014-11-13 14:03:30 +00:00
if ( NOT OPENGLES_LIBRARY )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" T o c o m p i l e W I T H _ G L _ E G L y o u n e e d t o s e t O P E N G L E S _ L I B R A R Y "
" t o t h e f i l e p a t h o f a n O p e n G L E S 2 . 0 l i b r a r y . "
)
2014-10-07 20:46:19 +00:00
endif ( )
endif ( )
if ( WIN32 )
# Setup paths to files needed to install and redistribute Windows Blender with OpenGL ES
set ( OPENGLES_DLL "" CACHE FILEPATH "OpenGL ES 2.0 redistributable DLL file" )
mark_as_advanced ( OPENGLES_DLL )
if ( NOT OPENGLES_DLL )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" T o c o m p i l e W I T H _ G L _ P R O F I L E _ E S 2 0 y o u n e e d t o s e t O P E N G L E S _ D L L t o t h e f i l e "
" p a t h o f a n O p e n G L E S 2 . 0 r u n t i m e d y n a m i c l i n k library ( DLL ) . "
)
2014-10-07 20:46:19 +00:00
endif ( )
if ( WITH_GL_ANGLE )
list ( APPEND GL_DEFINITIONS -DWITH_ANGLE )
set ( D3DCOMPILER_DLL "" CACHE FILEPATH "Direct3D Compiler redistributable DLL file (needed by ANGLE)" )
get_filename_component ( D3DCOMPILER_FILENAME "${D3DCOMPILER_DLL}" NAME )
list ( APPEND GL_DEFINITIONS "-DD3DCOMPILER=\" \\\"${D3DCOMPILER_FILENAME}\\\"\"")
mark_as_advanced ( D3DCOMPILER_DLL )
2014-11-13 14:03:30 +00:00
if ( D3DCOMPILER_DLL STREQUAL "" )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" T o c o m p i l e W I T H _ G L _ A N G L E y o u n e e d t o s e t D 3 D C O M P I L E R _ D L L t o t h e f i l e "
" p a t h o f a c o p y o f t h e D i r e c t X r e d i s t r i b u t a b l e D L L f i l e : D 3 D C o m p i l e r _ 4 6 . d l l "
)
2014-10-07 20:46:19 +00:00
endif ( )
endif ( )
endif ( )
endif ( )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DWITH_GL_EGL )
if ( WITH_SYSTEM_GLES )
if ( NOT OPENGLES_EGL_LIBRARY )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" U n a b l e t o f i n d O p e n G L E S l i b r a r i e s . "
" I n s t a l l t h e m o r d i s a b l e W I T H _ S Y S T E M _ G L E S . "
)
2014-10-07 20:46:19 +00:00
endif ( )
list ( APPEND BLENDER_GL_LIBRARIES OPENGLES_EGL_LIBRARY )
else ( )
set ( OPENGLES_EGL_LIBRARY "" CACHE FILEPATH "EGL library file" )
mark_as_advanced ( OPENGLES_EGL_LIBRARY )
list ( APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}" "${OPENGLES_EGL_LIBRARY}" )
2014-11-13 14:03:30 +00:00
if ( NOT OPENGLES_EGL_LIBRARY )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" T o c o m p i l e W I T H _ G L _ E G L y o u n e e d t o s e t O P E N G L E S _ E G L _ L I B R A R Y "
" t o t h e f i l e p a t h o f a n E G L l i b r a r y . "
)
2014-10-07 20:46:19 +00:00
endif ( )
endif ( )
if ( WIN32 )
# Setup paths to files needed to install and redistribute Windows Blender with OpenGL ES
set ( OPENGLES_EGL_DLL "" CACHE FILEPATH "EGL redistributable DLL file" )
mark_as_advanced ( OPENGLES_EGL_DLL )
if ( NOT OPENGLES_EGL_DLL )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" T o c o m p i l e W I T H _ G L _ E G L y o u n e e d t o s e t O P E N G L E S _ E G L _ D L L "
" t o t h e f i l e p a t h o f a n E G L r u n t i m e d y n a m i c l i n k library ( DLL ) . "
)
2014-10-07 20:46:19 +00:00
endif ( )
endif ( )
endif ( )
if ( WITH_GL_PROFILE_COMPAT )
list ( APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT )
endif ( )
if ( WITH_GL_PROFILE_CORE )
list ( APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE )
endif ( )
if ( WITH_GL_PROFILE_ES20 )
list ( APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20 )
endif ( )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DWITH_EGL )
endif ( )
2009-10-19 16:20:12 +00:00
2010-11-19 11:33:12 +00:00
#-----------------------------------------------------------------------------
# Configure OpenMP.
2014-07-07 22:29:53 +00:00
if ( WITH_OPENMP )
2011-09-30 15:51:58 +00:00
find_package ( OpenMP )
2010-12-08 08:43:06 +00:00
if ( OPENMP_FOUND )
2015-12-02 13:09:06 +00:00
if ( NOT WITH_OPENMP_STATIC )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
else ( )
# Typically avoid adding flags as defines but we can't
2016-01-05 14:41:08 +00:00
# pass OpenMP flags to the linker for static builds, meaning
2015-12-02 13:09:06 +00:00
# we can't add any OpenMP related flags to CFLAGS variables
# since they're passed to the linker as well.
add_definitions ( "${OpenMP_C_FLAGS}" )
2015-12-03 10:34:41 +00:00
find_library_static ( OpenMP_LIBRARIES gomp ${ CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES } )
2015-12-02 13:09:06 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
else ( )
set ( WITH_OPENMP OFF )
endif ( )
2010-12-21 03:32:51 +00:00
2011-09-30 15:51:58 +00:00
mark_as_advanced (
O p e n M P _ C _ F L A G S
O p e n M P _ C X X _ F L A G S
)
endif ( )
2010-11-19 11:33:12 +00:00
2011-04-05 23:31:01 +00:00
#-----------------------------------------------------------------------------
# Configure GLEW
2014-10-07 20:46:19 +00:00
if ( WITH_GLEW_MX )
list ( APPEND GL_DEFINITIONS -DWITH_GLEW_MX )
endif ( )
2012-06-23 13:42:14 +00:00
if ( WITH_SYSTEM_GLEW )
2011-04-05 23:31:01 +00:00
find_package ( GLEW )
2014-10-07 20:46:19 +00:00
# Note: There is an assumption here that the system GLEW is not a static library.
2011-04-05 23:31:01 +00:00
if ( NOT GLEW_FOUND )
2014-10-07 20:46:19 +00:00
message ( FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW." )
2011-04-05 23:31:01 +00:00
endif ( )
2014-10-07 20:46:19 +00:00
if ( WITH_GLEW_MX )
set ( BLENDER_GLEW_LIBRARIES ${ GLEW_MX_LIBRARY } )
else ( )
set ( BLENDER_GLEW_LIBRARIES ${ GLEW_LIBRARY } )
endif ( )
2012-06-23 13:42:14 +00:00
else ( )
2014-10-07 20:46:19 +00:00
if ( WITH_GLEW_ES )
set ( GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include" )
list ( APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES )
# These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
if ( NOT WITH_GL_PROFILE_ES20 )
# No ES functions are needed
list ( APPEND GL_DEFINITIONS -DGLEW_NO_ES )
elseif ( NOT ( WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT ) )
# ES is enabled, but the other functions are all disabled
list ( APPEND GL_DEFINITIONS -DGLEW_ES_ONLY )
endif ( )
if ( WITH_GL_PROFILE_ES20 )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DGLEW_USE_LIB_ES20 )
endif ( )
# ToDo: This is an experiment to eliminate ES 1 symbols,
# GLEW doesn't really properly provide this level of control
# (for example, without modification it eliminates too many symbols)
# so there are lots of modifications to GLEW to make this work,
# and no attempt to make it work beyond Blender at this point.
list ( APPEND GL_DEFINITIONS -DGL_ES_VERSION_1_0=0 -DGL_ES_VERSION_CL_1_1=0 -DGL_ES_VERSION_CM_1_1=0 )
endif ( )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DGLEW_INC_EGL )
endif ( )
set ( BLENDER_GLEW_LIBRARIES extern_glew_es bf_intern_glew_mx )
else ( )
set ( GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include" )
list ( APPEND GL_DEFINITIONS -DGLEW_STATIC )
# This won't affect the non-experimental glew library,
# but is used for conditional compilation elsewhere.
list ( APPEND GL_DEFINITIONS -DGLEW_NO_ES )
set ( BLENDER_GLEW_LIBRARIES extern_glew )
endif ( )
2011-04-05 23:31:01 +00:00
endif ( )
2014-10-07 20:46:19 +00:00
if ( NOT WITH_GLU )
list ( APPEND GL_DEFINITIONS -DGLEW_NO_GLU )
endif ( )
2013-01-03 00:23:52 +00:00
#-----------------------------------------------------------------------------
# Configure Bullet
if ( WITH_BULLET AND WITH_SYSTEM_BULLET )
find_package ( Bullet )
if ( NOT BULLET_FOUND )
set ( WITH_BULLET OFF )
endif ( )
else ( )
set ( BULLET_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/bullet2/src" )
# set(BULLET_LIBRARIES "")
endif ( )
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
2011-03-24 00:14:49 +00:00
# Configure Python.
if ( WITH_PYTHON_MODULE )
add_definitions ( -DPy_ENABLE_SHARED )
2011-09-30 15:51:58 +00:00
endif ( )
2011-03-24 00:14:49 +00:00
2016-01-04 11:47:36 +00:00
#-----------------------------------------------------------------------------
# Configure GLog/GFlags
if ( WITH_LIBMV OR WITH_GTESTS OR ( WITH_CYCLES AND WITH_CYCLES_LOGGING ) )
set ( GLOG_DEFINES
- D G O O G L E _ G L O G _ D L L _ D E C L =
)
set ( GFLAGS_DEFINES
- D G F L A G S _ D L L _ D E F I N E _ F L A G =
- D G F L A G S _ D L L _ D E C L A R E _ F L A G =
- D G F L A G S _ D L L _ D E C L =
)
endif ( )
2016-01-04 13:11:12 +00:00
#-----------------------------------------------------------------------------
# Configure Ceres
if ( WITH_LIBMV )
set ( CERES_DEFINES )
2016-05-16 18:03:59 +00:00
if ( WITH_CXX11 )
# nothing to be done
elseif ( SHARED_PTR_FOUND )
2016-01-04 13:11:12 +00:00
if ( SHARED_PTR_TR1_MEMORY_HEADER )
list ( APPEND CERES_DEFINES -DCERES_TR1_MEMORY_HEADER )
endif ( )
if ( SHARED_PTR_TR1_NAMESPACE )
list ( APPEND CERES_DEFINES -DCERES_TR1_SHARED_PTR )
endif ( )
else ( )
message ( FATAL_ERROR "Ceres: Unable to find shared_ptr." )
endif ( )
2016-05-16 18:03:59 +00:00
if ( WITH_CXX11 )
list ( APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP )
elseif ( HAVE_STD_UNORDERED_MAP_HEADER )
2016-01-04 13:11:12 +00:00
if ( HAVE_UNORDERED_MAP_IN_STD_NAMESPACE )
list ( APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP )
else ( )
if ( HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE )
list ( APPEND CERES_DEFINES -DCERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE )
else ( )
list ( APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP )
message ( STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)" )
endif ( )
endif ( )
else ( )
if ( HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE )
list ( APPEND CERES_DEFINES -DCERES_TR1_UNORDERED_MAP )
else ( )
list ( APPEND CERES_DEFINES -DCERES_NO_UNORDERED_MAP )
message ( STATUS "Ceres: Replacing unordered_map/set with map/set (warning: slower!)" )
endif ( )
endif ( )
endif ( )
2011-03-24 00:14:49 +00:00
#-----------------------------------------------------------------------------
2006-11-17 02:27:12 +00:00
# Extra compile flags
2010-10-18 12:35:40 +00:00
2010-12-08 08:43:06 +00:00
if ( CMAKE_COMPILER_IS_GNUCC )
2010-12-16 09:55:35 +00:00
2010-12-21 03:32:51 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ALL -Wall )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration )
2012-09-15 01:52:28 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type )
2015-11-22 16:12:54 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_VLA -Werror=vla )
2011-03-15 22:30:07 +00:00
# system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
2012-09-15 01:52:28 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_MISSING_PROTOTYPES -Wmissing-prototypes )
2010-12-21 03:32:51 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings )
2012-09-16 01:35:00 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_LOGICAL_OP -Wlogical-op )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNDEF -Wundef )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_INIT_SELF -Winit-self ) # needs -Wuninitialized
2012-09-20 01:02:39 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_NULL -Wnonnull ) # C only
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero )
2013-07-19 10:39:25 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits )
2015-04-24 09:11:02 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness )
2011-09-26 09:43:35 +00:00
2012-10-20 13:29:07 +00:00
# gcc 4.2 gives annoying warnings on every file with this
2013-03-24 12:13:13 +00:00
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3" )
2012-10-20 13:29:07 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized )
endif ( )
2013-03-14 13:00:00 +00:00
# versions before gcc4.6 give many BLI_math warnings
2013-03-24 12:13:13 +00:00
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6" )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_REDUNDANT_DECLS -Wredundant-decls )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS -Wredundant-decls )
2013-03-14 13:00:00 +00:00
endif ( )
2015-11-23 04:45:52 +00:00
# versions before gcc4.8 include global name-space.
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.8" )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_SHADOW -Wshadow )
endif ( )
2011-04-03 10:04:16 +00:00
# disable because it gives warnings for printf() & friends.
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
2012-01-01 16:46:08 +00:00
if ( NOT APPLE )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable )
endif ( )
2010-12-21 03:32:51 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_ALL -Wall )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare )
2012-09-16 01:35:00 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_LOGICAL_OP -Wlogical-op )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self ) # needs -Wuninitialized
2012-09-20 01:02:39 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero )
2013-07-19 10:39:25 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits )
2015-03-27 10:55:58 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_ERROR_RETURN_TYPE -Werror=return-type )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_POINTER_ARITH -Wpointer-arith )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_UNUSED_PARAMETER -Wunused-parameter )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_UNDEF -Wundef )
2015-04-24 09:11:02 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness )
2012-10-01 16:45:50 +00:00
2012-10-20 13:29:07 +00:00
# gcc 4.2 gives annoying warnings on every file with this
2013-03-24 12:13:13 +00:00
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3" )
2012-10-20 13:29:07 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized )
endif ( )
2012-10-01 16:45:50 +00:00
# causes too many warnings
if ( NOT APPLE )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_UNDEF -Wundef )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations )
endif ( )
2010-12-16 09:55:35 +00:00
2011-10-30 04:48:00 +00:00
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations )
2011-11-01 00:34:09 +00:00
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter )
2012-01-01 16:46:08 +00:00
if ( NOT APPLE )
2012-01-01 22:23:08 +00:00
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable )
2012-01-01 16:46:08 +00:00
endif ( )
2011-10-30 04:48:00 +00:00
2013-12-02 00:36:33 +00:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
2012-06-11 12:13:41 +00:00
2014-07-08 21:35:04 +00:00
if ( APPLE AND WITH_OPENMP ) # we need the Intel omp lib linked here to not fail all tests due presence of -fopenmp !
set ( CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5" ) # these are only used for the checks
endif ( )
2012-09-15 01:52:28 +00:00
# strange, clang complains these are not supported, but then yses them.
2012-06-11 12:13:41 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ALL -Wall )
2013-02-26 21:58:06 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type )
2012-06-11 12:13:41 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts )
2012-09-15 01:52:28 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_STRICT_PROTOTYPES -Wstrict-prototypes )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_MISSING_PROTOTYPES -Wmissing-prototypes )
2013-02-26 21:58:06 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter )
2012-06-11 12:13:41 +00:00
2012-09-20 09:19:49 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_ALL -Wall )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_OVERLOADED_VIRTUAL -Wno-overloaded-virtual ) # we get a lot of these, if its a problem a dev needs to look into it.
2013-02-26 21:58:06 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare )
2012-09-20 09:19:49 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof )
2013-02-26 21:58:06 +00:00
# gives too many unfixable warnings
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
2012-06-11 12:13:41 +00:00
2013-03-14 07:25:54 +00:00
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros )
2013-07-15 08:26:16 +00:00
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations )
2013-11-22 00:30:40 +00:00
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers )
2013-07-15 08:26:16 +00:00
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef )
ADD_CHECK_C_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn )
ADD_CHECK_CXX_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field )
ADD_CHECK_CXX_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing )
ADD_CHECK_CXX_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor )
ADD_CHECK_CXX_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros )
ADD_CHECK_CXX_COMPILER_FLAG ( CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder )
2010-12-16 09:55:35 +00:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "Intel" )
2010-12-21 03:32:51 +00:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ALL -Wall )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas )
2010-12-16 09:55:35 +00:00
2010-12-21 03:32:51 +00:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_ALL -Wall )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare )
2010-12-16 09:55:35 +00:00
2011-10-01 21:09:42 +00:00
# disable numbered, false positives
set ( C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556" )
set ( CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556" )
2014-11-08 20:17:04 +00:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "MSVC" )
# most msvc warnings are C & C++
set ( _WARNINGS
# warning level:
" / W 3 "
" / w 3 4 0 6 2 " # switch statement contains 'default' but no 'case' labels
# disable:
" / w d 4 0 1 8 " # signed/unsigned mismatch
2015-12-21 03:54:36 +00:00
" / w d 4 1 4 6 " # unary minus operator applied to unsigned type, result still unsigned
2014-11-08 20:17:04 +00:00
" / w d 4 0 6 5 " # switch statement contains 'default' but no 'case' labels
" / w d 4 1 2 7 " # conditional expression is constant
" / w d 4 1 8 1 " # qualifier applied to reference type; ignored
" / w d 4 2 0 0 " # zero-sized array in struct/union
" / w d 4 2 4 4 " # conversion from 'type1' to 'type2', possible loss of data
" / w d 4 2 6 7 " # conversion from 'size_t' to 'type', possible loss of data
" / w d 4 3 0 5 " # truncation from 'type1' to 'type2'
" / w d 4 8 0 0 " # forcing value to bool 'true' or 'false'
# errors:
" / w e 4 0 1 3 " # 'function' undefined; assuming extern returning int
" / w e 4 4 3 1 " # missing type specifier - int assumed
)
2011-10-01 21:09:42 +00:00
2014-11-08 20:17:04 +00:00
string ( REPLACE ";" " " _WARNINGS "${_WARNINGS}" )
set ( C_WARNINGS "${_WARNINGS}" )
set ( CXX_WARNINGS "${_WARNINGS}" )
unset ( _WARNINGS )
2010-12-08 08:43:06 +00:00
endif ( )
2010-10-17 06:38:56 +00:00
2011-07-16 06:55:45 +00:00
# ensure python header is found since detection can fail, this could happen
# with _any_ library but since we used a fixed python version this tends to
# be most problematic.
if ( WITH_PYTHON )
if ( NOT EXISTS "${PYTHON_INCLUDE_DIR}/Python.h" )
2016-05-18 01:58:08 +00:00
message ( FATAL_ERROR
" M i s s i n g : \ " $ { P Y T H O N _ I N C L U D E _ D I R } / P y t h o n . h \ " , \ n "
" S e t t h e c a c h e e n t r y ' P Y T H O N _ I N C L U D E _ D I R ' t o p o i n t "
" t o a v a l i d p y t h o n i n c l u d e p a t h . C o n t a i n i n g "
" P y t h o n . h f o r p y t h o n v e r s i o n \ " $ { P Y T H O N _ V E R S I O N } \ " "
)
2011-07-16 06:55:45 +00:00
endif ( )
2012-04-30 09:38:32 +00:00
2016-02-01 09:39:16 +00:00
if ( WIN32 OR APPLE )
2014-03-04 13:20:11 +00:00
# pass, we have this in an archive to extract
elseif ( WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY )
2014-07-28 14:42:30 +00:00
find_python_package ( numpy )
2012-04-30 09:38:32 +00:00
endif ( )
2014-03-04 18:39:53 +00:00
if ( WIN32 OR APPLE )
# pass, we have this in lib/python/site-packages
elseif ( WITH_PYTHON_INSTALL_REQUESTS )
2014-07-28 14:42:30 +00:00
find_python_package ( requests )
2014-03-04 18:39:53 +00:00
endif ( )
2011-07-16 06:55:45 +00:00
endif ( )
2016-03-13 04:01:52 +00:00
if ( WITH_CXX11 )
2015-02-09 17:23:21 +00:00
if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" )
2016-05-22 11:41:55 +00:00
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
2015-02-09 17:23:21 +00:00
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
2016-12-24 17:37:10 +00:00
elseif ( MSVC )
2015-02-09 17:23:21 +00:00
# Nothing special is needed, C++11 features are available by default.
else ( )
message ( FATAL_ERROR "Compiler ${CMAKE_C_COMPILER_ID} is not supported for C++11 build yet" )
endif ( )
2016-05-22 11:41:55 +00:00
else ( )
# GCC-6 switched to C++11 by default, which would break linking with existing libraries
# by default. So we explicitly disable C++11 for a new GCC so no linking issues happens.
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0" ) )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98" )
# We also disable any of C++11 ABI from usage, so we wouldn't even try to
# link to stuff from std::__cxx11 namespace.
add_definitions ( "-D_GLIBCXX_USE_CXX11_ABI=0" )
endif ( )
2015-02-09 17:23:21 +00:00
endif ( )
2015-11-22 21:31:29 +00:00
# Visual Studio has all standards it supports available by default
2015-11-23 17:22:53 +00:00
if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel" )
2015-11-22 16:12:54 +00:00
# Use C99 + GNU extensions, works with GCC, Clang, ICC
2016-01-29 16:43:40 +00:00
if ( WITH_C11 )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11" )
else ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99" )
endif ( )
2015-11-22 16:12:54 +00:00
endif ( )
2012-10-20 13:08:51 +00:00
# Include warnings first, so its possible to disable them with user defined flags
# eg: -Wno-uninitialized
set ( CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}" )
set ( CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS}" )
2009-10-19 16:20:12 +00:00
2013-08-28 04:32:39 +00:00
# defined above, platform spesific but shared names
mark_as_advanced (
C Y C L E S _ O S L
O S L _ L I B _ E X E C
O S L _ C O M P I L E R
O S L _ L I B _ C O M P
O S L _ L I B _ Q U E R Y
2014-12-29 09:48:21 +00:00
O S L _ I N C L U D E _ D I R
2013-08-28 04:32:39 +00:00
)
mark_as_advanced (
L L V M _ C O N F I G
2015-03-05 04:36:22 +00:00
L L V M _ R O O T _ D I R
2013-08-28 04:32:39 +00:00
L L V M _ L I B R A R Y
L L V M _ V E R S I O N
)
2011-02-20 23:39:29 +00:00
#-------------------------------------------------------------------------------
# Global Defines
2011-05-24 06:44:39 +00:00
# better not set includes here but this debugging option is off by default.
2010-12-08 08:43:06 +00:00
if ( WITH_CXX_GUARDEDALLOC )
2011-05-24 06:44:39 +00:00
include_directories ( ${ CMAKE_SOURCE_DIR } /intern/guardedalloc )
2012-06-25 10:35:24 +00:00
add_definitions ( -DWITH_CXX_GUARDEDALLOC )
2010-12-08 08:43:06 +00:00
endif ( )
2006-11-17 02:27:12 +00:00
2010-12-15 10:22:26 +00:00
if ( WITH_ASSERT_ABORT )
add_definitions ( -DWITH_ASSERT_ABORT )
endif ( )
2010-12-16 12:48:30 +00:00
# message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
# message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Libraries
2010-12-06 10:56:37 +00:00
2014-06-18 16:28:27 +00:00
if ( WITH_GTESTS )
2014-06-18 12:49:17 +00:00
include ( GTestTesting )
endif ( )
2014-01-20 19:41:54 +00:00
if ( WITH_BLENDER OR WITH_PLAYER )
add_subdirectory ( intern )
add_subdirectory ( extern )
2014-06-18 12:49:17 +00:00
# source after intern and extern to gather all
# internal and external library information first, for test linking
add_subdirectory ( source )
2014-01-20 19:41:54 +00:00
elseif ( WITH_CYCLES_STANDALONE )
add_subdirectory ( intern/cycles )
2014-09-14 15:40:34 +00:00
add_subdirectory ( extern/clew )
2016-01-14 07:24:09 +00:00
if ( WITH_CUDA_DYNLOAD )
add_subdirectory ( extern/cuew )
endif ( )
2014-01-25 13:19:32 +00:00
if ( NOT WITH_SYSTEM_GLEW )
2014-01-20 19:41:54 +00:00
add_subdirectory ( extern/glew )
endif ( )
endif ( )
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Blender Application
2011-07-13 08:15:06 +00:00
if ( WITH_BLENDER )
add_subdirectory ( source/creator )
endif ( )
2006-11-17 02:27:12 +00:00
2008-09-09 21:15:30 +00:00
2006-11-17 02:27:12 +00:00
#-----------------------------------------------------------------------------
# Blender Player
2010-12-08 08:43:06 +00:00
if ( WITH_PLAYER )
add_subdirectory ( source/blenderplayer )
endif ( )
2011-02-15 18:33:05 +00:00
2014-06-18 11:44:40 +00:00
#-----------------------------------------------------------------------------
# Testing
add_subdirectory ( tests )
2011-02-15 18:33:05 +00:00
#-----------------------------------------------------------------------------
# CPack for generating packages
include ( build_files/cmake/packaging.cmake )
2011-06-19 13:49:20 +00:00
2016-07-18 13:16:45 +00:00
#-----------------------------------------------------------------------------
# Use dynamic loading for OpenMP
if ( WITH_BLENDER )
openmp_delayload ( blender )
endif ( WITH_BLENDER )
if ( WITH_PLAYER )
openmp_delayload ( blenderplayer )
endif ( WITH_PLAYER )
2011-06-19 13:49:20 +00:00
#-----------------------------------------------------------------------------
# Print Final Configuration
if ( FIRST_RUN )
2015-06-16 23:16:17 +00:00
set ( _config_msg "\nBlender Configuration\n=====================" )
function ( info_cfg_option
_ s e t t i n g
)
set ( _msg " - ${_setting}" )
2011-06-19 13:49:20 +00:00
string ( LENGTH "${_msg}" _len )
2012-04-30 09:38:32 +00:00
while ( "32" GREATER "${_len}" )
2011-06-19 13:49:20 +00:00
set ( _msg "${_msg} " )
2016-05-18 01:58:08 +00:00
math ( EXPR _len "${_len} + 1" )
2011-06-19 13:49:20 +00:00
endwhile ( )
2015-06-16 23:16:17 +00:00
set ( _config_msg "${_config_msg}\n${_msg}${${_setting}}" PARENT_SCOPE )
endfunction ( )
2011-09-30 15:51:58 +00:00
2015-06-16 23:16:17 +00:00
function ( info_cfg_text
_ t e x t
)
2011-09-30 15:51:58 +00:00
2015-06-16 23:16:17 +00:00
set ( _config_msg "${_config_msg}\n\n ${_text}" PARENT_SCOPE )
endfunction ( )
2011-06-19 13:49:20 +00:00
2013-12-02 00:36:33 +00:00
message ( STATUS "C Compiler: \" ${ CMAKE_C_COMPILER_ID } \"")
message ( STATUS "C++ Compiler: \" ${ CMAKE_CXX_COMPILER_ID } \"")
2011-06-19 13:49:20 +00:00
info_cfg_text ( "Build Options:" )
info_cfg_option ( WITH_GAMEENGINE )
info_cfg_option ( WITH_PLAYER )
info_cfg_option ( WITH_BULLET )
2012-08-19 22:19:19 +00:00
info_cfg_option ( WITH_IK_SOLVER )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_IK_ITASC )
info_cfg_option ( WITH_OPENCOLLADA )
info_cfg_option ( WITH_FFTW3 )
info_cfg_option ( WITH_INTERNATIONAL )
2011-08-02 06:32:53 +00:00
info_cfg_option ( WITH_INPUT_NDOF )
2011-11-07 17:13:32 +00:00
info_cfg_option ( WITH_CYCLES )
2013-05-24 10:15:20 +00:00
info_cfg_option ( WITH_FREESTYLE )
2012-09-15 10:03:17 +00:00
info_cfg_option ( WITH_OPENCOLORIO )
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
info_cfg_option ( WITH_OPENVDB )
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
info_cfg_option ( WITH_ALEMBIC )
2011-06-19 13:49:20 +00:00
info_cfg_text ( "Compiler Options:" )
info_cfg_option ( WITH_BUILDINFO )
info_cfg_option ( WITH_OPENMP )
info_cfg_option ( WITH_RAYOPTIMIZATION )
info_cfg_text ( "System Options:" )
info_cfg_option ( WITH_INSTALL_PORTABLE )
2016-06-09 19:07:58 +00:00
info_cfg_option ( WITH_X11_ALPHA )
2012-01-02 12:25:14 +00:00
info_cfg_option ( WITH_X11_XF86VMODE )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_X11_XINPUT )
2012-04-12 05:34:17 +00:00
info_cfg_option ( WITH_MEM_JEMALLOC )
2013-10-05 11:59:15 +00:00
info_cfg_option ( WITH_MEM_VALGRIND )
2012-06-23 14:23:44 +00:00
info_cfg_option ( WITH_SYSTEM_GLEW )
info_cfg_option ( WITH_SYSTEM_OPENJPEG )
2011-06-19 13:49:20 +00:00
info_cfg_text ( "Image Formats:" )
2013-10-13 09:35:54 +00:00
info_cfg_option ( WITH_OPENIMAGEIO )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_IMAGE_CINEON )
info_cfg_option ( WITH_IMAGE_DDS )
info_cfg_option ( WITH_IMAGE_HDR )
info_cfg_option ( WITH_IMAGE_OPENEXR )
info_cfg_option ( WITH_IMAGE_OPENJPEG )
info_cfg_option ( WITH_IMAGE_TIFF )
info_cfg_text ( "Audio:" )
info_cfg_option ( WITH_OPENAL )
info_cfg_option ( WITH_SDL )
2014-11-17 11:35:36 +00:00
info_cfg_option ( WITH_SDL_DYNLOAD )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_JACK )
2013-03-27 07:19:54 +00:00
info_cfg_option ( WITH_JACK_DYNLOAD )
2012-10-08 02:51:42 +00:00
info_cfg_option ( WITH_CODEC_AVI )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_CODEC_FFMPEG )
info_cfg_option ( WITH_CODEC_SNDFILE )
info_cfg_text ( "Compression:" )
info_cfg_option ( WITH_LZMA )
info_cfg_option ( WITH_LZO )
info_cfg_text ( "Python:" )
info_cfg_option ( WITH_PYTHON_INSTALL )
2012-04-30 09:38:32 +00:00
info_cfg_option ( WITH_PYTHON_INSTALL_NUMPY )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_PYTHON_MODULE )
info_cfg_option ( WITH_PYTHON_SAFETY )
2013-02-22 22:24:38 +00:00
if ( APPLE )
info_cfg_option ( WITH_PYTHON_FRAMEWORK )
endif ( )
2011-06-19 13:49:20 +00:00
info_cfg_text ( "Modifiers:" )
info_cfg_option ( WITH_MOD_BOOLEAN )
2011-12-31 03:34:44 +00:00
info_cfg_option ( WITH_MOD_REMESH )
2011-06-19 13:49:20 +00:00
info_cfg_option ( WITH_MOD_FLUID )
2011-11-13 14:16:43 +00:00
info_cfg_option ( WITH_MOD_OCEANSIM )
2011-06-19 13:49:20 +00:00
2014-10-07 20:46:19 +00:00
info_cfg_text ( "OpenGL:" )
info_cfg_option ( WITH_GLEW_ES )
info_cfg_option ( WITH_GLU )
info_cfg_option ( WITH_GL_EGL )
info_cfg_option ( WITH_GL_PROFILE_COMPAT )
info_cfg_option ( WITH_GL_PROFILE_CORE )
info_cfg_option ( WITH_GL_PROFILE_ES20 )
if ( WIN32 )
info_cfg_option ( WITH_GL_ANGLE )
endif ( )
2011-06-19 13:49:20 +00:00
info_cfg_text ( "" )
message ( "${_config_msg}" )
endif ( )
2014-11-16 11:57:42 +00:00
if ( 0 )
print_all_vars ( )
endif ( )