2008-04-17 00:40:48 +02:00
# ***** BEGIN GPL LICENSE BLOCK *****
2006-11-17 03:27:12 +01: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-17 00:40:48 +02:00
# of the License, or (at your option) any later version.
2006-11-17 03:27:12 +01: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 14:34:04 +01:00
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2006-11-17 03:27:12 +01:00
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
2008-04-17 00:40:48 +02:00
# ***** END GPL LICENSE BLOCK *****
2006-11-17 03:27:12 +01:00
2006-12-13 03:57:57 +01:00
#-----------------------------------------------------------------------------
2011-09-30 17:51:58 +02: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 13:05:20 +01:00
# build the libs and objects in it.
2006-12-13 03:57:57 +01:00
2010-12-08 09:43:06 +01:00
if ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
2011-04-21 07:49:47 +02: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 ! "
2017-06-15 23:38:20 +02:00
" \ n R e m o v e \ " $ { C M A K E _ S O U R C E _ D I R } / C M a k e C a c h e . t x t \ " 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 . : "
2011-04-21 07:49:47 +02:00
" \ 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 09:43:06 +01:00
endif ( )
2006-12-13 03:57:57 +01:00
2017-08-20 17:01:27 +02:00
cmake_minimum_required ( VERSION 3.5 )
2015-11-09 16:52:29 +01:00
2018-12-14 14:48:05 +01:00
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
# platforms which don't hare GLVND yet. Only do it if preference was not set
# externally.
if ( NOT DEFINED OpenGL_GL_PREFERENCE )
set ( OpenGL_GL_PREFERENCE "LEGACY" )
endif ( )
2011-06-19 15:49:20 +02:00
if ( NOT EXECUTABLE_OUTPUT_PATH )
2015-06-17 01:16:17 +02:00
set ( FIRST_RUN TRUE )
else ( )
set ( FIRST_RUN FALSE )
2011-06-19 15:49:20 +02:00
endif ( )
2011-04-06 01:31:01 +02:00
# this starts out unset
2011-06-17 04:22:38 +02:00
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules" )
2016-08-09 15:19:11 +02:00
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform" )
2011-04-06 01:31:01 +02:00
2011-06-27 15:18:08 +02:00
# avoid having empty buildtype
2017-06-27 01:50:35 +02:00
if ( NOT DEFINED CMAKE_BUILD_TYPE_INIT )
set ( CMAKE_BUILD_TYPE_INIT "Release" )
endif ( )
2011-06-27 15:18:08 +02:00
2018-07-30 07:20:34 +02:00
# Omit superfluous "Up-to-date" messages.
if ( NOT DEFINED CMAKE_INSTALL_MESSAGE )
set ( CMAKE_INSTALL_MESSAGE "LAZY" )
endif ( )
2010-06-07 16:28:37 +02:00
# quiet output for Makefiles, 'make -s' helps too
2010-12-08 09:43:06 +01:00
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
2010-06-07 16:28:37 +02:00
2011-10-26 02:51:29 +02:00
# global compile definitions since add_definitions() adds for all.
2018-05-18 14:26:02 +02:00
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 >
)
2011-10-26 02:51:29 +02:00
2011-08-22 14:24:14 +02:00
#-----------------------------------------------------------------------------
# Set policy
2015-11-09 16:52:29 +01: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 14:24:14 +02:00
2011-05-23 16:56:14 +02:00
#-----------------------------------------------------------------------------
# Load some macros.
include ( build_files/cmake/macros.cmake )
2011-04-09 13:16:37 +02:00
2011-05-23 16:56:14 +02:00
#-----------------------------------------------------------------------------
# Initialize project.
2006-11-17 03:27:12 +01:00
2011-05-23 16:56:14 +02:00
blender_project_hack_pre ( )
2011-04-09 13:16:37 +02:00
2011-05-23 16:56:14 +02:00
project ( Blender )
2011-04-09 13:16:37 +02:00
2011-05-23 16:56:14 +02:00
blender_project_hack_post ( )
2011-04-09 13:16:37 +02:00
2011-01-21 01:06:30 +01:00
enable_testing ( )
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Redirect output files
2012-05-19 15:55:54 +02:00
set ( EXECUTABLE_OUTPUT_PATH ${ CMAKE_BINARY_DIR } /bin CACHE INTERNAL "" FORCE )
set ( LIBRARY_OUTPUT_PATH ${ CMAKE_BINARY_DIR } /lib CACHE INTERNAL "" FORCE )
2018-08-17 18:04:55 +02:00
if ( MSVC )
set ( TESTS_OUTPUT_DIR ${ EXECUTABLE_OUTPUT_PATH } /tests/ $< CONFIG > / CACHE INTERNAL "" FORCE )
2018-08-17 22:14:26 +02:00
else ( )
2018-08-17 18:04:55 +02:00
set ( TESTS_OUTPUT_DIR ${ EXECUTABLE_OUTPUT_PATH } /tests/ CACHE INTERNAL "" FORCE )
endif ( )
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Set default config options
2010-06-06 15:32:58 +02:00
2010-12-08 09:43:06 +01:00
get_blender_version ( )
2010-07-14 22:26:46 +02:00
2014-11-13 23:32:01 +01: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-17 01:16:17 +02:00
unset ( _var )
2014-11-13 23:32:01 +01: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
_ 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
2015-08-05 12:42:00 +02:00
_ i n i t _ O P E N S U B D I V
2014-11-13 23:32:01 +01:00
)
# customize...
2016-04-23 16:16:15 +02:00
if ( UNIX AND NOT APPLE )
2014-11-13 23:32:01 +01: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 )
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 12:42:00 +02:00
set ( _init_OPENSUBDIV OFF )
2015-07-28 09:47:21 +02:00
elseif ( WIN32 )
set ( _init_JACK OFF )
elseif ( APPLE )
set ( _init_JACK OFF )
2014-11-13 23:32:01 +01:00
endif ( )
2014-11-26 13:24:56 +01:00
#-----------------------------------------------------------------------------
# Options
2017-04-27 13:40:18 +02:00
# First platform specific non-cached vars
2017-11-30 07:56:01 +01:00
if ( UNIX AND NOT ( APPLE OR HAIKU ) )
2014-11-26 13:24:56 +01:00
set ( WITH_X11 ON )
endif ( )
2010-06-06 15:32:58 +02:00
# Blender internal features
2011-07-13 10:15:06 +02:00
option ( WITH_BLENDER "Build blender (disable to build only the blender player)" ON )
mark_as_advanced ( WITH_BLENDER )
2011-03-11 02:24:16 +01:00
option ( WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON )
2011-04-28 08:20:47 +02:00
2011-03-11 02:24:16 +01:00
option ( WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON )
2018-06-10 08:12:13 +02:00
option ( WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON )
2018-09-03 16:49:08 +02:00
mark_as_advanced ( WITH_PYTHON ) # don't want people disabling this unless they really know what they are doing.
2012-09-28 08:45:20 +02: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 08:20:47 +02:00
2018-09-03 16:49:08 +02:00
option ( WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some efficiency, only enable for development)." OFF )
2015-03-05 05:23:22 +01:00
mark_as_advanced ( WITH_PYTHON_SAFETY )
2015-03-24 09:09:51 +01: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 13:13:13 +01:00
if ( APPLE )
2013-02-22 23:24:38 +01:00
option ( WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF )
endif ( )
2014-11-13 23:32:01 +01:00
option ( WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ${ _init_BUILDINFO } )
2014-08-01 19:07:41 +02:00
if ( ${ CMAKE_VERSION } VERSION_LESS 2.8.8 )
# add_library OBJECT arg unsupported
set ( WITH_BUILDINFO OFF )
endif ( )
2018-09-03 16:49:08 +02:00
set ( BUILDINFO_OVERRIDE_DATE "" CACHE STRING "Use instead of the current date for reproducible builds (empty string disables this option)" )
set ( BUILDINFO_OVERRIDE_TIME "" CACHE STRING "Use instead of the current time for reproducible builds (empty string disables this option)" )
2016-09-06 15:21:23 +02: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 18:43:58 +02:00
mark_as_advanced ( BUILDINFO_OVERRIDE_DATE )
mark_as_advanced ( BUILDINFO_OVERRIDE_TIME )
2014-08-01 19:07:41 +02:00
2011-03-11 02:24:16 +01:00
option ( WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON )
2012-08-18 15:36:29 +02:00
option ( WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON )
2017-05-24 11:36:41 +02:00
option ( WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ${ _init_FFTW3 } )
2010-12-08 09:43:06 +01:00
option ( WITH_BULLET "Enable Bullet (Physics Engine)" ON )
2013-01-03 01:23:52 +01: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 23:32:01 +01:00
option ( WITH_OPENCOLORIO "Enable OpenColorIO color management" ${ _init_OPENCOLORIO } )
2015-07-18 10:35:03 +02:00
# Compositor
option ( WITH_COMPOSITOR "Enable the tile based nodal compositor" ON )
2011-06-04 16:12:55 +02:00
2018-11-30 11:50:23 +01:00
option ( WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ${ _init_OPENSUBDIV } )
2015-07-20 16:08:06 +02: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 08:39:29 +01: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 )
2018-04-02 18:55:10 +02:00
option ( WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF )
mark_as_advanced ( WITH_OPENVDB_3_ABI_COMPATIBLE )
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 08:39:29 +01:00
2011-07-13 08:04:54 +02: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 11:27:56 +02:00
2016-01-18 10:20:08 +01:00
option ( WITH_GHOST_SDL "Enable building Blender against SDL for windowing rather than the native APIs" OFF )
2011-07-13 08:04:54 +02:00
mark_as_advanced ( WITH_GHOST_SDL )
2011-07-12 15:17:54 +02:00
2014-11-13 19:43:15 +01:00
if ( WITH_X11 )
option ( WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON )
endif ( )
2011-07-13 08:04:54 +02:00
# Misc...
2011-06-04 16:12:55 +02:00
option ( WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF )
mark_as_advanced ( WITH_HEADLESS )
2011-10-23 17:43:12 +02:00
option ( WITH_AUDASPACE "Build with blenders audio library (only disable if you know what you're doing!)" ON )
2015-06-16 10:03:35 +02: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 08:04:54 +02:00
mark_as_advanced ( WITH_AUDASPACE )
2015-06-16 10:03:35 +02:00
mark_as_advanced ( WITH_SYSTEM_AUDASPACE )
if ( NOT WITH_AUDASPACE )
set ( WITH_SYSTEM_AUDASPACE OFF )
endif ( )
2011-07-13 08:04:54 +02:00
2014-04-14 11:38:34 +02:00
option ( WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON )
2015-12-02 14:09:06 +01: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 15:32:58 +02:00
2014-10-07 22:46:19 +02: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 )
2017-10-25 11:12:12 +02:00
option ( WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON )
2016-06-09 21:07:58 +02:00
option ( WITH_X11_ALPHA "Enable X11 transparent background" ON )
2014-10-07 22:46:19 +02:00
endif ( )
if ( UNIX AND NOT APPLE )
2017-09-03 08:34:10 +02:00
option ( WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF )
2014-10-07 22:46:19 +02:00
option ( WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON )
2011-04-06 03:51:43 +02:00
else ( )
# not an option for other OS's
2012-06-23 15:42:14 +02:00
set ( WITH_SYSTEM_GLEW OFF )
2014-10-07 22:46:19 +02:00
set ( WITH_SYSTEM_GLES OFF )
2011-03-25 05:56:48 +01:00
endif ( )
2012-06-23 16:23:44 +02:00
2015-03-19 05:41:41 +01:00
if ( UNIX AND NOT APPLE )
option ( WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF )
endif ( )
2012-06-23 16:23:44 +02:00
2010-10-23 17:40:13 +02:00
# Modifiers
2012-10-29 16:43:54 +01:00
option ( WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON )
option ( WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON )
option ( WITH_MOD_REMESH "Enable Remesh Modifier" ON )
2012-11-27 10:52:20 +01: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 15:16:43 +01:00
option ( WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF )
2010-10-23 17:40:13 +02:00
2010-06-06 15:32:58 +02:00
# Image format support
2014-11-13 23:32:01 +01: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 09:43:06 +01:00
option ( WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON )
2012-04-12 10:36:07 +02:00
option ( WITH_IMAGE_TIFF "Enable LibTIFF Support" ON )
2010-12-08 09:43:06 +01: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 )
2010-06-06 15:32:58 +02:00
2010-11-30 19:52:39 +01:00
# Audio/Video format support
2012-10-08 04:51:42 +02:00
option ( WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON )
2014-11-13 23:32:01 +01:00
option ( WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${ _init_CODEC_FFMPEG } )
2010-12-08 09:43:06 +01:00
option ( WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF )
2013-11-17 09:23:18 +01: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 06:20:37 +02:00
# Alembic support
option ( WITH_ALEMBIC "Enable Alembic Support" OFF )
option ( WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF )
2010-06-06 15:32:58 +02:00
# 3D format support
2013-11-18 17:12:19 +01:00
# Disable opencollada when we don't have precompiled libs
2014-11-13 23:32:01 +01:00
option ( WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${ _init_OPENCOLLADA } )
2009-11-19 12:49:42 +01:00
2010-06-06 15:32:58 +02:00
# Sound output
2014-11-13 23:32:01 +01:00
option ( WITH_SDL "Enable SDL for sound and joystick support" ${ _init_SDL } )
2010-12-08 09:43:06 +01:00
option ( WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON )
2016-10-22 14:20:47 +02:00
option ( WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ${ _init_JACK } )
2013-03-27 08:19:54 +01:00
if ( UNIX AND NOT APPLE )
2016-10-22 14:20:47 +02:00
option ( WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF )
2013-03-27 08:19:54 +01:00
endif ( )
2014-11-17 12:35:36 +01:00
if ( UNIX AND NOT APPLE )
option ( WITH_SDL_DYNLOAD "Enable runtime dynamic SDL libraries loading" OFF )
endif ( )
2010-06-06 15:32:58 +02:00
# Compression
2010-12-08 09:43:06 +01: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 12:33:31 +01:00
if ( UNIX AND NOT APPLE )
2015-03-13 12:46:15 +01:00
option ( WITH_SYSTEM_LZO "Use the system LZO library" OFF )
2015-03-13 12:33:31 +01:00
endif ( )
2010-06-06 15:32:58 +02:00
2011-11-07 13:55:18 +01:00
# Camera/motion tracking
2015-07-18 10:35:03 +02:00
option ( WITH_LIBMV "Enable Libmv structure from motion library" ON )
2016-01-26 11:47:53 +01:00
option ( WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF )
2014-11-13 23:32:01 +01:00
mark_as_advanced ( WITH_LIBMV_SCHUR_SPECIALIZATIONS )
2011-11-07 13:55:18 +01:00
2017-04-21 10:58:01 +02:00
# Logging/unbit test libraries.
option ( WITH_SYSTEM_GFLAGS "Use system-wide Gflags instead of a bundled one" OFF )
2017-04-30 18:52:38 +02:00
option ( WITH_SYSTEM_GLOG "Use system-wide Glog instead of a bundled one" OFF )
2017-04-21 10:58:01 +02:00
mark_as_advanced ( WITH_SYSTEM_GFLAGS )
2017-04-21 14:26:25 +02:00
mark_as_advanced ( WITH_SYSTEM_GLOG )
2017-04-21 10:58:01 +02:00
2012-12-20 08:57:26 +01:00
# Freestyle
option ( WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON )
2010-06-06 15:32:58 +02:00
# Misc
2014-12-07 00:58:17 +01:00
if ( WIN32 )
option ( WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON )
endif ( )
2014-11-13 23:32:01 +01:00
option ( WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${ _init_INPUT_NDOF } )
2011-09-30 17:51:58 +02:00
option ( WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON )
2011-03-06 12:41:30 +01:00
if ( UNIX AND NOT APPLE )
option ( WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON )
2012-11-19 20:43:03 +01: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 21:42:15 +01: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 12:41:30 +01:00
endif ( )
2016-03-15 13:50:44 +01:00
2010-12-08 09:43:06 +01:00
option ( WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON )
2018-09-17 11:10:45 +02:00
if ( WIN32 OR APPLE )
# Windows and macOS have this bundled with Python libraries.
elseif ( WITH_PYTHON_INSTALL OR ( WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE ) )
2016-03-15 13:50:44 +01:00
set ( PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module" )
mark_as_advanced ( PYTHON_NUMPY_PATH )
2017-08-18 08:24:12 +02:00
set ( PYTHON_NUMPY_INCLUDE_DIRS ${ PYTHON_NUMPY_PATH } /numpy/core/include CACHE PATH "Path to the include directory of the numpy module" )
mark_as_advanced ( PYTHON_NUMPY_INCLUDE_DIRS )
endif ( )
if ( WITH_PYTHON_INSTALL )
option ( WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON )
2016-03-15 13:50:44 +01:00
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 10:53:12 +02: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-02 01:22:58 +02:00
2011-04-28 15:47:27 +02:00
# Cycles
2015-07-18 10:35:03 +02: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 23:32:01 +01:00
option ( WITH_CYCLES_OSL "Build Cycles with OSL support" ${ _init_CYCLES_OSL } )
2018-11-07 12:58:12 +01:00
option ( WITH_CYCLES_EMBREE "Build Cycles with Embree support" OFF )
2015-07-18 10:35:03 +02:00
option ( WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF )
2018-02-03 18:59:09 +01:00
option ( WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF )
2018-08-20 10:17:34 +02:00
option ( WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF )
mark_as_advanced ( WITH_CYCLES_CUDA_BUILD_SERIAL )
2019-01-18 12:38:19 +01:00
set ( CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for" )
2011-11-13 15:16:43 +01:00
mark_as_advanced ( CYCLES_CUDA_BINARIES_ARCH )
2012-05-22 14:30:37 +02:00
unset ( PLATFORM_DEFAULT )
2015-07-18 10:35:03 +02: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 16:09:05 +01:00
option ( WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF )
2018-02-03 18:59:09 +01:00
mark_as_advanced ( WITH_CYCLES_CUBIN_COMPILER )
2014-10-04 15:00:26 +02:00
mark_as_advanced ( WITH_CYCLES_LOGGING )
mark_as_advanced ( WITH_CYCLES_DEBUG )
2016-03-25 16:09:05 +01:00
mark_as_advanced ( WITH_CYCLES_NATIVE_ONLY )
2011-04-28 15:47:27 +02:00
2018-02-14 10:31:04 +01:00
option ( WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON )
option ( WITH_CYCLES_DEVICE_OPENCL "Enable Cycles OpenCL compute support" ON )
option ( WITH_CYCLES_NETWORK "Enable Cycles compute over network support (EXPERIMENTAL and unfinished)" OFF )
mark_as_advanced ( WITH_CYCLES_DEVICE_CUDA )
mark_as_advanced ( WITH_CYCLES_DEVICE_OPENCL )
mark_as_advanced ( WITH_CYCLES_NETWORK )
2016-01-14 08:24:09 +01:00
option ( WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON )
mark_as_advanced ( WITH_CUDA_DYNLOAD )
2012-10-06 13:00:45 +02:00
# LLVM
option ( WITH_LLVM "Use LLVM" OFF )
2014-08-06 12:48:06 +02: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 18:18:35 +02:00
mark_as_advanced ( LLVM_STATIC )
2012-10-06 13:00:45 +02:00
2011-05-12 13:16:32 +02:00
# disable for now, but plan to support on all platforms eventually
2015-02-14 11:13:48 +01:00
option ( WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON )
2011-05-12 13:16:32 +02:00
mark_as_advanced ( WITH_MEM_JEMALLOC )
2013-10-03 14:22:44 +02: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 10:02:08 +01:00
# Debug
2011-03-11 02:24:16 +01:00
option ( WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF )
2010-12-08 10:02:08 +01:00
mark_as_advanced ( WITH_CXX_GUARDEDALLOC )
2018-06-28 10:48:06 +02:00
option ( WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON )
2010-12-15 11:22:26 +01:00
mark_as_advanced ( WITH_ASSERT_ABORT )
2013-11-21 17:38:52 +01:00
option ( WITH_BOOST "Enable features depending on boost" ON )
2013-02-01 00:25:06 +01:00
2014-06-18 14:49:17 +02:00
# Unit testsing
option ( WITH_GTESTS "Enable GTest unit testing" OFF )
2018-02-14 20:33:33 +01:00
option ( WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF )
option ( WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF )
2014-06-18 14:49:17 +02:00
2014-11-13 14:07:34 +01:00
# Documentation
if ( UNIX AND NOT APPLE )
option ( WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF )
endif ( )
2014-10-07 22:46:19 +02:00
# OpenGL
2018-06-16 04:17:16 +02:00
option ( WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON )
2014-10-07 22:46:19 +02: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_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF )
mark_as_advanced (
2018-06-16 04:17:16 +02:00
W I T H _ O P E N G L
2014-10-07 22:46:19 +02:00
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 _ E S 2 0
)
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 16:57:31 +01:00
if ( WIN32 )
2014-11-08 11:32:32 +01:00
getDefaultWindowsPrefixBase ( CMAKE_GENERIC_PROGRAM_FILES )
set ( CPACK_INSTALL_PREFIX ${ CMAKE_GENERIC_PROGRAM_FILES } / $ {} )
endif ( )
2016-11-02 10:42:15 +01: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 ( )
2018-05-18 15:21:18 +02:00
if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" )
option ( WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF )
mark_as_advanced ( WITH_COMPILER_ASAN )
if ( WITH_COMPILER_ASAN )
set ( _asan_defaults " \
- f s a n i t i z e = a d d r e s s \
- f s a n i t i z e = b o o l \
- f s a n i t i z e = b o u n d s \
- f s a n i t i z e = e n u m \
- f s a n i t i z e = f l o a t - c a s t - o v e r f l o w \
- f s a n i t i z e = f l o a t - d i v i d e - b y - z e r o \
- f s a n i t i z e = n o n n u l l - a t t r i b u t e \
- f s a n i t i z e = r e t u r n s - n o n n u l l - a t t r i b u t e \
- f s a n i t i z e = s i g n e d - i n t e g e r - o v e r f l o w \
- f s a n i t i z e = u n d e f i n e d \
- f s a n i t i z e = v l a - b o u n d \
- f n o - s a n i t i z e = a l i g n m e n t \
" )
2018-05-31 19:50:30 +02:00
if ( NOT MSVC ) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
set ( _asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
endif ( )
2018-05-18 15:21:18 +02:00
set ( COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer" )
mark_as_advanced ( COMPILER_ASAN_CFLAGS )
set ( COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer" )
mark_as_advanced ( COMPILER_ASAN_CXXFLAGS )
unset ( _asan_defaults )
2018-05-31 19:50:30 +02:00
if ( NOT MSVC )
find_library ( COMPILER_ASAN_LIBRARY asan ${ CMAKE_C_IMPLICIT_LINK_DIRECTORIES } )
else ( )
find_library ( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
2018-06-10 08:12:13 +02:00
P A T H S
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ W o w 6 4 3 2 N o d e \ \ L L V M \ \ L L V M ; ] / l i b / c l a n g / 7 . 0 . 0 / l i b / w i n d o w s
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ W o w 6 4 3 2 N o d e \ \ L L V M \ \ L L V M ; ] / l i b / c l a n g / 6 . 0 . 0 / l i b / w i n d o w s
)
endif ( )
2018-05-18 15:21:18 +02:00
mark_as_advanced ( COMPILER_ASAN_LIBRARY )
endif ( )
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 12:05:57 +02:00
# Dependency graph
option ( WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON )
2015-06-17 06:25:05 +02: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 12:05:57 +02:00
2017-03-05 18:05:00 +01: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 16:47:23 +02:00
2017-03-05 18:05:00 +01:00
option ( WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF )
mark_as_advanced ( WITH_WINDOWS_CODESIGN )
2016-08-31 14:26:05 +02:00
2017-03-05 18:05:00 +01:00
set ( WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning." )
mark_as_advanced ( WINDOWS_CODESIGN_PFX )
2016-08-31 14:26:05 +02:00
2017-03-05 18:05:00 +01:00
set ( WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning." )
mark_as_advanced ( WINDOWS_CODESIGN_PFX_PASSWORD )
2018-02-04 00:38:27 +01:00
option ( WINDOWS_USE_VISUAL_STUDIO_FOLDERS "Organize the visual studio project according to source folders." ON )
mark_as_advanced ( WINDOWS_USE_VISUAL_STUDIO_FOLDERS )
2018-10-22 18:17:08 +02:00
option ( WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF )
mark_as_advanced ( WINDOWS_PYTHON_DEBUG )
2017-03-05 18:05:00 +01:00
endif ( )
2016-08-31 14:26:05 +02:00
2014-11-13 23:32:01 +01:00
# avoid using again
option_defaults_clear ( )
# end option(...)
2014-11-11 21:44:26 +01:00
2014-11-08 11:32:32 +01: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 15:03:30 +01:00
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
2015-12-27 16:57:31 +01:00
if ( WIN32 )
2014-11-13 15:03:30 +01:00
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } /\ ${ BUILD_TYPE } CACHE PATH "default install path" FORCE )
2014-11-13 14:10:30 +01:00
elseif ( APPLE )
2014-11-13 15:03:30 +01:00
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } /\ ${ BUILD_TYPE } CACHE PATH "default install path" FORCE )
2014-11-13 14:10:30 +01:00
else ( )
2014-11-13 15:03:30 +01:00
if ( WITH_INSTALL_PORTABLE )
set ( CMAKE_INSTALL_PREFIX ${ EXECUTABLE_OUTPUT_PATH } CACHE PATH "default install path" FORCE )
2014-11-13 14:10:30 +01:00
endif ( )
endif ( )
2014-11-08 11:32:32 +01:00
endif ( )
2014-11-11 21:44:26 +01:00
2014-11-08 11:32:32 +01:00
2014-10-07 22:46:19 +02:00
# Apple
2010-12-08 09:43:06 +01:00
if ( APPLE )
2017-04-23 17:42:45 +02:00
include ( platform_apple_xcode )
2010-12-08 09:43:06 +01:00
endif ( )
2010-06-06 15:32:58 +02:00
2012-03-13 23:27:21 +01:00
2011-06-08 03:53:12 +02:00
#-----------------------------------------------------------------------------
# Check for conflicting/unsupported configurations
2018-04-16 15:54:36 +02:00
if ( NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE )
2016-05-18 03:58:08 +02:00
message ( FATAL_ERROR
2018-04-16 15:54:36 +02:00
" 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 _ 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 ! "
2016-05-18 03:58:08 +02:00
)
2011-07-13 10:15:06 +02:00
endif ( )
2012-11-12 05:50:45 +01:00
if ( NOT WITH_AUDASPACE )
if ( WITH_OPENAL )
2018-07-10 11:25:47 +02:00
message ( WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled" )
set ( WITH_OPENAL OFF )
2012-11-12 05:50:45 +01:00
endif ( )
if ( WITH_JACK )
2018-07-10 11:25:47 +02:00
message ( WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled" )
set ( WITH_JACK OFF )
2012-11-12 05:50:45 +01:00
endif ( )
2011-06-23 11:27:56 +02:00
endif ( )
2011-07-13 08:04:54 +02:00
if ( NOT WITH_SDL AND WITH_GHOST_SDL )
2012-11-12 05:50:45 +01:00
message ( FATAL_ERROR "WITH_GHOST_SDL requires WITH_SDL" )
2011-07-12 15:17:54 +02:00
endif ( )
2018-04-16 14:07:42 +02:00
# python module, needs some different options
2011-02-22 15:27:46 +01:00
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 07:34:17 +02:00
2011-06-04 16:12:55 +02:00
# may as well build python module without a UI
if ( WITH_PYTHON_MODULE )
set ( WITH_HEADLESS ON )
endif ( )
2013-08-08 00:40:03 +02:00
if ( NOT WITH_PYTHON )
set ( WITH_CYCLES OFF )
endif ( )
2014-11-13 13:36:33 +01:00
# enable boost for cycles, audaspace or i18n
2013-02-01 00:25:06 +01:00
# otherwise if the user disabled
if ( NOT WITH_BOOST )
# Explicitly disabled. so disable all deps.
2013-04-29 02:44:33 +02:00
macro ( set_and_warn
_ s e t t i n g _ v a l )
if ( ${ ${_setting } } )
2017-01-27 05:24:58 +01:00
message ( STATUS "'WITH_BOOST' is disabled: forcing 'set(${_setting} ${_val})'" )
2013-04-29 02:49:44 +02:00
endif ( )
2013-04-29 02:44:33 +02:00
set ( ${ _setting } ${ _val } )
endmacro ( )
set_and_warn ( WITH_CYCLES 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 08:39:29 +01:00
set_and_warn ( WITH_OPENVDB OFF )
2016-01-26 15:41:06 +01:00
set_and_warn ( WITH_OPENCOLORIO OFF )
2017-08-18 10:16:39 +02:00
elseif ( WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
2018-02-07 14:44:59 +01:00
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 )
2013-02-01 00:25:06 +01:00
# Keep enabled
else ( )
2018-07-25 16:59:46 +02:00
# Disable boost if not needed.
set ( WITH_BOOST OFF )
2011-08-16 18:15:34 +02:00
endif ( )
2013-03-27 19:44:46 +01:00
# auto enable openimageio for cycles
if ( WITH_CYCLES )
set ( WITH_OPENIMAGEIO ON )
2015-06-14 01:34:42 +02:00
# auto enable llvm for cycles_osl
if ( WITH_CYCLES_OSL )
set ( WITH_LLVM ON CACHE BOOL "" FORCE )
endif ( )
2015-06-14 01:50:33 +02:00
else ( )
set ( WITH_CYCLES_OSL OFF )
2013-03-27 19:44:46 +01: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 06:20:37 +02:00
# auto enable alembic linking dependencies
if ( WITH_ALEMBIC )
set ( WITH_IMAGE_OPENEXR ON )
endif ( )
2012-09-28 08:45:20 +02:00
# don't store paths to libs for portable distribution
2011-08-23 22:19:08 +02:00
if ( WITH_INSTALL_PORTABLE )
set ( CMAKE_SKIP_BUILD_RPATH TRUE )
endif ( )
2012-03-13 15:28:58 +01:00
if ( WITH_GHOST_SDL OR WITH_HEADLESS )
2014-10-07 22:46:19 +02:00
set ( WITH_X11 OFF )
set ( WITH_X11_XINPUT OFF )
2012-09-16 12:39:19 +02:00
set ( WITH_X11_XF86VMODE OFF )
2017-10-25 11:12:12 +02:00
set ( WITH_X11_XFIXES OFF )
2016-06-09 21:07:58 +02:00
set ( WITH_X11_ALPHA OFF )
2014-10-07 22:46:19 +02:00
set ( WITH_GHOST_XDND OFF )
2015-03-20 17:02:09 +01:00
set ( WITH_INPUT_IME OFF )
2012-03-13 15:28:58 +01:00
endif ( )
2014-10-15 10:53:12 +02: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 23:27:21 +01:00
2016-03-11 09:05:44 +01:00
if ( WITH_BUILDINFO )
find_package ( Git )
if ( NOT GIT_FOUND )
2016-03-11 10:49:23 +01:00
message ( WARNING "Git was not found, disabling WITH_BUILDINFO" )
2016-03-11 09:05:44 +01:00
set ( WITH_BUILDINFO OFF )
endif ( )
endif ( )
2015-06-16 10:03:35 +02:00
if ( WITH_AUDASPACE )
2017-08-18 08:24:12 +02:00
if ( NOT WITH_SYSTEM_AUDASPACE )
set ( AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace" )
set ( AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings" )
2015-06-16 10:03:35 +02:00
endif ( )
endif ( )
2018-02-14 10:20:26 +01:00
# Auto-enable CUDA dynload if toolkit is not found.
if ( NOT WITH_CUDA_DYNLOAD )
find_package ( CUDA )
if ( NOT CUDA_FOUND )
message ( "CUDA toolkit not found, using dynamic runtime loading of libraries instead" )
set ( WITH_CUDA_DYNLOAD ON )
endif ( )
endif ( )
2012-03-14 01:30:20 +01:00
#-----------------------------------------------------------------------------
# Check for valid directories
2014-01-28 13:00:28 +01:00
# ... a partial checkout may cause this.
2014-02-15 21:53:53 +01:00
#
# note: we need to check for a known subdir in both cases.
# since uninitialized git submodules will give blank dirs
2012-03-14 01:30:20 +01:00
if ( WITH_INTERNATIONAL )
2014-02-15 21:53:53 +01:00
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/release/datafiles/locale/languages" )
2016-05-18 03:58:08 +02: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 01:30:20 +01:00
set ( WITH_INTERNATIONAL OFF )
endif ( )
endif ( )
if ( WITH_PYTHON )
2017-12-04 06:37:31 +01:00
# While we have this as an '#error' in 'bpy_capi_utils.h',
2017-10-08 05:00:42 +02:00
# upgrading Python tends to cause confusion for users who build.
# Give the error message early to make this more obvious.
#
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
2019-02-04 11:58:34 +01:00
if ( DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.7" )
message ( FATAL_ERROR "At least Python 3.7 is required to build" )
2017-10-08 05:00:42 +02:00
endif ( )
2014-02-15 21:53:53 +01:00
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules" )
2016-05-18 03:58:08 +02: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 01:30:20 +01:00
endif ( )
endif ( )
2011-02-22 07:23:07 +01:00
#-----------------------------------------------------------------------------
# Initialize un-cached vars, avoid unused warning
2011-02-21 14:13:08 +01:00
# linux only, not cached
set ( WITH_BINRELOC OFF )
2016-12-29 07:09:11 +01:00
# MACOSX only, set to avoid uninitialized
2011-10-01 21:52:33 +02:00
set ( EXETYPE "" )
2011-06-28 04:49:49 +02:00
# C/C++ flags
set ( PLATFORM_CFLAGS )
2011-06-14 02:24:50 +02:00
2011-02-22 07:23:07 +01:00
# these are added to later on.
2011-06-28 04:49:49 +02:00
set ( C_WARNINGS )
set ( CXX_WARNINGS )
2011-10-30 05:48:00 +01:00
# for gcc -Wno-blah-blah
2018-06-22 14:17:55 +02:00
set ( C_REMOVE_STRICT_FLAGS )
2018-06-22 14:07:55 +02:00
set ( CXX_REMOVE_STRICT_FLAGS )
2011-10-30 05:48:00 +01:00
2011-06-28 04:49:49 +02:00
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
2011-10-01 21:52:33 +02:00
set ( PLATFORM_LINKLIBS "" )
2011-06-28 04:49:49 +02:00
# Added to linker flags in setup_liblinks
# - CMAKE_EXE_LINKER_FLAGS
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
2011-10-01 21:52:33 +02:00
set ( PLATFORM_LINKFLAGS "" )
set ( PLATFORM_LINKFLAGS_DEBUG "" )
2011-02-22 07:23:07 +01:00
2018-06-08 11:45:05 +02:00
if ( NOT CMAKE_BUILD_TYPE MATCHES "Release" )
if ( WITH_COMPILER_ASAN )
set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}" )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}" )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}" )
if ( MSVC )
2018-06-17 20:15:24 +02:00
set ( COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6" )
2018-06-08 11:45:05 +02:00
endif ( )
set ( PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}" )
set ( PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}" )
2018-06-17 20:15:24 +02:00
set ( PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}" )
2018-05-31 19:50:30 +02:00
endif ( )
2018-05-18 15:21:18 +02:00
endif ( )
2011-02-22 07:23:07 +01:00
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
#Platform specifics
2014-10-07 22:46:19 +02: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 )
2018-09-03 16:49:08 +02:00
# XXX, why doesn't cmake make this available?
2014-10-07 22:46:19 +02:00
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 ( )
2017-10-25 11:12:12 +02:00
if ( WITH_X11_XFIXES )
if ( X11_Xfixes_LIB )
list ( APPEND PLATFORM_LINKLIBS ${ X11_Xfixes_LIB } )
else ( )
set ( WITH_X11_XFIXES OFF )
endif ( )
endif ( )
2016-06-09 21:07:58 +02:00
if ( WITH_X11_ALPHA )
find_library ( X11_Xrender_LIB Xrender ${ X11_LIB_SEARCH_PATH } )
mark_as_advanced ( X11_Xrender_LIB )
2017-03-11 16:40:04 +01:00
if ( X11_Xrender_LIB )
2016-06-09 21:07:58 +02:00
list ( APPEND PLATFORM_LINKLIBS ${ X11_Xrender_LIB } )
else ( )
set ( WITH_X11_ALPHA OFF )
endif ( )
endif ( )
2014-10-07 22:46:19 +02:00
endif ( )
2015-07-28 09:47:21 +02:00
# ----------------------------------------------------------------------------
# Main Platform Checks
#
# - UNIX
# - WIN32
# - APPLE
2010-12-08 09:43:06 +01:00
if ( UNIX AND NOT APPLE )
2016-08-09 15:19:11 +02:00
include ( platform_unix )
2010-12-08 09:43:06 +01:00
elseif ( WIN32 )
2016-08-09 15:19:11 +02:00
include ( platform_win32 )
2010-12-08 09:43:06 +01:00
elseif ( APPLE )
2016-08-09 15:19:11 +02:00
include ( platform_apple )
2010-12-08 09:43:06 +01:00
endif ( )
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Common.
2010-08-11 10:23:48 +02:00
2012-12-05 16:46:31 +01: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 17:26:25 +02:00
if ( WITH_CYCLES )
if ( NOT WITH_OPENIMAGEIO )
2016-05-18 03:58:08 +02: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 17:26:25 +02:00
endif ( )
if ( NOT WITH_BOOST )
2016-05-18 03:58:08 +02: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 17:26:25 +02:00
endif ( )
2012-10-06 13:00:45 +02:00
2012-11-15 18:16:27 +01:00
if ( WITH_CYCLES_OSL )
2012-10-06 13:00:45 +02:00
if ( NOT WITH_LLVM )
2016-05-18 03:58:08 +02: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 13:00:45 +02:00
endif ( )
endif ( )
2012-07-01 17:26:25 +02:00
endif ( )
2012-11-11 17:54:26 +01:00
if ( WITH_INTERNATIONAL )
if ( NOT WITH_BOOST )
2016-05-18 03:58:08 +02: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 17:54:26 +01:00
endif ( )
endif ( )
2012-07-01 17:26:25 +02:00
2011-08-01 08:11:41 +02:00
# See TEST_SSE_SUPPORT() for how this is defined.
2016-05-05 19:25:08 +02: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 18:06:45 +02:00
set ( PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}" )
2016-05-05 19:25:08 +02:00
add_definitions ( -D__SSE2__ )
2018-09-03 16:49:08 +02:00
if ( NOT SUPPORT_SSE_BUILD ) # don't double up
2016-05-05 19:25:08 +02:00
add_definitions ( -D__MMX__ )
2010-12-08 09:43:06 +01:00
endif ( )
endif ( )
2011-09-19 10:02:17 +02:00
# set the endian define
2012-08-07 14:03:43 +02:00
if ( MSVC )
2011-09-27 03:32:27 +02:00
# for some reason this fails on msvc
2011-09-19 10:02:17 +02:00
add_definitions ( -D__LITTLE_ENDIAN__ )
2017-04-27 13:40:18 +02:00
# OSX-Note: as we do cross-compiling with specific set architecture,
# endianess-detection and auto-setting is counterproductive
2018-09-03 16:49:08 +02:00
# so we just set endianness according CMAKE_OSX_ARCHITECTURES
2012-08-07 15:51:19 +02:00
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64 )
add_definitions ( -D__LITTLE_ENDIAN__ )
2017-04-27 13:40:18 +02:00
elseif ( CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64 )
2012-08-07 15:51:19 +02:00
add_definitions ( -D__BIG_ENDIAN__ )
2017-04-27 13:40:18 +02:00
2011-09-27 03:32:27 +02: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 10:02:17 +02:00
endif ( )
2010-12-08 09:43:06 +01:00
if ( WITH_IMAGE_OPENJPEG )
2015-09-17 11:17:00 +02:00
# Special handling of Windows platform where openjpeg is always static.
if ( WIN32 )
set ( OPENJPEG_DEFINES "-DOPJ_STATIC" )
2018-08-30 14:20:19 +02:00
else ( )
set ( OPENJPEG_DEFINES "" )
2015-09-17 11:17:00 +02:00
endif ( )
2010-12-08 09:43:06 +01:00
endif ( )
2006-11-17 03:27:12 +01:00
2015-03-19 05:41:41 +01:00
if ( NOT WITH_SYSTEM_EIGEN3 )
set ( EIGEN3_INCLUDE_DIRS ${ CMAKE_SOURCE_DIR } /extern/Eigen3 )
endif ( )
2008-10-07 19:13:35 +02:00
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Configure OpenGL.
2014-10-07 22:46:19 +02:00
2010-12-08 09:43:06 +01:00
find_package ( OpenGL )
2011-06-08 07:39:58 +02:00
blender_include_dirs_sys ( "${OPENGL_INCLUDE_DIR}" )
2014-10-07 22:46:19 +02:00
2018-06-16 04:17:16 +02:00
if ( WITH_OPENGL )
add_definitions ( -DWITH_OPENGL )
endif ( )
2014-10-07 22:46:19 +02:00
if ( WITH_SYSTEM_GLES )
find_package_wrapper ( OpenGLES )
endif ( )
2017-05-11 16:38:05 +02:00
if ( WITH_GL_PROFILE_ES20 )
2014-10-07 22:46:19 +02:00
if ( WITH_SYSTEM_GLES )
if ( NOT OPENGLES_LIBRARY )
2016-05-18 03:58:08 +02: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 22:46:19 +02: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 15:03:30 +01:00
if ( NOT OPENGLES_LIBRARY )
2016-05-18 03:58:08 +02: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 22:46:19 +02: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 03:58:08 +02: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 22:46:19 +02: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 15:03:30 +01:00
if ( D3DCOMPILER_DLL STREQUAL "" )
2016-05-18 03:58:08 +02: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 22:46:19 +02:00
endif ( )
endif ( )
endif ( )
2017-05-11 16:38:05 +02:00
else ( )
2019-01-03 17:42:04 +01:00
if ( OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY )
2019-01-06 11:51:38 +01:00
list ( APPEND BLENDER_GL_LIBRARIES ${ OPENGL_gl_LIBRARY } )
2019-01-03 17:42:04 +01:00
else ( )
list ( APPEND BLENDER_GL_LIBRARIES ${ OPENGL_opengl_LIBRARY } ${ OPENGL_glx_LIBRARY } )
endif ( )
2014-10-07 22:46:19 +02:00
endif ( )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DWITH_GL_EGL )
if ( WITH_SYSTEM_GLES )
if ( NOT OPENGLES_EGL_LIBRARY )
2016-05-18 03:58:08 +02: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 22:46:19 +02: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 15:03:30 +01:00
if ( NOT OPENGLES_EGL_LIBRARY )
2016-05-18 03:58:08 +02: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 22:46:19 +02: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 03:58:08 +02: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 22:46:19 +02:00
endif ( )
endif ( )
endif ( )
if ( WITH_GL_PROFILE_ES20 )
list ( APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20 )
2017-05-11 16:38:05 +02:00
else ( )
list ( APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE )
2014-10-07 22:46:19 +02:00
endif ( )
if ( WITH_GL_EGL )
list ( APPEND GL_DEFINITIONS -DWITH_EGL )
endif ( )
2009-10-19 18:20:12 +02:00
2010-11-19 12:33:12 +01:00
#-----------------------------------------------------------------------------
# Configure OpenMP.
2014-07-08 00:29:53 +02:00
if ( WITH_OPENMP )
2019-01-26 14:14:51 +01:00
if ( NOT OPENMP_CUSTOM )
find_package ( OpenMP )
endif ( )
2010-12-08 09:43:06 +01:00
if ( OPENMP_FOUND )
2015-12-02 14:09:06 +01: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 15:41:08 +01:00
# pass OpenMP flags to the linker for static builds, meaning
2015-12-02 14:09:06 +01: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 11:34:41 +01:00
find_library_static ( OpenMP_LIBRARIES gomp ${ CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES } )
2015-12-02 14:09:06 +01:00
endif ( )
2010-12-08 09:43:06 +01:00
else ( )
set ( WITH_OPENMP OFF )
endif ( )
2010-12-21 04:32:51 +01:00
2011-09-30 17:51:58 +02: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 12:33:12 +01:00
2011-04-06 01:31:01 +02:00
#-----------------------------------------------------------------------------
# Configure GLEW
2012-06-23 15:42:14 +02:00
if ( WITH_SYSTEM_GLEW )
2011-04-06 01:31:01 +02:00
find_package ( GLEW )
2014-10-07 22:46:19 +02:00
# Note: There is an assumption here that the system GLEW is not a static library.
2011-04-06 01:31:01 +02:00
if ( NOT GLEW_FOUND )
2014-10-07 22:46:19 +02:00
message ( FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW." )
2011-04-06 01:31:01 +02:00
endif ( )
2017-04-22 06:35:04 +02:00
set ( BLENDER_GLEW_LIBRARIES ${ GLEW_LIBRARY } )
2012-06-23 15:42:14 +02:00
else ( )
2014-10-07 22:46:19 +02: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
2017-05-11 16:38:05 +02:00
if ( WITH_GL_PROFILE_ES20 )
list ( APPEND GL_DEFINITIONS -DGLEW_ES_ONLY )
else ( )
2014-10-07 22:46:19 +02:00
# No ES functions are needed
list ( APPEND GL_DEFINITIONS -DGLEW_NO_ES )
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 )
2018-06-10 08:12:13 +02:00
# This won't affect the non-experimental glew library,
2014-10-07 22:46:19 +02:00
# but is used for conditional compilation elsewhere.
list ( APPEND GL_DEFINITIONS -DGLEW_NO_ES )
set ( BLENDER_GLEW_LIBRARIES extern_glew )
endif ( )
2011-04-06 01:31:01 +02:00
endif ( )
2017-03-23 02:33:19 +01:00
list ( APPEND GL_DEFINITIONS -DGLEW_NO_GLU )
2013-01-03 01:23:52 +01: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 03:27:12 +01:00
#-----------------------------------------------------------------------------
2011-03-24 01:14:49 +01:00
# Configure Python.
if ( WITH_PYTHON_MODULE )
add_definitions ( -DPy_ENABLE_SHARED )
2011-09-30 17:51:58 +02:00
endif ( )
2011-03-24 01:14:49 +01:00
2016-01-04 12:47:36 +01:00
#-----------------------------------------------------------------------------
# Configure GLog/GFlags
if ( WITH_LIBMV OR WITH_GTESTS OR ( WITH_CYCLES AND WITH_CYCLES_LOGGING ) )
2017-04-21 10:58:01 +02:00
if ( WITH_SYSTEM_GFLAGS )
find_package ( Gflags )
if ( NOT GFLAGS_FOUND )
message ( FATAL_ERROR "System wide Gflags is requested but was not found" )
endif ( )
# FindGflags does not define this, and we are not even sure what to use here.
set ( GFLAGS_DEFINES )
else ( )
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 =
)
set ( GFLAGS_NAMESPACE "gflags" )
set ( GFLAGS_LIBRARIES extern_gflags )
set ( GFLAGS_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/extern/gflags/src" )
endif ( )
2017-04-21 14:26:25 +02:00
if ( WITH_SYSTEM_GLOG )
find_package ( Glog )
if ( NOT GLOG_FOUND )
message ( FATAL_ERROR "System wide Glog is requested but was not found" )
endif ( )
# FindGlog does not define this, and we are not even sure what to use here.
set ( GLOG_DEFINES )
else ( )
set ( GLOG_DEFINES
- D G O O G L E _ G L O G _ D L L _ D E C L =
)
set ( GLOG_LIBRARIES extern_glog )
if ( WIN32 )
set ( GLOG_INCLUDE_DIRS ${ CMAKE_SOURCE_DIR } /extern/glog/src/windows )
else ( )
2018-03-23 14:32:18 +01:00
set ( GLOG_INCLUDE_DIRS ${ CMAKE_SOURCE_DIR } /extern/glog/include )
2017-04-21 14:26:25 +02:00
endif ( )
endif ( )
2016-01-04 12:47:36 +01:00
endif ( )
2016-01-04 14:11:12 +01:00
#-----------------------------------------------------------------------------
# Configure Ceres
if ( WITH_LIBMV )
2018-07-25 16:59:46 +02:00
# We always have C++11 which includes unordered_map.
set ( CERES_DEFINES -DCERES_STD_UNORDERED_MAP )
2016-01-04 14:11:12 +01:00
endif ( )
2011-03-24 01:14:49 +01:00
#-----------------------------------------------------------------------------
2006-11-17 03:27:12 +01:00
# Extra compile flags
2010-10-18 14:35:40 +02:00
2010-12-08 09:43:06 +01:00
if ( CMAKE_COMPILER_IS_GNUCC )
2010-12-16 10:55:35 +01:00
2010-12-21 04:32:51 +01: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 03:52:28 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type )
2015-11-22 17:12:54 +01:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ERROR_VLA -Werror=vla )
2011-03-15 23:30:07 +01:00
# system headers sometimes do this, disable for now, was: -Werror=strict-prototypes
2012-09-15 03:52:28 +02: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 04:32:51 +01: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 03:35:00 +02: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 03:02:39 +02: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 12:39:25 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits )
2015-04-24 11:11:02 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness )
2017-10-05 03:08:17 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_RESTRICT -Wrestrict )
2011-09-26 11:43:35 +02:00
2012-10-20 15:29:07 +02:00
# gcc 4.2 gives annoying warnings on every file with this
2013-03-24 13:13:13 +01:00
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3" )
2012-10-20 15:29:07 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized )
endif ( )
2013-03-14 14:00:00 +01:00
# versions before gcc4.6 give many BLI_math warnings
2013-03-24 13:13:13 +01: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 14:00:00 +01:00
endif ( )
2015-11-23 05:45:52 +01: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 12:04:16 +02: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 17:46:08 +01: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 04:32:51 +01: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 03:35:00 +02: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 03:02:39 +02: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 12:39:25 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits )
2015-03-27 11:55:58 +01: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 11:11:02 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness )
2017-10-05 03:08:17 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict )
2012-10-01 18:45:50 +02:00
2012-10-20 15:29:07 +02:00
# gcc 4.2 gives annoying warnings on every file with this
2013-03-24 13:13:13 +01:00
if ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3" )
2012-10-20 15:29:07 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized )
endif ( )
2012-10-01 18:45:50 +02: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 10:55:35 +01:00
2017-05-20 06:01:03 +02:00
# Use 'ATTR_FALLTHROUGH' macro to suppress.
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0" ) )
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5 )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5 )
endif ( )
2011-10-30 05:48:00 +01:00
# flags to undo strict flags
2018-06-22 14:17:55 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS -Wno-type-limits )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch )
2018-06-22 14:07:55 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess )
2017-05-22 11:08:10 +02:00
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0" ) )
2018-06-22 14:17:55 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough )
2017-05-22 11:08:10 +02:00
endif ( )
2012-01-01 17:46:08 +01:00
if ( NOT APPLE )
2018-06-22 14:17:55 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable )
2012-01-01 17:46:08 +01:00
endif ( )
2011-10-30 05:48:00 +01:00
2013-12-02 01:36:33 +01:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
2012-06-11 14:13:41 +02:00
2017-10-05 01:50:02 +02:00
# strange, clang complains these are not supported, but then uses them.
2012-06-11 14:13:41 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_ALL -Wall )
2013-02-26 22:58:06 +01: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 14:13:41 +02: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 03:52:28 +02: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 22:58:06 +01:00
ADD_CHECK_C_COMPILER_FLAG ( C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter )
2012-06-11 14:13:41 +02:00
2012-09-20 11:19:49 +02: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 22:58:06 +01:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare )
2012-09-20 11:19:49 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof )
2013-02-26 22:58:06 +01: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 14:13:41 +02:00
2013-03-14 08:25:54 +01:00
# flags to undo strict flags
2018-06-22 14:17:55 +02:00
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef )
ADD_CHECK_C_COMPILER_FLAG ( C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn )
2013-07-15 10:26:16 +02:00
2018-06-22 14:07:55 +02:00
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros )
ADD_CHECK_CXX_COMPILER_FLAG ( CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder )
2013-07-15 10:26:16 +02:00
2010-12-16 10:55:35 +01:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "Intel" )
2010-12-21 04:32:51 +01: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 10:55:35 +01:00
2010-12-21 04:32:51 +01: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 10:55:35 +01:00
2011-10-01 23:09:42 +02:00
# disable numbered, false positives
2018-04-02 16:11:11 +02:00
set ( C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199" )
set ( CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199" )
2014-11-08 21:17:04 +01: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
2018-08-29 18:08:00 +02:00
" / w 3 4 1 8 9 " # local variable is initialized but not referenced
2014-11-08 21:17:04 +01:00
# disable:
" / w d 4 0 1 8 " # signed/unsigned mismatch
2015-12-21 04:54:36 +01:00
" / w d 4 1 4 6 " # unary minus operator applied to unsigned type, result still unsigned
2014-11-08 21:17:04 +01: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'
2018-06-10 08:12:13 +02:00
" / w d 4 8 2 8 " # The file contains a character that is illegal
2018-09-25 19:05:01 +02:00
" / w d 4 9 9 6 " # identifier was declared deprecated
2014-11-08 21:17:04 +01:00
# errors:
" / w e 4 0 1 3 " # 'function' undefined; assuming extern returning int
2017-09-28 04:59:28 +02:00
" / w e 4 1 3 3 " # incompatible pointer types
2014-11-08 21:17:04 +01:00
" / w e 4 4 3 1 " # missing type specifier - int assumed
)
2011-10-01 23:09:42 +02:00
2018-11-29 16:56:33 +01:00
if ( MSVC_VERSION GREATER_EQUAL 1911 )
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
set ( _WARNINGS "${_WARNINGS} /w35038" ) #order of initialisation in c++ constructors
endif ( )
2014-11-08 21:17:04 +01:00
string ( REPLACE ";" " " _WARNINGS "${_WARNINGS}" )
set ( C_WARNINGS "${_WARNINGS}" )
set ( CXX_WARNINGS "${_WARNINGS}" )
unset ( _WARNINGS )
2010-12-08 09:43:06 +01:00
endif ( )
2010-10-17 08:38:56 +02:00
2011-07-16 08:55:45 +02: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 03:58:08 +02: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 08:55:45 +02:00
endif ( )
2012-04-30 11:38:32 +02:00
2018-09-17 11:10:45 +02:00
if ( WIN32 OR APPLE )
# Windows and macOS have this bundled with Python libraries.
2017-08-18 08:24:12 +02:00
elseif ( ( WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY ) OR ( WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE ) )
if ( ( "${PYTHON_NUMPY_PATH}" STREQUAL "" ) OR ( ${ PYTHON_NUMPY_PATH } MATCHES NOTFOUND ) )
find_python_package ( numpy )
unset ( PYTHON_NUMPY_INCLUDE_DIRS CACHE )
set ( PYTHON_NUMPY_INCLUDE_DIRS ${ PYTHON_NUMPY_PATH } /numpy/core/include CACHE PATH "Path to the include directory of the numpy module" )
2018-09-17 11:10:45 +02:00
mark_as_advanced ( PYTHON_NUMPY_INCLUDE_DIRS )
2017-08-18 08:24:12 +02:00
endif ( )
2012-04-30 11:38:32 +02:00
endif ( )
2014-03-04 19:39:53 +01:00
if ( WIN32 OR APPLE )
# pass, we have this in lib/python/site-packages
elseif ( WITH_PYTHON_INSTALL_REQUESTS )
2014-07-28 16:42:30 +02:00
find_python_package ( requests )
2014-03-04 19:39:53 +01:00
endif ( )
2011-07-16 08:55:45 +02:00
endif ( )
2018-07-25 16:59:46 +02:00
if (
C M A K E _ C O M P I L E R _ I S _ G N U C C O R
C M A K E _ C _ C O M P I L E R _ I D M A T C H E S " C l a n g " O R
C M A K E _ C _ C O M P I L E R _ I D M A T C H E S " I n t e l "
)
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
elseif ( MSVC )
# Nothing special is needed, C++11 features are available by default.
2016-05-22 13:41:55 +02:00
else ( )
2018-07-25 16:59:46 +02:00
message ( FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++11 build" )
2015-02-09 18:23:21 +01:00
endif ( )
2015-11-22 22:31:29 +01:00
# Visual Studio has all standards it supports available by default
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 22:34:47 +02:00
# Clang on windows copies this behavior and does not support these switches
if (
C M A K E _ C O M P I L E R _ I S _ G N U C C O R
( C M A K E _ C _ C O M P I L E R _ I D M A T C H E S " C l a n g " AND ( NOT MSVC ) ) O R
( C M A K E _ C _ C O M P I L E R _ I D M A T C H E S " I n t e l " )
)
2018-09-28 10:06:59 +02:00
# Use C11 + GNU extensions, works with GCC, Clang, ICC
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11" )
2015-11-22 17:12:54 +01:00
endif ( )
2012-10-20 15:08:51 +02: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 18:20:12 +02:00
2017-04-27 13:40:18 +02:00
# defined above, platform specific but shared names
2013-08-28 06:32:39 +02:00
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 10:48:21 +01:00
O S L _ I N C L U D E _ D I R
2013-08-28 06:32:39 +02:00
)
mark_as_advanced (
L L V M _ C O N F I G
2015-03-05 05:36:22 +01:00
L L V M _ R O O T _ D I R
2013-08-28 06:32:39 +02: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-21 00:39:29 +01:00
#-------------------------------------------------------------------------------
# Global Defines
2011-05-24 08:44:39 +02:00
# better not set includes here but this debugging option is off by default.
2010-12-08 09:43:06 +01:00
if ( WITH_CXX_GUARDEDALLOC )
2011-05-24 08:44:39 +02:00
include_directories ( ${ CMAKE_SOURCE_DIR } /intern/guardedalloc )
2012-06-25 12:35:24 +02:00
add_definitions ( -DWITH_CXX_GUARDEDALLOC )
2010-12-08 09:43:06 +01:00
endif ( )
2006-11-17 03:27:12 +01:00
2010-12-15 11:22:26 +01:00
if ( WITH_ASSERT_ABORT )
add_definitions ( -DWITH_ASSERT_ABORT )
endif ( )
2010-12-16 13:48:30 +01:00
# message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
# message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Libraries
2010-12-06 11:56:37 +01:00
2014-06-18 18:28:27 +02:00
if ( WITH_GTESTS )
2014-06-18 14:49:17 +02:00
include ( GTestTesting )
endif ( )
2018-04-16 15:54:36 +02:00
if ( WITH_BLENDER )
2014-01-20 20:41:54 +01:00
add_subdirectory ( intern )
add_subdirectory ( extern )
2014-06-18 14:49:17 +02:00
# source after intern and extern to gather all
# internal and external library information first, for test linking
add_subdirectory ( source )
2014-01-20 20:41:54 +01:00
elseif ( WITH_CYCLES_STANDALONE )
add_subdirectory ( intern/cycles )
2014-09-14 17:40:34 +02:00
add_subdirectory ( extern/clew )
2016-01-14 08:24:09 +01:00
if ( WITH_CUDA_DYNLOAD )
add_subdirectory ( extern/cuew )
endif ( )
2014-01-25 14:19:32 +01:00
if ( NOT WITH_SYSTEM_GLEW )
2014-01-20 20:41:54 +01:00
add_subdirectory ( extern/glew )
endif ( )
endif ( )
2006-11-17 03:27:12 +01:00
#-----------------------------------------------------------------------------
# Blender Application
2011-07-13 10:15:06 +02:00
if ( WITH_BLENDER )
add_subdirectory ( source/creator )
endif ( )
2006-11-17 03:27:12 +01:00
2008-09-09 23:15:30 +02:00
2014-06-18 13:44:40 +02:00
#-----------------------------------------------------------------------------
# Testing
add_subdirectory ( tests )
2011-02-15 19:33:05 +01:00
#-----------------------------------------------------------------------------
# CPack for generating packages
include ( build_files/cmake/packaging.cmake )
2011-06-19 15:49:20 +02:00
2016-07-18 15:16:45 +02:00
#-----------------------------------------------------------------------------
# Use dynamic loading for OpenMP
if ( WITH_BLENDER )
openmp_delayload ( blender )
2017-10-30 02:58:44 +01:00
endif ( )
2011-06-19 15:49:20 +02:00
#-----------------------------------------------------------------------------
# Print Final Configuration
if ( FIRST_RUN )
2015-06-17 01:16:17 +02:00
set ( _config_msg "\nBlender Configuration\n=====================" )
function ( info_cfg_option
_ s e t t i n g
)
set ( _msg " - ${_setting}" )
2011-06-19 15:49:20 +02:00
string ( LENGTH "${_msg}" _len )
2012-04-30 11:38:32 +02:00
while ( "32" GREATER "${_len}" )
2011-06-19 15:49:20 +02:00
set ( _msg "${_msg} " )
2016-05-18 03:58:08 +02:00
math ( EXPR _len "${_len} + 1" )
2011-06-19 15:49:20 +02:00
endwhile ( )
2015-06-17 01:16:17 +02:00
set ( _config_msg "${_config_msg}\n${_msg}${${_setting}}" PARENT_SCOPE )
endfunction ( )
2011-09-30 17:51:58 +02:00
2015-06-17 01:16:17 +02:00
function ( info_cfg_text
_ t e x t
)
2011-09-30 17:51:58 +02:00
2015-06-17 01:16:17 +02:00
set ( _config_msg "${_config_msg}\n\n ${_text}" PARENT_SCOPE )
endfunction ( )
2011-06-19 15:49:20 +02:00
2013-12-02 01:36:33 +01:00
message ( STATUS "C Compiler: \" ${ CMAKE_C_COMPILER_ID } \"")
message ( STATUS "C++ Compiler: \" ${ CMAKE_CXX_COMPILER_ID } \"")
2011-06-19 15:49:20 +02:00
info_cfg_text ( "Build Options:" )
info_cfg_option ( WITH_BULLET )
2012-08-20 00:19:19 +02:00
info_cfg_option ( WITH_IK_SOLVER )
2011-06-19 15:49:20 +02: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 08:32:53 +02:00
info_cfg_option ( WITH_INPUT_NDOF )
2011-11-07 18:13:32 +01:00
info_cfg_option ( WITH_CYCLES )
2013-05-24 12:15:20 +02:00
info_cfg_option ( WITH_FREESTYLE )
2012-09-15 12:03:17 +02: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 08:39:29 +01: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 06:20:37 +02:00
info_cfg_option ( WITH_ALEMBIC )
2011-06-19 15:49:20 +02: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 21:07:58 +02:00
info_cfg_option ( WITH_X11_ALPHA )
2012-01-02 13:25:14 +01:00
info_cfg_option ( WITH_X11_XF86VMODE )
2017-10-25 11:12:12 +02:00
info_cfg_option ( WITH_X11_XFIXES )
2011-06-19 15:49:20 +02:00
info_cfg_option ( WITH_X11_XINPUT )
2012-04-12 07:34:17 +02:00
info_cfg_option ( WITH_MEM_JEMALLOC )
2013-10-05 13:59:15 +02:00
info_cfg_option ( WITH_MEM_VALGRIND )
2012-06-23 16:23:44 +02:00
info_cfg_option ( WITH_SYSTEM_GLEW )
2011-06-19 15:49:20 +02:00
info_cfg_text ( "Image Formats:" )
2013-10-13 11:35:54 +02:00
info_cfg_option ( WITH_OPENIMAGEIO )
2011-06-19 15:49:20 +02: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 12:35:36 +01:00
info_cfg_option ( WITH_SDL_DYNLOAD )
2011-06-19 15:49:20 +02:00
info_cfg_option ( WITH_JACK )
2013-03-27 08:19:54 +01:00
info_cfg_option ( WITH_JACK_DYNLOAD )
2012-10-08 04:51:42 +02:00
info_cfg_option ( WITH_CODEC_AVI )
2011-06-19 15:49:20 +02: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 11:38:32 +02:00
info_cfg_option ( WITH_PYTHON_INSTALL_NUMPY )
2011-06-19 15:49:20 +02:00
info_cfg_option ( WITH_PYTHON_MODULE )
info_cfg_option ( WITH_PYTHON_SAFETY )
2013-02-22 23:24:38 +01:00
if ( APPLE )
info_cfg_option ( WITH_PYTHON_FRAMEWORK )
endif ( )
2011-06-19 15:49:20 +02:00
info_cfg_text ( "Modifiers:" )
2011-12-31 04:34:44 +01:00
info_cfg_option ( WITH_MOD_REMESH )
2011-06-19 15:49:20 +02:00
info_cfg_option ( WITH_MOD_FLUID )
2011-11-13 15:16:43 +01:00
info_cfg_option ( WITH_MOD_OCEANSIM )
2011-06-19 15:49:20 +02:00
2014-10-07 22:46:19 +02:00
info_cfg_text ( "OpenGL:" )
info_cfg_option ( WITH_GLEW_ES )
info_cfg_option ( WITH_GL_EGL )
info_cfg_option ( WITH_GL_PROFILE_ES20 )
if ( WIN32 )
info_cfg_option ( WITH_GL_ANGLE )
endif ( )
2011-06-19 15:49:20 +02:00
info_cfg_text ( "" )
message ( "${_config_msg}" )
endif ( )
2014-11-16 12:57:42 +01:00
if ( 0 )
print_all_vars ( )
endif ( )