2016-08-09 15:19:11 +02:00
|
|
|
# ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# 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,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
# The Original Code is Copyright (C) 2016, Blender Foundation
|
|
|
|
# All rights reserved.
|
|
|
|
# ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
|
|
|
# Libraries configuration for Apple.
|
|
|
|
|
2020-07-16 09:25:55 +02:00
|
|
|
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
|
|
|
set(MACOSX_DEPLOYMENT_TARGET 11.00)
|
|
|
|
else()
|
|
|
|
set(MACOSX_DEPLOYMENT_TARGET 10.13)
|
|
|
|
endif()
|
2017-03-16 15:02:07 -04:00
|
|
|
|
2017-04-22 19:03:59 +02:00
|
|
|
macro(find_package_wrapper)
|
|
|
|
# do nothing, just satisfy the macro
|
|
|
|
endmacro()
|
|
|
|
|
2016-08-09 15:19:11 +02:00
|
|
|
if(NOT DEFINED LIBDIR)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
|
|
|
# Prefer lib directory paths
|
|
|
|
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
|
|
|
set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
|
2016-08-09 15:19:11 +02:00
|
|
|
else()
|
2019-04-17 06:35:54 +02:00
|
|
|
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
if(NOT EXISTS "${LIBDIR}/")
|
2019-04-17 06:35:54 +02:00
|
|
|
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENAL)
|
2019-04-17 06:35:54 +02:00
|
|
|
find_package(OpenAL)
|
|
|
|
if(OPENAL_FOUND)
|
|
|
|
set(WITH_OPENAL ON)
|
|
|
|
else()
|
|
|
|
set(WITH_OPENAL OFF)
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_ALEMBIC)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(ALEMBIC ${LIBDIR}/alembic)
|
|
|
|
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
|
|
|
|
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
|
|
|
|
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
|
|
|
|
set(ALEMBIC_LIBRARIES Alembic)
|
|
|
|
set(ALEMBIC_FOUND ON)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
USD: Introducing a simple USD Exporter
This commit introduces the first version of an exporter to Pixar's
Universal Scene Description (USD) format.
Reviewed By: sergey, LazyDodo
Differential Revision: https://developer.blender.org/D6287
- The USD libraries are built by `make deps`, but not yet built by
install_deps.sh.
- Only experimental support for instancing; by default all duplicated
objects are made real in the USD file. This is fine for exporting a
linked-in posed character, not so much for thousands of pebbles etc.
- The way materials and UV coordinates and Normals are exported is going
to change soon.
- This patch contains LazyDodo's fixes for building on Windows in D5359.
== Meshes ==
USD seems to support neither per-material nor per-face-group
double-sidedness, so we just use the flag from the first non-empty
material slot. If there is no material we default to double-sidedness.
Each UV map is stored on the mesh in a separate primvar. Materials can
refer to these UV maps, but this is not yet exported by Blender. The
primvar name is the same as the UV Map name. This is to allow the
standard name "st" for texture coordinates by naming the UV Map as such,
without having to guess which UV Map is the "standard" one.
Face-varying mesh normals are written to USD. When the mesh has custom
loop normals those are written. Otherwise the poly flag `ME_SMOOTH` is
inspected to determine the normals.
The UV maps and mesh normals take up a significant amount of space, so
exporting them is optional. They're still enabled by default, though.
For comparison: a shot of Spring (03_035_A) is 1.2 GiB when exported
with UVs and normals, and 262 MiB without. We probably have room for
optimisation of written UVs and normals.
The mesh subdivision scheme isn't using the default value 'Catmull
Clark', but uses 'None', indicating we're exporting a polygonal mesh.
This is necessary for USD to understand our normals; otherwise the mesh
is always rendered smooth. In the future we may want to expose this
choice of subdivision scheme to the user, or auto-detect it when we
actually support exporting pre-subdivision meshes.
A possible optimisation could be to inspect whether all polygons are
smooth or flat, and mark the USD mesh as such. This can be added when
needed.
== Animation ==
Mesh and transform animation are now written when passing
`animation=True` to the export operator. There is no inspection of
whether an object is actually animated or not; USD can handle
deduplication of static values for us.
The administration of which timecode to use for the export is left to
the file-format-specific concrete subclasses of
`AbstractHierarchyIterator`; the abstract iterator itself doesn't know
anything about the passage of time. This will allow subclasses for the
frame-based USD format and time-based Alembic format.
== Support for simple preview materials ==
Very simple versions of the materials are now exported, using only the
viewport diffuse RGB, metallic, and roughness.
When there are multiple materials, the mesh faces are stored as geometry
subset and each material is assigned to the appropriate subset. If there
is only one material this is skipped.
The first material if any) is always applied to the mesh itself
(regardless of the existence of geometry subsets), because the Hydra
viewport doesn't support materials on subsets. See
https://github.com/PixarAnimationStudios/USD/issues/542 for more info.
Note that the geometry subsets are not yet time-sampled, so it may break
when an animated mesh changes topology.
Materials are exported as a flat list under a top-level '/_materials'
namespace. This inhibits instancing of the objects using those
materials, so this is subject to change.
== Hair ==
Only the parent strands are exported, and only with a constant colour.
No UV coordinates, no information about the normals.
== Camera ==
Only perspective cameras are supported for now.
== Particles ==
Particles are only written when they are alive, which means that they
are always visible (there is currently no code that deals with marking
them as invisible outside their lifespan).
Particle-system-instanced objects are exported by suffixing the object
name with the particle's persistent ID, giving each particle XForm a
unique name.
== Instancing/referencing ==
This exporter has experimental support for instancing/referencing.
Dupli-object meshes are now written to USD as references to the original
mesh. This is still very limited in correctness, as there are issues
referencing to materials from a referenced mesh.
I am still committing this, as it gives us a place to start when
continuing the quest for proper instancing in USD.
== Lights ==
USD does not directly support spot lights, so those aren't exported yet.
It's possible to add this in the future via the UsdLuxShapingAPI. The
units used for the light intensity are also still a bit of a mystery.
== Fluid vertex velocities ==
Currently only fluid simulations (not meshes in general) have explicit
vertex velocities. This is the most important case for exporting
velocities, though, as the baked mesh changes topology all the time, and
thus computing the velocities at import time in a post-processing step
is hard.
== The Building Process ==
- USD is built as monolithic library, instead of 25 smaller libraries.
We were linking all of them as 'whole archive' anyway, so this doesn't
affect the final file size. It does, however, make life easier with
respect to linking order, and handling upstream changes.
- The JSON files required by USD are installed into datafiles/usd; they
are required on every platform. Set the `PXR_PATH_DEBUG` to any value
to have the USD library print the paths it uses to find those files.
- USD is patched so that it finds the aforementioned JSON files in a path
that we pass to it from Blender.
- USD is patched to have a `PXR_BUILD_USD_TOOLS` CMake option to disable
building the tools in its `bin` directory. This is sent as a pull
request at https://github.com/PixarAnimationStudios/USD/pull/1048
2019-12-13 10:27:40 +01:00
|
|
|
if(WITH_USD)
|
2019-12-14 12:41:07 +01:00
|
|
|
find_package(USD)
|
|
|
|
if(NOT USD_FOUND)
|
|
|
|
set(WITH_USD OFF)
|
|
|
|
endif()
|
USD: Introducing a simple USD Exporter
This commit introduces the first version of an exporter to Pixar's
Universal Scene Description (USD) format.
Reviewed By: sergey, LazyDodo
Differential Revision: https://developer.blender.org/D6287
- The USD libraries are built by `make deps`, but not yet built by
install_deps.sh.
- Only experimental support for instancing; by default all duplicated
objects are made real in the USD file. This is fine for exporting a
linked-in posed character, not so much for thousands of pebbles etc.
- The way materials and UV coordinates and Normals are exported is going
to change soon.
- This patch contains LazyDodo's fixes for building on Windows in D5359.
== Meshes ==
USD seems to support neither per-material nor per-face-group
double-sidedness, so we just use the flag from the first non-empty
material slot. If there is no material we default to double-sidedness.
Each UV map is stored on the mesh in a separate primvar. Materials can
refer to these UV maps, but this is not yet exported by Blender. The
primvar name is the same as the UV Map name. This is to allow the
standard name "st" for texture coordinates by naming the UV Map as such,
without having to guess which UV Map is the "standard" one.
Face-varying mesh normals are written to USD. When the mesh has custom
loop normals those are written. Otherwise the poly flag `ME_SMOOTH` is
inspected to determine the normals.
The UV maps and mesh normals take up a significant amount of space, so
exporting them is optional. They're still enabled by default, though.
For comparison: a shot of Spring (03_035_A) is 1.2 GiB when exported
with UVs and normals, and 262 MiB without. We probably have room for
optimisation of written UVs and normals.
The mesh subdivision scheme isn't using the default value 'Catmull
Clark', but uses 'None', indicating we're exporting a polygonal mesh.
This is necessary for USD to understand our normals; otherwise the mesh
is always rendered smooth. In the future we may want to expose this
choice of subdivision scheme to the user, or auto-detect it when we
actually support exporting pre-subdivision meshes.
A possible optimisation could be to inspect whether all polygons are
smooth or flat, and mark the USD mesh as such. This can be added when
needed.
== Animation ==
Mesh and transform animation are now written when passing
`animation=True` to the export operator. There is no inspection of
whether an object is actually animated or not; USD can handle
deduplication of static values for us.
The administration of which timecode to use for the export is left to
the file-format-specific concrete subclasses of
`AbstractHierarchyIterator`; the abstract iterator itself doesn't know
anything about the passage of time. This will allow subclasses for the
frame-based USD format and time-based Alembic format.
== Support for simple preview materials ==
Very simple versions of the materials are now exported, using only the
viewport diffuse RGB, metallic, and roughness.
When there are multiple materials, the mesh faces are stored as geometry
subset and each material is assigned to the appropriate subset. If there
is only one material this is skipped.
The first material if any) is always applied to the mesh itself
(regardless of the existence of geometry subsets), because the Hydra
viewport doesn't support materials on subsets. See
https://github.com/PixarAnimationStudios/USD/issues/542 for more info.
Note that the geometry subsets are not yet time-sampled, so it may break
when an animated mesh changes topology.
Materials are exported as a flat list under a top-level '/_materials'
namespace. This inhibits instancing of the objects using those
materials, so this is subject to change.
== Hair ==
Only the parent strands are exported, and only with a constant colour.
No UV coordinates, no information about the normals.
== Camera ==
Only perspective cameras are supported for now.
== Particles ==
Particles are only written when they are alive, which means that they
are always visible (there is currently no code that deals with marking
them as invisible outside their lifespan).
Particle-system-instanced objects are exported by suffixing the object
name with the particle's persistent ID, giving each particle XForm a
unique name.
== Instancing/referencing ==
This exporter has experimental support for instancing/referencing.
Dupli-object meshes are now written to USD as references to the original
mesh. This is still very limited in correctness, as there are issues
referencing to materials from a referenced mesh.
I am still committing this, as it gives us a place to start when
continuing the quest for proper instancing in USD.
== Lights ==
USD does not directly support spot lights, so those aren't exported yet.
It's possible to add this in the future via the UsdLuxShapingAPI. The
units used for the light intensity are also still a bit of a mystery.
== Fluid vertex velocities ==
Currently only fluid simulations (not meshes in general) have explicit
vertex velocities. This is the most important case for exporting
velocities, though, as the baked mesh changes topology all the time, and
thus computing the velocities at import time in a post-processing step
is hard.
== The Building Process ==
- USD is built as monolithic library, instead of 25 smaller libraries.
We were linking all of them as 'whole archive' anyway, so this doesn't
affect the final file size. It does, however, make life easier with
respect to linking order, and handling upstream changes.
- The JSON files required by USD are installed into datafiles/usd; they
are required on every platform. Set the `PXR_PATH_DEBUG` to any value
to have the USD library print the paths it uses to find those files.
- USD is patched so that it finds the aforementioned JSON files in a path
that we pass to it from Blender.
- USD is patched to have a `PXR_BUILD_USD_TOOLS` CMake option to disable
building the tools in its `bin` directory. This is sent as a pull
request at https://github.com/PixarAnimationStudios/USD/pull/1048
2019-12-13 10:27:40 +01:00
|
|
|
endif()
|
|
|
|
|
2018-11-26 11:41:38 +01:00
|
|
|
if(WITH_OPENSUBDIV)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
|
|
|
|
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
|
|
|
|
find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
|
|
|
|
find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
|
|
|
|
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
|
|
|
|
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
|
|
|
|
list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_JACK)
|
2019-04-17 06:35:54 +02:00
|
|
|
find_library(JACK_FRAMEWORK
|
|
|
|
NAMES jackmp
|
|
|
|
)
|
|
|
|
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
|
|
|
|
if(NOT JACK_FRAMEWORK)
|
|
|
|
set(WITH_JACK OFF)
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_CODEC_SNDFILE)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(LIBSNDFILE ${LIBDIR}/sndfile)
|
|
|
|
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
|
|
|
|
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
|
|
|
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_PYTHON)
|
2019-04-17 06:35:54 +02:00
|
|
|
# we use precompiled libraries for py 3.7 and up by default
|
|
|
|
set(PYTHON_VERSION 3.7)
|
|
|
|
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
|
|
|
# normally cached but not since we include them with blender
|
|
|
|
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
|
|
|
|
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
|
|
|
|
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}m.a)
|
|
|
|
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
|
|
|
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
|
|
|
|
else()
|
|
|
|
# module must be compiled against Python framework
|
|
|
|
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
|
|
|
|
|
|
|
|
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}m")
|
|
|
|
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}m")
|
|
|
|
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
|
2019-10-29 01:32:33 +11:00
|
|
|
# set(PYTHON_LIBRARY python${PYTHON_VERSION})
|
|
|
|
# set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
|
2019-04-17 06:35:54 +02:00
|
|
|
|
|
|
|
unset(_py_framework)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# uncached vars
|
|
|
|
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
|
|
|
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
|
|
|
|
|
|
|
|
# needed for Audaspace, numpy is installed into python site-packages
|
|
|
|
set(PYTHON_NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
|
|
|
|
|
|
|
|
if(NOT EXISTS "${PYTHON_EXECUTABLE}")
|
|
|
|
message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_FFTW3)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(FFTW3 ${LIBDIR}/fftw3)
|
|
|
|
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
|
|
|
set(FFTW3_LIBRARIES fftw3)
|
|
|
|
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(ZLIB /usr)
|
|
|
|
set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
|
|
|
|
set(ZLIB_LIBRARIES z bz2)
|
|
|
|
|
CMake: Refactor external dependencies handling
This is a more correct fix to the issue Brecht was fixing in D6600.
While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).
Top-level idea: leave it to CMake to keep track of dependency graph.
The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.
It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.
For example, this order will likely fail:
libbf_blenfont.a libfreetype6.a libbf_blenfont.a
This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.
General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.
The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.
Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.
The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:
- Have every library prefixed as "optimized" or "debug" if
separation is needed (non-prefixed libraries will be considered
"generic").
- Loop through libraries passed to function and do simple parsing
which will look for "optimized" and "debug" words and specify
following library to corresponding category.
This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.
Tested the following configurations on Linux, macOS and Windows:
- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer
NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.
Differential Revision: https://developer.blender.org/D6642
2020-01-20 18:36:19 +01:00
|
|
|
set(PNG_LIBRARIES png ${ZLIB_LIBRARIES})
|
|
|
|
set(JPEG_LIBRARIES jpeg)
|
|
|
|
|
2016-08-09 15:19:11 +02:00
|
|
|
set(FREETYPE ${LIBDIR}/freetype)
|
|
|
|
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
|
|
|
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
|
|
|
set(FREETYPE_LIBRARY freetype)
|
|
|
|
|
|
|
|
if(WITH_IMAGE_OPENEXR)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENEXR ${LIBDIR}/openexr)
|
|
|
|
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
|
|
|
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
|
|
|
|
set(OPENEXR_LIBRARIES
|
|
|
|
Iex
|
|
|
|
Half
|
|
|
|
IlmImf
|
|
|
|
Imath
|
|
|
|
IlmThread)
|
|
|
|
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_CODEC_FFMPEG)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(FFMPEG ${LIBDIR}/ffmpeg)
|
|
|
|
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
|
|
|
set(FFMPEG_LIBRARIES
|
|
|
|
avcodec avdevice avformat avutil
|
|
|
|
mp3lame swscale x264 xvidcore
|
|
|
|
theora theoradec theoraenc
|
2019-10-12 18:33:34 +03:00
|
|
|
vorbis vorbisenc vorbisfile ogg opus
|
2019-10-04 18:33:20 -04:00
|
|
|
vpx swresample)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
2017-10-24 13:09:41 +02:00
|
|
|
if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
|
2019-04-17 06:35:54 +02:00
|
|
|
# use openjpeg from libdir that is linked into ffmpeg
|
|
|
|
set(OPENJPEG ${LIBDIR}/openjpeg)
|
|
|
|
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
|
|
|
|
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
|
2016-09-14 11:41:20 +02:00
|
|
|
endif()
|
|
|
|
|
2016-08-09 15:19:11 +02:00
|
|
|
find_library(SYSTEMSTUBS_LIBRARY
|
2019-04-17 06:35:54 +02:00
|
|
|
NAMES
|
|
|
|
SystemStubs
|
|
|
|
PATHS
|
2016-08-09 15:19:11 +02:00
|
|
|
)
|
|
|
|
mark_as_advanced(SYSTEMSTUBS_LIBRARY)
|
|
|
|
if(SYSTEMSTUBS_LIBRARY)
|
2019-04-17 06:35:54 +02:00
|
|
|
list(APPEND PLATFORM_LINKLIBS SystemStubs)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
2020-09-16 02:16:15 +05:30
|
|
|
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -pipe -funsigned-char")
|
2016-08-09 15:19:11 +02:00
|
|
|
set(PLATFORM_LINKFLAGS
|
2019-05-24 18:38:20 +02:00
|
|
|
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework Metal -framework QuartzCore"
|
2016-08-09 15:19:11 +02:00
|
|
|
)
|
|
|
|
|
2017-09-28 20:52:22 +02:00
|
|
|
list(APPEND PLATFORM_LINKLIBS c++)
|
2016-08-09 15:19:11 +02:00
|
|
|
|
|
|
|
if(WITH_JACK)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
|
2019-04-17 06:35:54 +02:00
|
|
|
# force cmake to link right framework
|
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENCOLLADA)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENCOLLADA ${LIBDIR}/opencollada)
|
|
|
|
|
|
|
|
set(OPENCOLLADA_INCLUDE_DIRS
|
|
|
|
${LIBDIR}/opencollada/include/COLLADAStreamWriter
|
|
|
|
${LIBDIR}/opencollada/include/COLLADABaseUtils
|
|
|
|
${LIBDIR}/opencollada/include/COLLADAFramework
|
|
|
|
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
|
|
|
|
${LIBDIR}/opencollada/include/GeneratedSaxParser
|
|
|
|
)
|
|
|
|
|
|
|
|
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
|
|
|
set(OPENCOLLADA_LIBRARIES
|
|
|
|
OpenCOLLADASaxFrameworkLoader
|
|
|
|
-lOpenCOLLADAFramework
|
|
|
|
-lOpenCOLLADABaseUtils
|
|
|
|
-lOpenCOLLADAStreamWriter
|
|
|
|
-lMathMLSolver
|
|
|
|
-lGeneratedSaxParser
|
|
|
|
-lbuffer -lftoa -lUTF
|
|
|
|
)
|
2020-03-27 14:24:52 +01:00
|
|
|
# PCRE and XML2 are bundled with OpenCollada.
|
2019-04-17 06:35:54 +02:00
|
|
|
set(PCRE_LIBRARIES pcre)
|
2020-03-27 14:24:52 +01:00
|
|
|
set(XML2_LIBRARIES xml2)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_SDL)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(SDL ${LIBDIR}/sdl)
|
|
|
|
set(SDL_INCLUDE_DIR ${SDL}/include)
|
|
|
|
set(SDL_LIBRARY SDL2)
|
|
|
|
set(SDL_LIBPATH ${SDL}/lib)
|
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PNG "${LIBDIR}/png")
|
|
|
|
set(PNG_INCLUDE_DIRS "${PNG}/include")
|
|
|
|
set(PNG_LIBPATH ${PNG}/lib)
|
|
|
|
|
|
|
|
set(JPEG "${LIBDIR}/jpeg")
|
|
|
|
set(JPEG_INCLUDE_DIR "${JPEG}/include")
|
|
|
|
set(JPEG_LIBPATH ${JPEG}/lib)
|
|
|
|
|
|
|
|
if(WITH_IMAGE_TIFF)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(TIFF ${LIBDIR}/tiff)
|
|
|
|
set(TIFF_INCLUDE_DIR ${TIFF}/include)
|
|
|
|
set(TIFF_LIBRARY tiff)
|
|
|
|
set(TIFF_LIBPATH ${TIFF}/lib)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_BOOST)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(BOOST ${LIBDIR}/boost)
|
|
|
|
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
|
|
|
set(BOOST_POSTFIX)
|
|
|
|
set(BOOST_LIBRARIES
|
|
|
|
boost_date_time${BOOST_POSTFIX}
|
|
|
|
boost_filesystem${BOOST_POSTFIX}
|
|
|
|
boost_regex${BOOST_POSTFIX}
|
|
|
|
boost_system${BOOST_POSTFIX}
|
|
|
|
boost_thread${BOOST_POSTFIX}
|
|
|
|
boost_wave${BOOST_POSTFIX}
|
|
|
|
)
|
|
|
|
if(WITH_INTERNATIONAL)
|
|
|
|
list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
|
|
|
|
endif()
|
|
|
|
if(WITH_CYCLES_NETWORK)
|
|
|
|
list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
|
|
|
|
endif()
|
|
|
|
if(WITH_OPENVDB)
|
|
|
|
list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
|
|
|
|
endif()
|
|
|
|
set(BOOST_LIBPATH ${BOOST}/lib)
|
|
|
|
set(BOOST_DEFINITIONS)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it !
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENIMAGEIO)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENIMAGEIO ${LIBDIR}/openimageio)
|
|
|
|
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
|
|
|
|
set(OPENIMAGEIO_LIBRARIES
|
|
|
|
${OPENIMAGEIO}/lib/libOpenImageIO.a
|
|
|
|
${PNG_LIBRARIES}
|
|
|
|
${JPEG_LIBRARIES}
|
|
|
|
${TIFF_LIBRARY}
|
|
|
|
${OPENEXR_LIBRARIES}
|
|
|
|
${OPENJPEG_LIBRARIES}
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
set(OPENIMAGEIO_LIBPATH
|
|
|
|
${OPENIMAGEIO}/lib
|
|
|
|
${JPEG_LIBPATH}
|
|
|
|
${PNG_LIBPATH}
|
|
|
|
${TIFF_LIBPATH}
|
|
|
|
${OPENEXR_LIBPATH}
|
|
|
|
${ZLIB_LIBPATH}
|
|
|
|
)
|
|
|
|
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
|
|
|
|
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENCOLORIO)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
|
|
|
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
|
|
|
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
|
|
|
|
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_OPENVDB)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENVDB ${LIBDIR}/openvdb)
|
|
|
|
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
|
2019-10-09 16:44:29 +02:00
|
|
|
set(OPENVDB_LIBRARIES openvdb blosc)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
|
|
|
|
set(OPENVDB_DEFINITIONS)
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
2020-10-02 17:40:28 +02:00
|
|
|
if(WITH_NANOVDB)
|
|
|
|
set(NANOVDB ${LIBDIR}/nanovdb)
|
|
|
|
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
|
|
|
|
endif()
|
|
|
|
|
2016-08-09 15:19:11 +02:00
|
|
|
if(WITH_LLVM)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
|
|
|
|
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
|
|
|
|
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
|
|
|
|
else()
|
|
|
|
set(LLVM_CONFIG llvm-config)
|
|
|
|
endif()
|
|
|
|
execute_process(COMMAND ${LLVM_CONFIG} --version
|
|
|
|
OUTPUT_VARIABLE LLVM_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
|
|
|
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2019-09-07 18:08:33 +02:00
|
|
|
execute_process(COMMAND ${LLVM_CONFIG} --includedir
|
|
|
|
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2019-04-17 06:35:54 +02:00
|
|
|
execute_process(COMMAND ${LLVM_CONFIG} --libdir
|
|
|
|
OUTPUT_VARIABLE LLVM_LIBPATH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
find_library(LLVM_LIBRARY
|
|
|
|
NAMES LLVMAnalysis # first of a whole bunch of libs to get
|
|
|
|
PATHS ${LLVM_LIBPATH})
|
|
|
|
|
|
|
|
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
|
|
|
if(LLVM_STATIC)
|
|
|
|
# if static LLVM libraries were requested, use llvm-config to generate
|
|
|
|
# the list of what libraries we need, and substitute that in the right
|
|
|
|
# way for LLVM_LIBRARY.
|
|
|
|
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
|
|
|
OUTPUT_VARIABLE LLVM_LIBRARY
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
|
|
|
else()
|
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "LLVM not found.")
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_CYCLES_OSL)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(CYCLES_OSL ${LIBDIR}/osl)
|
|
|
|
|
|
|
|
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
|
|
|
|
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
|
|
|
|
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
|
|
|
|
# WARNING! depends on correct order of OSL libs linking
|
|
|
|
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
|
|
|
|
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
|
|
|
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
2020-08-13 17:39:28 +02:00
|
|
|
find_path(OSL_SHADER_DIR NAMES stdosl.h PATHS ${CYCLES_OSL}/shaders)
|
2019-04-17 06:35:54 +02:00
|
|
|
|
2020-08-13 17:39:28 +02:00
|
|
|
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER AND OSL_SHADER_DIR)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(OSL_FOUND TRUE)
|
|
|
|
else()
|
|
|
|
message(STATUS "OSL not found")
|
|
|
|
set(WITH_CYCLES_OSL OFF)
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
2020-07-16 09:25:55 +02:00
|
|
|
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
|
|
|
set(WITH_CYCLES_EMBREE OFF)
|
|
|
|
set(WITH_OPENIMAGEDENOISE OFF)
|
|
|
|
set(WITH_CPU_SSE OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-11-07 12:58:12 +01:00
|
|
|
if(WITH_CYCLES_EMBREE)
|
2020-02-17 23:44:12 +01:00
|
|
|
find_package(Embree 3.8.0 REQUIRED)
|
2019-04-17 06:35:54 +02:00
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
|
2020-09-18 17:07:11 +02:00
|
|
|
|
|
|
|
# Embree static library linking can mix up SSE and AVX symbols, causing
|
|
|
|
# crashes on macOS systems with older CPUs that don't have AVX. Using
|
|
|
|
# force load avoids that. The Embree shared library does not suffer from
|
|
|
|
# this problem, precisely because linking a shared library uses force load.
|
|
|
|
set(_embree_libraries_force_load)
|
|
|
|
foreach(_embree_library ${EMBREE_LIBRARIES})
|
|
|
|
list(APPEND _embree_libraries_force_load "-Wl,-force_load,${_embree_library}")
|
|
|
|
endforeach()
|
|
|
|
set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
|
2018-11-07 12:58:12 +01:00
|
|
|
endif()
|
|
|
|
|
Compositor: Added denoising node
This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.
Compositor: Made OpenImageDenoise optional, added CMake and build_env files to find OIDN
Compositor: Fixed some warnings in the denoising operator
build_environment: Updated OpenImageDenoise to 0.8.1
build_environment: Updated OpenImageDenoise in `make deps` for macOS
Reviewers: sergey, jbakker, brecht
Reviewed By: brecht
Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, lukasstockner97
Tags: #compositing
Differential Revision: https://developer.blender.org/D4304
2019-08-14 15:30:26 +02:00
|
|
|
if(WITH_OPENIMAGEDENOISE)
|
|
|
|
find_package(OpenImageDenoise)
|
|
|
|
|
|
|
|
if(NOT OPENIMAGEDENOISE_FOUND)
|
|
|
|
set(WITH_OPENIMAGEDENOISE OFF)
|
|
|
|
message(STATUS "OpenImageDenoise not found")
|
2019-10-09 16:44:29 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_TBB)
|
|
|
|
find_package(TBB)
|
|
|
|
endif()
|
|
|
|
|
2020-09-17 16:59:27 +02:00
|
|
|
if(WITH_POTRACE)
|
|
|
|
find_package(Potrace)
|
|
|
|
if(NOT POTRACE_FOUND)
|
|
|
|
message(WARNING "potrace not found, disabling WITH_POTRACE")
|
|
|
|
set(WITH_POTRACE OFF)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-01-26 14:14:51 +01:00
|
|
|
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
2016-08-09 15:19:11 +02:00
|
|
|
if(WITH_OPENMP)
|
2019-04-17 06:35:54 +02:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
|
|
|
# Use OpenMP from our precompiled libraries.
|
|
|
|
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
|
|
|
set(OPENMP_CUSTOM ON)
|
|
|
|
set(OPENMP_FOUND ON)
|
|
|
|
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
|
|
|
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
|
|
|
|
|
2019-06-28 11:22:33 +02:00
|
|
|
# Copy libomp.dylib to allow executables like datatoc and tests to work.
|
|
|
|
execute_process(
|
2020-03-04 10:47:24 +11:00
|
|
|
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
|
|
|
|
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
|
|
|
|
)
|
2019-04-17 06:35:54 +02:00
|
|
|
execute_process(
|
2020-03-04 10:47:24 +11:00
|
|
|
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
|
|
|
|
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
|
|
|
|
)
|
2019-04-17 06:35:54 +02:00
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
2020-03-04 16:39:00 +01:00
|
|
|
if(WITH_XR_OPENXR)
|
2020-08-07 16:53:06 +02:00
|
|
|
find_package(XR_OpenXR_SDK)
|
|
|
|
if(NOT XR_OPENXR_SDK_FOUND)
|
2020-03-04 16:39:00 +01:00
|
|
|
message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR")
|
|
|
|
set(WITH_XR_OPENXR OFF)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-07-31 09:34:26 -06:00
|
|
|
if(WITH_GMP)
|
|
|
|
find_package(GMP)
|
|
|
|
if(NOT GMP_FOUND)
|
|
|
|
message(WARNING "GMP not found, disabling WITH_GMP")
|
|
|
|
set(WITH_GMP OFF)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-08-09 15:19:11 +02:00
|
|
|
set(EXETYPE MACOSX_BUNDLE)
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
|
|
|
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
|
2019-04-17 06:35:54 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
|
|
|
|
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
|
|
|
|
endif()
|
2016-08-09 15:19:11 +02:00
|
|
|
else()
|
2020-07-16 09:25:55 +02:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
2019-04-17 06:35:54 +02:00
|
|
|
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
|
2016-08-09 15:19:11 +02:00
|
|
|
endif()
|
2020-03-30 21:24:13 +02:00
|
|
|
|
|
|
|
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
|
|
|
# libraries as Blender with a different version or build options.
|
2016-08-09 15:19:11 +02:00
|
|
|
set(PLATFORM_LINKFLAGS
|
2019-04-17 06:35:54 +02:00
|
|
|
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
2016-08-09 15:19:11 +02:00
|
|
|
)
|
|
|
|
|
2017-09-28 20:52:22 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
|
|
|
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
|
2016-08-09 15:19:11 +02:00
|
|
|
|
|
|
|
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
|
|
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
|
|
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
|
|
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|
|
|
|
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
|