2012-05-27 13:22:43 +00: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) 2006, Blender Foundation
# All rights reserved.
# ***** END GPL LICENSE BLOCK *****
2011-06-19 06:57:56 +00:00
2012-07-16 08:26:42 +00:00
macro ( list_insert_after
l i s t _ i d i t e m _ c h e c k i t e m _ a d d
)
set ( _index )
2012-09-13 01:52:58 +00:00
list ( FIND "${list_id}" "${item_check}" _index )
if ( "${_index}" MATCHES "-1" )
message ( FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'" )
endif ( )
2012-07-16 08:26:42 +00:00
math ( EXPR _index "${_index} + 1" )
list ( INSERT ${ list_id } "${_index}" ${ item_add } )
unset ( _index )
endmacro ( )
macro ( list_insert_before
l i s t _ i d i t e m _ c h e c k i t e m _ a d d
)
set ( _index )
2012-09-13 01:52:58 +00:00
list ( FIND "${list_id}" "${item_check}" _index )
if ( "${_index}" MATCHES "-1" )
message ( FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'" )
endif ( )
2012-07-16 08:26:42 +00:00
list ( INSERT ${ list_id } "${_index}" ${ item_add } )
unset ( _index )
endmacro ( )
2015-06-30 12:44:27 +00:00
function ( list_assert_duplicates
2013-10-25 06:21:38 +00:00
l i s t _ i d
)
2018-06-10 06:12:13 +00:00
2013-10-25 06:21:38 +00:00
# message(STATUS "list data: ${list_id}")
list ( LENGTH list_id _len_before )
list ( REMOVE_DUPLICATES list_id )
list ( LENGTH list_id _len_after )
# message(STATUS "list size ${_len_before} -> ${_len_after}")
if ( NOT _len_before EQUAL _len_after )
message ( FATAL_ERROR "duplicate found in list which should not contain duplicates: ${list_id}" )
endif ( )
unset ( _len_before )
unset ( _len_after )
endfunction ( )
2011-06-19 06:57:56 +00:00
# foo_bar.spam --> foo_barMySuffix.spam
macro ( file_suffix
f i l e _ n a m e _ n e w f i l e _ n a m e f i l e _ s u f f i x
)
get_filename_component ( _file_name_PATH ${ file_name } PATH )
get_filename_component ( _file_name_NAME_WE ${ file_name } NAME_WE )
get_filename_component ( _file_name_EXT ${ file_name } EXT )
set ( ${ file_name_new } "${_file_name_PATH}/${_file_name_NAME_WE}${file_suffix}${_file_name_EXT}" )
unset ( _file_name_PATH )
unset ( _file_name_NAME_WE )
unset ( _file_name_EXT )
endmacro ( )
2011-10-23 17:52:20 +00:00
# useful for adding debug suffix to library lists:
2011-06-19 06:57:56 +00:00
# /somepath/foo.lib --> /somepath/foo_d.lib
macro ( file_list_suffix
f p _ l i s t _ n e w f p _ l i s t f n _ s u f f i x
)
# incase of empty list
set ( _fp )
set ( _fp_suffixed )
set ( fp_list_new )
foreach ( _fp ${ fp_list } )
file_suffix ( _fp_suffixed "${_fp}" "${fn_suffix}" )
list ( APPEND "${fp_list_new}" "${_fp_suffixed}" )
endforeach ( )
unset ( _fp )
unset ( _fp_suffixed )
endmacro ( )
2015-12-02 13:09:06 +00:00
if ( UNIX AND NOT APPLE )
macro ( find_package_static )
set ( _cmake_find_library_suffixes_back ${ CMAKE_FIND_LIBRARY_SUFFIXES } )
set ( CMAKE_FIND_LIBRARY_SUFFIXES .a ${ CMAKE_FIND_LIBRARY_SUFFIXES } )
find_package ( ${ ARGV } )
set ( CMAKE_FIND_LIBRARY_SUFFIXES ${ _cmake_find_library_suffixes_back } )
unset ( _cmake_find_library_suffixes_back )
endmacro ( )
macro ( find_library_static )
set ( _cmake_find_library_suffixes_back ${ CMAKE_FIND_LIBRARY_SUFFIXES } )
set ( CMAKE_FIND_LIBRARY_SUFFIXES .a ${ CMAKE_FIND_LIBRARY_SUFFIXES } )
find_library ( ${ ARGV } )
set ( CMAKE_FIND_LIBRARY_SUFFIXES ${ _cmake_find_library_suffixes_back } )
unset ( _cmake_find_library_suffixes_back )
endmacro ( )
endif ( )
2011-06-26 17:18:37 +00:00
2015-06-16 23:16:17 +00:00
function ( target_link_libraries_optimized
T A R G E T
L I B S
)
2011-06-26 17:18:37 +00:00
foreach ( _LIB ${ LIBS } )
target_link_libraries ( ${ TARGET } optimized "${_LIB}" )
endforeach ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
function ( target_link_libraries_debug
T A R G E T
L I B S
)
2011-06-26 17:18:37 +00:00
foreach ( _LIB ${ LIBS } )
target_link_libraries ( ${ TARGET } debug "${_LIB}" )
endforeach ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-12-22 22:15:20 +00:00
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
# use it instead of include_directories()
2015-06-16 23:16:17 +00:00
function ( blender_include_dirs
i n c l u d e s
)
2011-06-11 06:00:28 +00:00
set ( _ALL_INCS "" )
foreach ( _INC ${ ARGV } )
get_filename_component ( _ABS_INC ${ _INC } ABSOLUTE )
list ( APPEND _ALL_INCS ${ _ABS_INC } )
2011-08-08 05:43:04 +00:00
# for checking for invalid includes, disable for regular use
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
2010-12-22 22:15:20 +00:00
endforeach ( )
2011-06-11 06:00:28 +00:00
include_directories ( ${ _ALL_INCS } )
2015-06-16 23:16:17 +00:00
endfunction ( )
function ( blender_include_dirs_sys
i n c l u d e s
)
2010-06-06 13:32:58 +00:00
2011-06-11 06:00:28 +00:00
set ( _ALL_INCS "" )
foreach ( _INC ${ ARGV } )
get_filename_component ( _ABS_INC ${ _INC } ABSOLUTE )
list ( APPEND _ALL_INCS ${ _ABS_INC } )
2011-08-08 05:43:04 +00:00
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
2011-05-31 01:15:44 +00:00
endforeach ( )
2011-06-11 06:00:28 +00:00
include_directories ( SYSTEM ${ _ALL_INCS } )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-11-05 04:18:53 +00:00
2015-06-16 23:16:17 +00:00
function ( blender_source_group
s o u r c e s
)
2010-11-05 04:18:53 +00:00
# Group by location on disk
2010-12-08 08:43:06 +00:00
source_group ( "Source Files" FILES CMakeLists.txt )
2011-05-28 04:53:17 +00:00
2011-06-11 06:00:28 +00:00
foreach ( _SRC ${ sources } )
get_filename_component ( _SRC_EXT ${ _SRC } EXT )
2013-02-26 23:08:42 +00:00
if ( ( ${ _SRC_EXT } MATCHES ".h" ) OR
( $ { _ S R C _ E X T } M A T C H E S " . h p p " ) O R
( $ { _ S R C _ E X T } M A T C H E S " . h h " ) )
2015-06-16 23:16:17 +00:00
set ( GROUP_ID "Header Files" )
2010-12-08 08:43:06 +00:00
else ( )
2015-06-16 23:16:17 +00:00
set ( GROUP_ID "Source Files" )
2010-12-08 08:43:06 +00:00
endif ( )
2015-06-16 23:16:17 +00:00
source_group ( "${GROUP_ID}" FILES ${ _SRC } )
2010-12-08 08:43:06 +00:00
endforeach ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-11-05 04:18:53 +00:00
2011-05-28 04:53:17 +00:00
2016-07-14 09:11:33 +00:00
# Support per-target CMake flags
# Read from: CMAKE_C_FLAGS_**** (made upper case) when set.
#
2018-09-19 15:48:11 +00:00
# 'name' should always match the target name,
2016-07-14 09:11:33 +00:00
# use this macro before add_library or add_executable.
#
# Optionally takes an arg passed to set(), eg PARENT_SCOPE.
macro ( add_cc_flags_custom_test
n a m e
)
string ( TOUPPER ${ name } _name_upper )
if ( DEFINED CMAKE_C_FLAGS_ ${ _name_upper } )
message ( STATUS "Using custom CFLAGS: CMAKE_C_FLAGS_${_name_upper} in \" ${ CMAKE_CURRENT_SOURCE_DIR } \"")
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_name_upper}}" ${ ARGV1 } )
endif ( )
if ( DEFINED CMAKE_CXX_FLAGS_ ${ _name_upper } )
message ( STATUS "Using custom CXXFLAGS: CMAKE_CXX_FLAGS_${_name_upper} in \" ${ CMAKE_CURRENT_SOURCE_DIR } \"")
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_name_upper}}" ${ ARGV1 } )
endif ( )
unset ( _name_upper )
endmacro ( )
2011-05-28 04:53:17 +00:00
# only MSVC uses SOURCE_GROUP
2016-07-14 09:11:33 +00:00
function ( blender_add_lib__impl
2011-05-28 04:53:17 +00:00
n a m e
s o u r c e s
2011-05-31 01:15:44 +00:00
i n c l u d e s
2015-06-16 23:16:17 +00:00
i n c l u d e s _ s y s
)
2011-05-28 04:53:17 +00:00
# message(STATUS "Configuring library ${name}")
# include_directories(${includes})
2011-05-31 01:15:44 +00:00
# include_directories(SYSTEM ${includes_sys})
2011-05-28 04:53:17 +00:00
blender_include_dirs ( "${includes}" )
2011-05-31 01:15:44 +00:00
blender_include_dirs_sys ( "${includes_sys}" )
2011-05-28 04:53:17 +00:00
add_library ( ${ name } ${ sources } )
# works fine without having the includes
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group ( "${sources}" )
2018-06-10 06:12:13 +00:00
#if enabled, set the FOLDER property for visual studio projects
2018-02-03 23:38:27 +00:00
if ( WINDOWS_USE_VISUAL_STUDIO_FOLDERS )
get_filename_component ( FolderDir ${ CMAKE_CURRENT_SOURCE_DIR } DIRECTORY )
string ( REPLACE ${ CMAKE_SOURCE_DIR } "" FolderDir ${ FolderDir } )
set_target_properties ( ${ name } PROPERTIES FOLDER ${ FolderDir } )
endif ( )
2013-10-25 06:21:38 +00:00
list_assert_duplicates ( "${sources}" )
list_assert_duplicates ( "${includes}" )
# Not for system includes because they can resolve to the same path
# list_assert_duplicates("${includes_sys}")
2015-06-16 23:16:17 +00:00
endfunction ( )
2011-05-28 04:53:17 +00:00
2010-11-05 04:18:53 +00:00
2016-07-14 09:11:33 +00:00
function ( blender_add_lib_nolist
n a m e
s o u r c e s
i n c l u d e s
i n c l u d e s _ s y s
)
add_cc_flags_custom_test ( ${ name } PARENT_SCOPE )
blender_add_lib__impl ( ${ name } "${sources}" "${includes}" "${includes_sys}" )
endfunction ( )
2015-06-16 23:16:17 +00:00
function ( blender_add_lib
2010-06-06 13:32:58 +00:00
n a m e
s o u r c e s
2011-05-31 01:15:44 +00:00
i n c l u d e s
2015-06-16 23:16:17 +00:00
i n c l u d e s _ s y s
)
2006-11-17 02:27:12 +00:00
2016-07-14 09:11:33 +00:00
add_cc_flags_custom_test ( ${ name } PARENT_SCOPE )
blender_add_lib__impl ( ${ name } "${sources}" "${includes}" "${includes_sys}" )
2006-11-17 02:27:12 +00:00
2010-12-08 08:43:06 +00:00
set_property ( GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${ name } )
2015-06-16 23:16:17 +00:00
endfunction ( )
2006-11-17 02:27:12 +00:00
2015-06-16 23:16:17 +00:00
function ( SETUP_LIBDIRS )
2011-05-28 04:53:17 +00:00
2016-03-15 02:15:26 +00:00
# NOTE: For all new libraries, use absolute library paths.
# This should eventually be phased out.
2017-10-30 01:58:44 +00:00
if ( NOT MSVC )
2017-10-29 19:16:22 +00:00
link_directories ( ${ JPEG_LIBPATH } ${ PNG_LIBPATH } ${ ZLIB_LIBPATH } ${ FREETYPE_LIBPATH } )
2010-12-08 08:43:06 +00:00
2017-10-29 19:16:22 +00:00
if ( WITH_PYTHON ) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories ( ${ PYTHON_LIBPATH } )
endif ( )
if ( WITH_SDL AND NOT WITH_SDL_DYNLOAD )
link_directories ( ${ SDL_LIBPATH } )
endif ( )
if ( WITH_CODEC_FFMPEG )
link_directories ( ${ FFMPEG_LIBPATH } )
endif ( )
if ( WITH_IMAGE_OPENEXR )
link_directories ( ${ OPENEXR_LIBPATH } )
endif ( )
if ( WITH_IMAGE_TIFF )
link_directories ( ${ TIFF_LIBPATH } )
endif ( )
if ( WITH_BOOST )
link_directories ( ${ BOOST_LIBPATH } )
endif ( )
if ( WITH_OPENIMAGEIO )
link_directories ( ${ OPENIMAGEIO_LIBPATH } )
endif ( )
if ( WITH_OPENCOLORIO )
link_directories ( ${ OPENCOLORIO_LIBPATH } )
endif ( )
if ( WITH_OPENVDB )
link_directories ( ${ OPENVDB_LIBPATH } )
endif ( )
if ( WITH_OPENAL )
link_directories ( ${ OPENAL_LIBPATH } )
endif ( )
if ( WITH_JACK AND NOT WITH_JACK_DYNLOAD )
link_directories ( ${ JACK_LIBPATH } )
endif ( )
if ( WITH_CODEC_SNDFILE )
2017-11-04 16:48:46 +00:00
link_directories ( ${ LIBSNDFILE_LIBPATH } )
2017-10-29 19:16:22 +00:00
endif ( )
if ( WITH_FFTW3 )
link_directories ( ${ FFTW3_LIBPATH } )
endif ( )
if ( WITH_OPENCOLLADA )
link_directories ( ${ OPENCOLLADA_LIBPATH } )
## Never set
# link_directories(${PCRE_LIBPATH})
# link_directories(${EXPAT_LIBPATH})
endif ( )
if ( WITH_LLVM )
link_directories ( ${ LLVM_LIBPATH } )
endif ( )
2010-12-08 08:43:06 +00:00
2017-10-29 19:16:22 +00:00
if ( WITH_ALEMBIC )
link_directories ( ${ ALEMBIC_LIBPATH } )
link_directories ( ${ HDF5_LIBPATH } )
endif ( )
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
2017-10-29 19:16:22 +00:00
if ( WIN32 AND NOT UNIX )
link_directories ( ${ PTHREADS_LIBPATH } )
endif ( )
2017-10-30 01:58:44 +00:00
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-12-08 08:43:06 +00:00
2018-05-31 17:50:30 +00:00
macro ( setup_platform_linker_flags )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" )
set ( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" )
endmacro ( )
2015-06-16 23:16:17 +00:00
function ( setup_liblinks
t a r g e t
)
2011-06-28 02:49:49 +00:00
2015-06-17 14:56:24 +00:00
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE )
set ( CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE )
2009-08-17 18:07:40 +00:00
2015-06-17 14:56:24 +00:00
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE )
set ( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE )
2015-02-05 08:49:46 +00:00
2015-06-17 14:56:24 +00:00
set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE )
set ( CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE )
2015-02-05 08:49:46 +00:00
2018-11-23 10:24:04 +00:00
# jemalloc must be early in the list, to be before pthread (see T57998)
if ( WITH_MEM_JEMALLOC )
target_link_libraries ( ${ target } ${ JEMALLOC_LIBRARIES } )
endif ( )
2015-06-16 23:16:17 +00:00
target_link_libraries (
$ { t a r g e t }
$ { P N G _ L I B R A R I E S }
$ { F R E E T Y P E _ L I B R A R Y }
)
2010-06-06 13:32:58 +00:00
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
2011-03-24 00:14:49 +00:00
if ( WITH_PYTHON ) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
2010-12-08 08:43:06 +00:00
target_link_libraries ( ${ target } ${ PYTHON_LINKFLAGS } )
if ( WIN32 AND NOT UNIX )
2011-06-19 06:57:56 +00:00
file_list_suffix ( PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d" )
2011-06-26 17:18:37 +00:00
target_link_libraries_debug ( ${ target } "${PYTHON_LIBRARIES_DEBUG}" )
target_link_libraries_optimized ( ${ target } "${PYTHON_LIBRARIES}" )
2011-06-19 06:57:56 +00:00
unset ( PYTHON_LIBRARIES_DEBUG )
2010-12-08 08:43:06 +00:00
else ( )
2011-06-19 06:57:56 +00:00
target_link_libraries ( ${ target } ${ PYTHON_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
endif ( )
2015-03-13 11:33:31 +00:00
if ( WITH_LZO AND WITH_SYSTEM_LZO )
target_link_libraries ( ${ target } ${ LZO_LIBRARIES } )
endif ( )
2012-06-23 13:42:14 +00:00
if ( WITH_SYSTEM_GLEW )
2014-10-07 20:46:19 +00:00
target_link_libraries ( ${ target } ${ BLENDER_GLEW_LIBRARIES } )
2011-04-05 23:31:01 +00:00
endif ( )
2013-01-03 00:23:52 +00:00
if ( WITH_BULLET AND WITH_SYSTEM_BULLET )
target_link_libraries ( ${ target } ${ BULLET_LIBRARIES } )
endif ( )
2015-06-16 08:03:35 +00:00
if ( WITH_AUDASPACE AND WITH_SYSTEM_AUDASPACE )
target_link_libraries ( ${ target } ${ AUDASPACE_C_LIBRARIES } ${ AUDASPACE_PY_LIBRARIES } )
2014-03-04 12:44:15 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
if ( WITH_OPENAL )
target_link_libraries ( ${ target } ${ OPENAL_LIBRARY } )
endif ( )
2010-12-22 22:15:20 +00:00
if ( WITH_FFTW3 )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ FFTW3_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
2013-03-27 07:19:54 +00:00
if ( WITH_JACK AND NOT WITH_JACK_DYNLOAD )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ JACK_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
if ( WITH_CODEC_SNDFILE )
2017-08-18 06:24:12 +00:00
target_link_libraries ( ${ target } ${ LIBSNDFILE_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
2014-11-17 11:35:36 +00:00
if ( WITH_SDL AND NOT WITH_SDL_DYNLOAD )
2010-12-08 08:43:06 +00:00
target_link_libraries ( ${ target } ${ SDL_LIBRARY } )
endif ( )
if ( WITH_IMAGE_TIFF )
target_link_libraries ( ${ target } ${ TIFF_LIBRARY } )
endif ( )
2011-11-07 15:44:09 +00:00
if ( WITH_OPENIMAGEIO )
target_link_libraries ( ${ target } ${ OPENIMAGEIO_LIBRARIES } )
endif ( )
2012-09-15 10:03:17 +00:00
if ( WITH_OPENCOLORIO )
target_link_libraries ( ${ target } ${ OPENCOLORIO_LIBRARIES } )
endif ( )
2018-11-26 10:41:38 +00:00
if ( WITH_OPENSUBDIV )
2015-07-20 14:08:06 +00:00
target_link_libraries ( ${ target } ${ OPENSUBDIV_LIBRARIES } )
endif ( )
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
if ( WITH_OPENVDB )
2018-04-24 11:26:54 +00:00
target_link_libraries ( ${ target } ${ OPENVDB_LIBRARIES } ${ TBB_LIBRARIES } ${ BLOSC_LIBRARIES } )
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
endif ( )
2015-02-06 09:51:14 +00:00
if ( WITH_CYCLES_OSL )
target_link_libraries ( ${ target } ${ OSL_LIBRARIES } )
endif ( )
2018-11-07 11:58:12 +00:00
if ( WITH_CYCLES_EMBREE )
target_link_libraries ( ${ target } ${ EMBREE_LIBRARIES } )
endif ( )
2011-11-07 15:44:09 +00:00
if ( WITH_BOOST )
target_link_libraries ( ${ target } ${ BOOST_LIBRARIES } )
2012-11-19 08:51:35 +00:00
if ( Boost_USE_STATIC_LIBS AND Boost_USE_ICU )
target_link_libraries ( ${ target } ${ ICU_LIBRARIES } )
endif ( )
2011-11-07 15:44:09 +00:00
endif ( )
2012-04-22 14:33:40 +00:00
target_link_libraries ( ${ target } ${ JPEG_LIBRARIES } )
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
if ( WITH_ALEMBIC )
target_link_libraries ( ${ target } ${ ALEMBIC_LIBRARIES } ${ HDF5_LIBRARIES } )
endif ( )
2011-06-15 14:00:50 +00:00
if ( WITH_IMAGE_OPENEXR )
2016-03-30 13:15:07 +00:00
target_link_libraries ( ${ target } ${ OPENEXR_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
2018-08-30 12:20:19 +00:00
if ( WITH_IMAGE_OPENJPEG )
2011-06-19 07:46:24 +00:00
target_link_libraries ( ${ target } ${ OPENJPEG_LIBRARIES } )
2011-02-15 19:04:51 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
if ( WITH_CODEC_FFMPEG )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ FFMPEG_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
if ( WITH_OPENCOLLADA )
if ( WIN32 AND NOT UNIX )
2011-06-19 06:57:56 +00:00
file_list_suffix ( OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d" )
2011-06-26 17:18:37 +00:00
target_link_libraries_debug ( ${ target } "${OPENCOLLADA_LIBRARIES_DEBUG}" )
target_link_libraries_optimized ( ${ target } "${OPENCOLLADA_LIBRARIES}" )
2011-06-19 06:57:56 +00:00
unset ( OPENCOLLADA_LIBRARIES_DEBUG )
2011-09-12 13:58:13 +00:00
file_list_suffix ( PCRE_LIBRARIES_DEBUG "${PCRE_LIBRARIES}" "_d" )
target_link_libraries_debug ( ${ target } "${PCRE_LIBRARIES_DEBUG}" )
target_link_libraries_optimized ( ${ target } "${PCRE_LIBRARIES}" )
unset ( PCRE_LIBRARIES_DEBUG )
2011-06-19 06:57:56 +00:00
2010-12-08 08:43:06 +00:00
if ( EXPAT_LIB )
2011-06-19 06:57:56 +00:00
file_list_suffix ( EXPAT_LIB_DEBUG "${EXPAT_LIB}" "_d" )
2011-06-26 17:18:37 +00:00
target_link_libraries_debug ( ${ target } "${EXPAT_LIB_DEBUG}" )
target_link_libraries_optimized ( ${ target } "${EXPAT_LIB}" )
2011-06-19 06:57:56 +00:00
unset ( EXPAT_LIB_DEBUG )
2010-12-08 08:43:06 +00:00
endif ( )
else ( )
2015-06-16 23:16:17 +00:00
target_link_libraries (
$ { t a r g e t }
$ { O P E N C O L L A D A _ L I B R A R I E S }
$ { P C R E _ L I B R A R I E S }
$ { X M L 2 _ L I B R A R I E S }
$ { E X P A T _ L I B }
)
2010-12-08 08:43:06 +00:00
endif ( )
endif ( )
2012-06-28 12:32:06 +00:00
if ( WITH_MOD_CLOTH_ELTOPO )
target_link_libraries ( ${ target } ${ LAPACK_LIBRARIES } )
endif ( )
2012-10-06 11:00:45 +00:00
if ( WITH_LLVM )
target_link_libraries ( ${ target } ${ LLVM_LIBRARY } )
endif ( )
2010-12-08 08:43:06 +00:00
if ( WIN32 AND NOT UNIX )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ PTHREADS_LIBRARIES } )
2010-12-08 08:43:06 +00:00
endif ( )
2015-12-02 13:09:06 +00:00
if ( UNIX AND NOT APPLE )
if ( WITH_OPENMP_STATIC )
target_link_libraries ( ${ target } ${ OpenMP_LIBRARIES } )
endif ( )
2016-05-24 05:57:17 +00:00
if ( WITH_INPUT_NDOF )
target_link_libraries ( ${ target } ${ NDOF_LIBRARIES } )
endif ( )
2015-12-02 13:09:06 +00:00
endif ( )
2017-04-21 12:26:25 +00:00
if ( WITH_SYSTEM_GLOG )
target_link_libraries ( ${ target } ${ GLOG_LIBRARIES } )
endif ( )
2017-04-21 08:58:01 +00:00
if ( WITH_SYSTEM_GFLAGS )
target_link_libraries ( ${ target } ${ GFLAGS_LIBRARIES } )
endif ( )
2012-04-22 14:33:40 +00:00
2018-09-19 15:48:11 +00:00
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES depends on them..
2014-08-05 07:57:50 +00:00
if ( WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV )
2014-08-05 11:52:34 +00:00
target_link_libraries ( ${ target } "extern_clew" )
2016-01-14 07:24:09 +00:00
if ( WITH_CUDA_DYNLOAD )
target_link_libraries ( ${ target } "extern_cuew" )
else ( )
target_link_libraries ( ${ target } ${ CUDA_CUDA_LIBRARY } )
endif ( )
2014-08-05 07:57:50 +00:00
endif ( )
2015-01-08 16:17:40 +00:00
2016-08-26 12:28:39 +00:00
target_link_libraries (
$ { t a r g e t }
$ { Z L I B _ L I B R A R I E S }
)
2015-01-08 16:17:40 +00:00
#system libraries with no dependencies such as platform link libs or opengl should go last
target_link_libraries ( ${ target }
$ { B L E N D E R _ G L _ L I B R A R I E S } )
2016-10-25 08:22:03 +00:00
#target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
target_link_libraries ( ${ target } ${ PLATFORM_LINKLIBS } )
2015-06-16 23:16:17 +00:00
endfunction ( )
function ( SETUP_BLENDER_SORTED_LIBS )
2010-12-08 08:43:06 +00:00
2014-06-18 12:49:17 +00:00
get_property ( BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS )
list ( APPEND BLENDER_LINK_LIBS
b f _ w i n d o w m a n a g e r
b f _ r e n d e r
)
if ( WITH_MOD_FLUID )
list ( APPEND BLENDER_LINK_LIBS bf_intern_elbeem )
endif ( )
if ( WITH_CYCLES )
list ( APPEND BLENDER_LINK_LIBS
c y c l e s _ r e n d e r
2016-05-07 17:47:37 +00:00
c y c l e s _ g r a p h
2014-06-18 12:49:17 +00:00
c y c l e s _ b v h
c y c l e s _ d e v i c e
c y c l e s _ k e r n e l
c y c l e s _ u t i l
c y c l e s _ s u b d )
if ( WITH_CYCLES_OSL )
list ( APPEND BLENDER_LINK_LIBS cycles_kernel_osl )
endif ( )
endif ( )
2017-08-18 06:24:12 +00:00
if ( WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE )
list ( APPEND BLENDER_LINK_LIBS
a u d a s p a c e
a u d a s p a c e - p y )
endif ( )
2014-06-18 12:49:17 +00:00
# Sort libraries
set ( BLENDER_SORTED_LIBS
b f _ w i n d o w m a n a g e r
2018-04-02 13:02:08 +00:00
b f _ e d i t o r _ u n d o
2018-03-19 13:17:59 +00:00
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ s p a c e _ a p i
b f _ e d i t o r _ s p a c e _ a c t i o n
b f _ e d i t o r _ s p a c e _ b u t t o n s
b f _ e d i t o r _ s p a c e _ c o n s o l e
b f _ e d i t o r _ s p a c e _ f i l e
b f _ e d i t o r _ s p a c e _ g r a p h
b f _ e d i t o r _ s p a c e _ i m a g e
b f _ e d i t o r _ s p a c e _ i n f o
b f _ e d i t o r _ s p a c e _ l o g i c
b f _ e d i t o r _ s p a c e _ n l a
b f _ e d i t o r _ s p a c e _ n o d e
b f _ e d i t o r _ s p a c e _ o u t l i n e r
b f _ e d i t o r _ s p a c e _ s c r i p t
b f _ e d i t o r _ s p a c e _ s e q u e n c e r
2018-05-23 20:38:25 +00:00
b f _ e d i t o r _ s p a c e _ s t a t u s b a r
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ s p a c e _ t e x t
b f _ e d i t o r _ s p a c e _ t i m e
UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users
* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.
== Technical Features/Changes
* Adds initial support for global areas
A global area is part of the window, not part of the regular screen-layout.
I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type
The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.
The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.
Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.
NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.
== ToDo's
It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)
Thanks @brecht for the review! And @sergey for the complaining ;)
Differential Revision: D2758
2018-04-20 15:14:03 +00:00
b f _ e d i t o r _ s p a c e _ t o p b a r
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ s p a c e _ u s e r p r e f
b f _ e d i t o r _ s p a c e _ v i e w 3 d
b f _ e d i t o r _ s p a c e _ c l i p
b f _ e d i t o r _ t r a n s f o r m
b f _ e d i t o r _ u v e d i t
b f _ e d i t o r _ c u r v e
b f _ e d i t o r _ i n t e r f a c e
2018-07-14 21:16:34 +00:00
b f _ e d i t o r _ g i z m o _ l i b r a r y
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ m e s h
b f _ e d i t o r _ m e t a b a l l
b f _ e d i t o r _ o b j e c t
2018-07-31 08:22:19 +00:00
b f _ e d i t o r _ g p e n c i l
2018-03-19 13:49:59 +00:00
b f _ e d i t o r _ l a t t i c e
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ a r m a t u r e
b f _ e d i t o r _ p h y s i c s
b f _ e d i t o r _ r e n d e r
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 17:56:58 +00:00
b f _ e d i t o r _ s c e n e
2014-06-18 12:49:17 +00:00
b f _ e d i t o r _ s c r e e n
b f _ e d i t o r _ s c u l p t _ p a i n t
b f _ e d i t o r _ s o u n d
b f _ e d i t o r _ a n i m a t i o n
b f _ e d i t o r _ d a t a f i l e s
b f _ e d i t o r _ m a s k
b f _ e d i t o r _ i o
2018-09-02 11:21:15 +00:00
b f _ e d i t o r _ u t i l
2014-06-18 12:49:17 +00:00
b f _ r e n d e r
b f _ p y t h o n
b f _ p y t h o n _ e x t
b f _ p y t h o n _ m a t h u t i l s
2018-07-17 22:12:21 +00:00
b f _ p y t h o n _ g p u
2014-06-18 12:49:17 +00:00
b f _ p y t h o n _ b m e s h
b f _ f r e e s t y l e
b f _ i k p l u g i n
b f _ m o d i f i e r s
2018-07-31 08:22:19 +00:00
b f _ g p e n c i l _ m o d i f i e r s
2017-04-05 12:59:22 +00:00
b f _ a l e m b i c
2014-06-18 12:49:17 +00:00
b f _ b m e s h
2015-04-08 01:50:57 +00:00
b f _ g p u
2017-02-07 10:20:15 +00:00
b f _ d r a w
2016-06-07 06:07:13 +00:00
b f _ b l e n l o a d e r
2014-06-18 12:49:17 +00:00
b f _ b l e n k e r n e l
2018-07-31 08:22:19 +00:00
b f _ s h a d e r _ f x
b f _ g p e n c i l _ m o d i f i e r s
2014-09-13 12:36:46 +00:00
b f _ p h y s i c s
2014-06-18 12:49:17 +00:00
b f _ n o d e s
2014-07-23 13:24:07 +00:00
b f _ r n a
2018-07-14 21:16:34 +00:00
b f _ e d i t o r _ g i z m o _ l i b r a r y # rna -> gizmo bad-level calls
2017-06-26 05:57:14 +00:00
b f _ p y t h o n
2014-06-18 12:49:17 +00:00
b f _ i m b u f
b f _ b l e n l i b
Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 10:05:57 +00:00
b f _ d e p s g r a p h
2014-06-18 12:49:17 +00:00
b f _ i n t e r n _ g h o s t
b f _ i n t e r n _ s t r i n g
b f _ a v i
b f _ i m b u f _ c i n e o n
b f _ i m b u f _ o p e n e x r
b f _ i m b u f _ o p e n i m a g e i o
b f _ i m b u f _ d d s
b f _ c o l l a d a
b f _ i n t e r n _ e l b e e m
b f _ i n t e r n _ m e m u t i l
b f _ i n t e r n _ g u a r d e d a l l o c
b f _ i n t e r n _ c t r
b f _ i n t e r n _ u t f c o n v
b f _ i n t e r n _ s m o k e
e x t e r n _ l z m a
2016-04-15 08:02:17 +00:00
e x t e r n _ c u r v e _ f i t _ n d
2014-06-18 12:49:17 +00:00
b f _ i n t e r n _ m o t o
e x t e r n _ o p e n j p e g
b f _ d n a
2018-06-27 06:49:45 +00:00
2014-06-18 12:49:17 +00:00
b f _ b l e n f o n t
2018-06-27 06:49:45 +00:00
b f _ g p u # duplicate for blenfont
2015-08-16 07:32:01 +00:00
b f _ b l e n t r a n s l a t i o n
2014-06-18 12:49:17 +00:00
b f _ i n t e r n _ a u d a s p a c e
2017-08-18 06:24:12 +00:00
a u d a s p a c e
a u d a s p a c e - p y
2014-06-18 12:49:17 +00:00
b f _ i n t e r n _ m i k k t s p a c e
b f _ i n t e r n _ d u a l c o n
b f _ i n t e r n _ c y c l e s
2018-10-28 13:53:08 +00:00
c y c l e s _ d e v i c e
2014-06-18 12:49:17 +00:00
c y c l e s _ r e n d e r
2016-05-07 17:47:37 +00:00
c y c l e s _ g r a p h
2014-06-18 12:49:17 +00:00
c y c l e s _ b v h
c y c l e s _ k e r n e l
c y c l e s _ u t i l
c y c l e s _ s u b d
b f _ i n t e r n _ o p e n c o l o r i o
2017-04-11 13:28:35 +00:00
b f _ i n t e r n _ g a w a i n
2015-12-10 00:18:01 +00:00
b f _ i n t e r n _ e i g e n
2014-06-18 12:49:17 +00:00
e x t e r n _ r a n g e t r e e
e x t e r n _ w c w i d t h
2016-01-04 13:22:27 +00:00
b f _ i n t e r n _ l i b m v
2014-11-17 11:35:36 +00:00
e x t e r n _ s d l e w
2014-10-07 20:46:19 +00:00
b f _ i n t e r n _ g l e w _ m x
2018-03-29 18:38:32 +00:00
b f _ i n t e r n _ c l o g
2018-08-22 12:03:40 +00:00
b f _ i n t e r n _ o p e n s u b d i v
2018-11-27 16:13:54 +00:00
b f _ i n t e r n _ n u m a a p i
2014-06-18 12:49:17 +00:00
)
2017-04-21 12:26:25 +00:00
if ( NOT WITH_SYSTEM_GLOG )
list ( APPEND BLENDER_SORTED_LIBS extern_glog )
endif ( )
2017-04-21 08:58:01 +00:00
if ( NOT WITH_SYSTEM_GFLAGS )
list ( APPEND BLENDER_SORTED_LIBS extern_gflags )
endif ( )
2014-06-18 12:49:17 +00:00
if ( WITH_COMPOSITOR )
# added for opencl compositor
list_insert_before ( BLENDER_SORTED_LIBS "bf_blenkernel" "bf_compositor" )
list_insert_after ( BLENDER_SORTED_LIBS "bf_compositor" "bf_intern_opencl" )
endif ( )
if ( WITH_LIBMV )
list ( APPEND BLENDER_SORTED_LIBS extern_ceres )
endif ( )
if ( WITH_MOD_CLOTH_ELTOPO )
list ( APPEND BLENDER_SORTED_LIBS extern_eltopo )
endif ( )
2015-03-13 11:33:31 +00:00
if ( NOT WITH_SYSTEM_LZO )
list ( APPEND BLENDER_SORTED_LIBS extern_minilzo )
endif ( )
2014-06-18 12:49:17 +00:00
if ( NOT WITH_SYSTEM_GLEW )
2014-10-07 20:46:19 +00:00
list ( APPEND BLENDER_SORTED_LIBS ${ BLENDER_GLEW_LIBRARIES } )
2014-06-18 12:49:17 +00:00
endif ( )
if ( WITH_BINRELOC )
list ( APPEND BLENDER_SORTED_LIBS extern_binreloc )
endif ( )
if ( WITH_CXX_GUARDEDALLOC )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp )
endif ( )
if ( WITH_IK_SOLVER )
list_insert_after ( BLENDER_SORTED_LIBS "bf_intern_elbeem" "bf_intern_iksolver" )
endif ( )
if ( WITH_IK_ITASC )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_itasc )
endif ( )
if ( WITH_GHOST_XDND )
list ( APPEND BLENDER_SORTED_LIBS extern_xdnd )
endif ( )
if ( WITH_CYCLES_OSL )
list_insert_after ( BLENDER_SORTED_LIBS "cycles_kernel" "cycles_kernel_osl" )
endif ( )
if ( WITH_INTERNATIONAL )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_locale )
endif ( )
if ( WITH_BULLET )
list_insert_after ( BLENDER_SORTED_LIBS "bf_blenkernel" "bf_intern_rigidbody" )
endif ( )
2018-09-12 08:34:53 +00:00
if ( WITH_BULLET AND NOT WITH_SYSTEM_BULLET )
list_insert_after ( BLENDER_SORTED_LIBS "extern_openjpeg" "extern_bullet" )
endif ( )
2016-06-10 08:09:26 +00:00
if ( WIN32 )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect )
endif ( )
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 07:39:29 +00:00
if ( WITH_OPENVDB )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_openvdb )
endif ( )
2014-06-18 12:49:17 +00:00
foreach ( SORTLIB ${ BLENDER_SORTED_LIBS } )
set ( REMLIB ${ SORTLIB } )
foreach ( SEARCHLIB ${ BLENDER_LINK_LIBS } )
if ( ${ SEARCHLIB } STREQUAL ${ SORTLIB } )
set ( REMLIB "" )
endif ( )
endforeach ( )
if ( REMLIB )
# message(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
list ( APPEND REM_MSG ${ REMLIB } )
list ( REMOVE_ITEM BLENDER_SORTED_LIBS ${ REMLIB } )
endif ( )
endforeach ( )
if ( REM_MSG )
list ( SORT REM_MSG )
message ( STATUS "Blender Skipping: (${REM_MSG})" )
endif ( )
2015-06-16 23:16:17 +00:00
set ( BLENDER_SORTED_LIBS ${ BLENDER_SORTED_LIBS } PARENT_SCOPE )
2014-06-19 15:49:09 +00:00
# for top-level tests
set_property ( GLOBAL PROPERTY BLENDER_SORTED_LIBS_PROP ${ BLENDER_SORTED_LIBS } )
2015-06-16 23:16:17 +00:00
endfunction ( )
2014-06-18 12:49:17 +00:00
2011-10-01 18:29:40 +00:00
macro ( TEST_SSE_SUPPORT
_ s s e _ f l a g s
_ s s e 2 _ f l a g s )
2010-12-08 08:43:06 +00:00
include ( CheckCSourceRuns )
2010-12-16 12:48:30 +00:00
# message(STATUS "Detecting SSE support")
2011-10-02 16:43:39 +00:00
if ( CMAKE_COMPILER_IS_GNUCC OR ( CMAKE_C_COMPILER_ID MATCHES "Clang" ) )
2011-10-01 18:29:40 +00:00
set ( ${ _sse_flags } "-msse" )
set ( ${ _sse2_flags } "-msse2" )
2010-12-08 08:43:06 +00:00
elseif ( MSVC )
2013-06-21 12:33:19 +00:00
# x86_64 has this auto enabled
if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )
set ( ${ _sse_flags } "" )
set ( ${ _sse2_flags } "" )
else ( )
set ( ${ _sse_flags } "/arch:SSE" )
set ( ${ _sse2_flags } "/arch:SSE2" )
endif ( )
2011-09-30 16:37:46 +00:00
elseif ( CMAKE_C_COMPILER_ID MATCHES "Intel" )
2011-10-02 17:16:28 +00:00
set ( ${ _sse_flags } "" ) # icc defaults to -msse
2018-04-02 14:11:11 +00:00
set ( ${ _sse2_flags } "" ) # icc defaults to -msse2
2011-09-30 16:37:46 +00:00
else ( )
2011-10-01 18:29:40 +00:00
message ( WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known" )
2011-10-01 19:52:33 +00:00
set ( ${ _sse_flags } )
set ( ${ _sse2_flags } )
2011-10-01 18:29:40 +00:00
endif ( )
2011-10-01 19:52:33 +00:00
set ( CMAKE_REQUIRED_FLAGS "${${_sse_flags}} ${${_sse2_flags}}" )
2010-12-08 08:43:06 +00:00
2011-10-01 19:52:33 +00:00
if ( NOT DEFINED SUPPORT_SSE_BUILD )
# result cached
2010-12-21 03:32:51 +00:00
check_c_source_runs ( "
#include <xmmintrin.h>
2011-10-01 19:52:33 +00:00
i n t main ( void ) { _ _ m 1 2 8 v = _mm_setzero_ps ( ) ; r e t u r n 0 ; } "
2010-12-21 03:32:51 +00:00
S U P P O R T _ S S E _ B U I L D )
2011-09-30 15:51:58 +00:00
2010-12-21 03:32:51 +00:00
if ( SUPPORT_SSE_BUILD )
message ( STATUS "SSE Support: detected." )
else ( )
message ( STATUS "SSE Support: missing." )
endif ( )
2011-09-30 15:51:58 +00:00
endif ( )
2010-08-11 08:23:48 +00:00
2011-10-01 19:52:33 +00:00
if ( NOT DEFINED SUPPORT_SSE2_BUILD )
# result cached
2010-12-21 03:32:51 +00:00
check_c_source_runs ( "
#include <emmintrin.h>
2011-10-01 19:52:33 +00:00
i n t main ( void ) { _ _ m 1 2 8 d v = _mm_setzero_pd ( ) ; r e t u r n 0 ; } "
2010-12-21 03:32:51 +00:00
S U P P O R T _ S S E 2 _ B U I L D )
2010-08-11 08:23:48 +00:00
2010-12-21 03:32:51 +00:00
if ( SUPPORT_SSE2_BUILD )
message ( STATUS "SSE2 Support: detected." )
else ( )
message ( STATUS "SSE2 Support: missing." )
2011-09-30 15:51:58 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
endif ( )
2010-08-11 08:23:48 +00:00
2011-10-01 19:52:33 +00:00
unset ( CMAKE_REQUIRED_FLAGS )
2010-12-08 08:43:06 +00:00
endmacro ( )
2010-07-04 18:40:59 +00:00
2016-01-14 07:57:58 +00:00
# Only print message if running CMake first time
macro ( message_first_run )
if ( FIRST_RUN )
message ( ${ ARGV } )
endif ( )
endmacro ( )
2010-10-24 03:57:07 +00:00
# when we have warnings as errors applied globally this
# needs to be removed for some external libs which we dont maintain.
# utility macro
2011-10-27 07:26:41 +00:00
macro ( remove_cc_flag
2015-06-23 04:25:24 +00:00
_ f l a g )
foreach ( flag ${ ARGV } )
string ( REGEX REPLACE ${ flag } "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}" )
string ( REGEX REPLACE ${ flag } "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
endforeach ( )
unset ( flag )
2010-12-08 08:43:06 +00:00
endmacro ( )
2018-06-22 12:29:13 +00:00
macro ( add_c_flag
2011-10-27 07:26:41 +00:00
f l a g )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" )
endmacro ( )
2018-06-22 12:07:55 +00:00
macro ( add_cxx_flag
f l a g )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" )
endmacro ( )
2010-12-08 08:43:06 +00:00
macro ( remove_strict_flags )
if ( CMAKE_COMPILER_IS_GNUCC )
2015-06-23 04:25:24 +00:00
remove_cc_flag (
" - W s t r i c t - p r o t o t y p e s "
" - W m i s s i n g - p r o t o t y p e s "
2016-04-22 08:59:15 +00:00
" - W m i s s i n g - d e c l a r a t i o n s "
2015-06-23 04:33:17 +00:00
" - W m i s s i n g - f o r m a t - a t t r i b u t e "
" - W u n u s e d - l o c a l - t y p e d e f s "
2015-06-23 04:25:24 +00:00
" - W u n u s e d - m a c r o s "
2015-06-23 04:33:17 +00:00
" - W u n u s e d - p a r a m e t e r "
2015-06-23 04:25:24 +00:00
" - W w r i t e - s t r i n g s "
" - W r e d u n d a n t - d e c l s "
" - W u n d e f "
" - W s h a d o w "
" - W d o u b l e - p r o m o t i o n "
" - W o l d - s t y l e - d e f i n i t i o n "
" - W e r r o r = [ ^ ] + "
" - W e r r o r "
)
2011-10-27 07:26:41 +00:00
# negate flags implied by '-Wall'
2018-06-22 12:29:13 +00:00
add_c_flag ( "${C_REMOVE_STRICT_FLAGS}" )
2018-06-22 12:07:55 +00:00
add_cxx_flag ( "${CXX_REMOVE_STRICT_FLAGS}" )
2010-12-08 08:43:06 +00:00
endif ( )
2013-12-02 00:36:33 +00:00
if ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
2015-06-23 04:25:24 +00:00
remove_cc_flag (
" - W u n u s e d - p a r a m e t e r "
" - W u n u s e d - v a r i a b l e "
" - W e r r o r = [ ^ ] + "
" - W e r r o r "
)
2013-03-14 07:25:54 +00:00
# negate flags implied by '-Wall'
2018-06-22 12:29:13 +00:00
add_c_flag ( "${C_REMOVE_STRICT_FLAGS}" )
2018-06-22 12:07:55 +00:00
add_cxx_flag ( "${CXX_REMOVE_STRICT_FLAGS}" )
2012-06-28 12:32:06 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
if ( MSVC )
2010-10-24 03:57:07 +00:00
# TODO
2010-12-08 08:43:06 +00:00
endif ( )
2010-10-24 03:57:07 +00:00
2010-12-08 08:43:06 +00:00
endmacro ( )
2010-10-24 03:57:07 +00:00
2015-03-27 10:55:58 +00:00
macro ( remove_extra_strict_flags )
if ( CMAKE_COMPILER_IS_GNUCC )
2015-06-23 04:25:24 +00:00
remove_cc_flag (
" - W u n u s e d - p a r a m e t e r "
)
2015-03-27 10:55:58 +00:00
endif ( )
if ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
2015-06-23 04:25:24 +00:00
remove_cc_flag (
" - W u n u s e d - p a r a m e t e r "
)
2015-03-27 10:55:58 +00:00
endif ( )
if ( MSVC )
# TODO
endif ( )
endmacro ( )
2011-10-23 17:52:20 +00:00
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
2018-06-22 12:40:00 +00:00
macro ( remove_strict_c_flags_file
2011-10-23 17:52:20 +00:00
f i l e n a m e s )
foreach ( _SOURCE ${ ARGV } )
2013-07-15 08:26:16 +00:00
if ( CMAKE_COMPILER_IS_GNUCC OR
2018-06-25 05:30:00 +00:00
( 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 " ) )
2011-10-23 17:52:20 +00:00
set_source_files_properties ( ${ _SOURCE }
P R O P E R T I E S
2018-06-22 12:17:55 +00:00
C O M P I L E _ F L A G S " $ { C _ R E M O V E _ S T R I C T _ F L A G S } "
2011-10-23 17:52:20 +00:00
)
endif ( )
if ( MSVC )
# TODO
endif ( )
2012-10-21 05:46:41 +00:00
endforeach ( )
2011-10-23 17:52:20 +00:00
unset ( _SOURCE )
2018-06-22 12:40:00 +00:00
endmacro ( )
2011-10-23 17:52:20 +00:00
2018-06-22 12:40:00 +00:00
macro ( remove_strict_cxx_flags_file
f i l e n a m e s )
remove_strict_c_flags_file ( ${ filenames } ${ ARHV } )
foreach ( _SOURCE ${ ARGV } )
if ( CMAKE_COMPILER_IS_GNUCC OR
2018-06-25 05:30:00 +00:00
( C M A K E _ C X X _ C O M P I L E R _ I D M A T C H E S " C l a n g " ) )
2018-06-22 12:40:00 +00:00
set_source_files_properties ( ${ _SOURCE }
P R O P E R T I E S
2018-06-25 05:30:00 +00:00
C O M P I L E _ F L A G S " $ { C X X _ R E M O V E _ S T R I C T _ F L A G S } "
2018-06-22 12:40:00 +00:00
)
endif ( )
if ( MSVC )
# TODO
endif ( )
endforeach ( )
unset ( _SOURCE )
2011-10-23 17:52:20 +00:00
endmacro ( )
2016-05-18 21:36:32 +00:00
# External libs may need 'signed char' to be default.
macro ( remove_cc_flag_unsigned_char )
2018-03-04 06:22:05 +00:00
if ( CMAKE_COMPILER_IS_GNUCC OR
( 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 " ) )
2016-05-18 21:36:32 +00:00
remove_cc_flag ( "-funsigned-char" )
elseif ( MSVC )
remove_cc_flag ( "/J" )
else ( )
message ( WARNING
" C o m p i l e r ' $ { C M A K E _ C _ C O M P I L E R _ I D } ' f a i l e d t o d i s a b l e ' u n s i g n e d c h a r ' f l a g . "
" B u i l d f i l e s n e e d u p d a t i n g . "
)
endif ( )
endmacro ( )
2011-10-23 17:52:20 +00:00
2015-06-16 23:16:17 +00:00
function ( ADD_CHECK_C_COMPILER_FLAG
2010-12-16 09:55:35 +00:00
_ C F L A G S
2010-12-21 03:32:51 +00:00
_ C A C H E _ V A R
2015-06-16 23:16:17 +00:00
_ F L A G
)
2010-12-16 09:55:35 +00:00
2011-02-17 11:38:02 +00:00
include ( CheckCCompilerFlag )
2010-12-16 09:55:35 +00:00
2011-02-17 11:38:02 +00:00
CHECK_C_COMPILER_FLAG ( "${_FLAG}" "${_CACHE_VAR}" )
2010-12-21 03:32:51 +00:00
if ( ${ _CACHE_VAR } )
2010-12-16 12:48:30 +00:00
# message(STATUS "Using CFLAG: ${_FLAG}")
2015-06-16 23:16:17 +00:00
set ( ${ _CFLAGS } "${${_CFLAGS}} ${_FLAG}" PARENT_SCOPE )
2010-12-16 09:55:35 +00:00
else ( )
message ( STATUS "Unsupported CFLAG: ${_FLAG}" )
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-12-16 09:55:35 +00:00
2015-06-16 23:16:17 +00:00
function ( ADD_CHECK_CXX_COMPILER_FLAG
2010-12-16 09:55:35 +00:00
_ C X X F L A G S
2010-12-21 03:32:51 +00:00
_ C A C H E _ V A R
2015-06-16 23:16:17 +00:00
_ F L A G
)
2010-12-16 09:55:35 +00:00
include ( CheckCXXCompilerFlag )
2010-12-21 03:32:51 +00:00
CHECK_CXX_COMPILER_FLAG ( "${_FLAG}" "${_CACHE_VAR}" )
if ( ${ _CACHE_VAR } )
2010-12-16 12:48:30 +00:00
# message(STATUS "Using CXXFLAG: ${_FLAG}")
2015-06-16 23:16:17 +00:00
set ( ${ _CXXFLAGS } "${${_CXXFLAGS}} ${_FLAG}" PARENT_SCOPE )
2010-12-16 09:55:35 +00:00
else ( )
message ( STATUS "Unsupported CXXFLAG: ${_FLAG}" )
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-08-02 16:23:58 +00:00
2014-11-16 11:57:42 +00:00
function ( get_blender_version )
2015-02-25 07:15:54 +00:00
# extracts header vars and defines them in the parent scope:
#
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
# - BLENDER_SUBVERSION (used for internal versioning mainly)
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
2011-02-21 08:31:00 +00:00
# So cmake depends on BKE_blender.h, beware of inf-loops!
2016-04-24 12:42:41 +00:00
CONFIGURE_FILE ( ${ CMAKE_SOURCE_DIR } /source/blender/blenkernel/BKE_blender_version.h
$ { C M A K E _ B I N A R Y _ D I R } / s o u r c e / b l e n d e r / b l e n k e r n e l / B K E _ b l e n d e r _ v e r s i o n . h . d o n e )
2010-12-22 22:15:20 +00:00
2016-04-24 12:42:41 +00:00
file ( STRINGS ${ CMAKE_SOURCE_DIR } /source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$" )
2010-12-22 22:15:20 +00:00
2011-02-21 08:31:00 +00:00
string ( REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}" )
string ( REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}" )
string ( REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}" )
string ( REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}" )
2010-12-22 22:15:20 +00:00
2011-02-21 08:31:00 +00:00
if ( NOT ${ _out_version } MATCHES "[0-9]+" )
message ( FATAL_ERROR "Version parsing failed for BLENDER_VERSION" )
endif ( )
2010-07-14 20:26:46 +00:00
2011-02-21 08:31:00 +00:00
if ( NOT ${ _out_subversion } MATCHES "[0-9]+" )
message ( FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION" )
endif ( )
2011-04-03 07:48:33 +00:00
# clumsy regex, only single char are ok but it could be unset
string ( LENGTH "${_out_version_char}" _out_version_char_len )
if ( NOT _out_version_char_len EQUAL 1 )
set ( _out_version_char "" )
elseif ( NOT ${ _out_version_char } MATCHES "[a-z]+" )
2011-02-21 08:31:00 +00:00
message ( FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR" )
endif ( )
if ( NOT ${ _out_version_cycle } MATCHES "[a-z]+" )
message ( FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE" )
endif ( )
2015-02-25 07:15:54 +00:00
math ( EXPR _out_version_major "${_out_version} / 100" )
math ( EXPR _out_version_minor "${_out_version} % 100" )
2010-12-22 22:15:20 +00:00
2011-02-26 06:27:54 +00:00
# for packaging, alpha to numbers
2015-02-25 07:15:54 +00:00
string ( COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty )
2011-04-12 16:20:41 +00:00
if ( ${ _out_version_char_empty } )
2015-02-25 07:15:54 +00:00
set ( _out_version_char_index "0" )
2011-02-26 06:27:54 +00:00
else ( )
2011-09-26 06:29:58 +00:00
set ( _char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z )
2015-02-25 07:15:54 +00:00
list ( FIND _char_ls ${ _out_version_char } _out_version_char_index )
math ( EXPR _out_version_char_index "${_out_version_char_index} + 1" )
2011-02-26 06:27:54 +00:00
endif ( )
2015-02-25 07:15:54 +00:00
# output vars
set ( BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE )
2015-02-25 07:19:39 +00:00
set ( BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE )
set ( BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE )
2015-02-25 07:15:54 +00:00
set ( BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE )
set ( BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE )
set ( BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE )
set ( BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE )
2014-11-16 11:57:42 +00:00
endfunction ( )
2011-05-23 14:56:14 +00:00
# hacks to override initial project settings
2011-09-30 15:51:58 +00:00
# these macros must be called directly before/after project(Blender)
2011-05-23 14:56:14 +00:00
macro ( blender_project_hack_pre )
# ------------------
# GCC -O3 HACK START
# needed because O3 can cause problems but
# allow the builder to set O3 manually after.
if ( DEFINED CMAKE_C_FLAGS_RELEASE )
set ( _reset_standard_cflags_rel OFF )
else ( )
set ( _reset_standard_cflags_rel ON )
endif ( )
if ( DEFINED CMAKE_CXX_FLAGS_RELEASE )
set ( _reset_standard_cxxflags_rel OFF )
else ( )
set ( _reset_standard_cxxflags_rel ON )
endif ( )
endmacro ( )
macro ( blender_project_hack_post )
# ----------------
# GCC -O3 HACK END
if ( _reset_standard_cflags_rel )
string ( REGEX REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE )
mark_as_advanced ( CMAKE_C_FLAGS_RELEASE )
endif ( )
if ( _reset_standard_cxxflags_rel )
string ( REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "" FORCE )
mark_as_advanced ( CMAKE_CXX_FLAGS_RELEASE )
endif ( )
unset ( _reset_standard_cflags_rel )
unset ( _reset_standard_cxxflags_rel )
2011-06-11 06:00:28 +00:00
2011-06-14 00:24:50 +00:00
# ------------------------------------------------------------------
# workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
2011-06-11 06:00:28 +00:00
if ( CMAKE_COMPILER_IS_GNUCC )
if ( NOT DARWIN )
set ( CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem " )
endif ( )
endif ( )
2011-05-23 14:56:14 +00:00
endmacro ( )
2011-11-07 15:53:40 +00:00
# pair of macros to allow libraries to be specify files to install, but to
# only install them at the end so the directories don't get cleared with
# the files in them. used by cycles to install addon.
2015-06-16 23:16:17 +00:00
function ( delayed_install
2011-11-07 15:53:40 +00:00
b a s e
f i l e s
d e s t i n a t i o n )
foreach ( f ${ files } )
2012-11-15 17:16:27 +00:00
if ( IS_ABSOLUTE ${ f } )
set_property ( GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${ f } )
else ( )
set_property ( GLOBAL APPEND PROPERTY DELAYED_INSTALL_FILES ${ base } / ${ f } )
endif ( )
2011-11-07 15:53:40 +00:00
set_property ( GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${ destination } )
endforeach ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2011-11-07 15:53:40 +00:00
# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir
# does not get expanded in calling but is preserved
function ( delayed_do_install
t a r g e t d i r )
get_property ( files GLOBAL PROPERTY DELAYED_INSTALL_FILES )
get_property ( destinations GLOBAL PROPERTY DELAYED_INSTALL_DESTINATIONS )
if ( files )
list ( LENGTH files n )
math ( EXPR n "${n}-1" )
foreach ( i RANGE ${ n } )
list ( GET files ${ i } f )
list ( GET destinations ${ i } d )
2018-10-22 16:17:08 +00:00
if ( NOT IS_ABSOLUTE ${ d } )
install ( FILES ${ f } DESTINATION ${ targetdir } / ${ d } )
else ( )
install ( FILES ${ f } DESTINATION ${ d } )
endif ( )
2011-11-07 15:53:40 +00:00
endforeach ( )
endif ( )
endfunction ( )
2012-08-08 16:03:42 +00:00
2015-06-16 23:16:17 +00:00
function ( data_to_c
f i l e _ f r o m f i l e _ t o
l i s t _ t o _ a d d
)
2012-08-08 16:03:42 +00:00
2012-08-11 12:26:43 +00:00
list ( APPEND ${ list_to_add } ${ file_to } )
2015-06-16 23:16:17 +00:00
set ( ${ list_to_add } ${ ${list_to_add } } PARENT_SCOPE )
2012-08-08 16:03:42 +00:00
2012-08-11 16:25:31 +00:00
get_filename_component ( _file_to_path ${ file_to } PATH )
2012-08-11 12:26:43 +00:00
add_custom_command (
O U T P U T $ { f i l e _ t o }
2012-08-11 16:25:31 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ f i l e _ t o _ p a t h }
2015-09-02 15:11:38 +00:00
C O M M A N D " $ < T A R G E T _ F I L E : d a t a t o c > " $ { f i l e _ f r o m } $ { f i l e _ t o }
2012-08-11 18:39:38 +00:00
D E P E N D S $ { f i l e _ f r o m } d a t a t o c )
2013-09-20 06:35:28 +00:00
set_source_files_properties ( ${ file_to } PROPERTIES GENERATED TRUE )
2015-06-16 23:16:17 +00:00
endfunction ( )
2012-08-08 16:03:42 +00:00
2012-08-11 18:47:09 +00:00
2012-08-11 13:32:19 +00:00
# same as above but generates the var name and output automatic.
2015-06-16 23:16:17 +00:00
function ( data_to_c_simple
f i l e _ f r o m
l i s t _ t o _ a d d
)
2012-08-11 13:32:19 +00:00
2012-08-11 18:39:38 +00:00
# remove ../'s
get_filename_component ( _file_from ${ CMAKE_CURRENT_SOURCE_DIR } / ${ file_from } REALPATH )
get_filename_component ( _file_to ${ CMAKE_CURRENT_BINARY_DIR } / ${ file_from } .c REALPATH )
2012-08-11 13:32:19 +00:00
2012-08-11 18:39:38 +00:00
list ( APPEND ${ list_to_add } ${ _file_to } )
2018-10-16 19:54:59 +00:00
source_group ( Generated FILES ${ _file_to } )
list ( APPEND ${ list_to_add } ${ file_from } )
2015-06-16 23:16:17 +00:00
set ( ${ list_to_add } ${ ${list_to_add } } PARENT_SCOPE )
2012-08-11 13:32:19 +00:00
2012-08-11 16:25:31 +00:00
get_filename_component ( _file_to_path ${ _file_to } PATH )
2012-08-11 13:32:19 +00:00
add_custom_command (
2012-08-11 18:39:38 +00:00
O U T P U T $ { _ f i l e _ t o }
2012-08-11 16:25:31 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ f i l e _ t o _ p a t h }
2015-09-02 15:11:38 +00:00
C O M M A N D " $ < T A R G E T _ F I L E : d a t a t o c > " $ { _ f i l e _ f r o m } $ { _ f i l e _ t o }
2012-08-11 18:39:38 +00:00
D E P E N D S $ { _ f i l e _ f r o m } d a t a t o c )
2012-08-11 13:32:19 +00:00
2013-09-20 06:35:28 +00:00
set_source_files_properties ( ${ _file_to } PROPERTIES GENERATED TRUE )
2015-06-16 23:16:17 +00:00
endfunction ( )
2013-08-22 13:51:00 +00:00
2014-01-13 12:47:33 +00:00
# macro for converting pixmap directory to a png and then a c file
2015-06-16 23:16:17 +00:00
function ( data_to_c_simple_icons
2018-01-24 00:29:29 +00:00
p a t h _ f r o m i c o n _ p r e f i x i c o n _ n a m e s
2015-06-16 23:16:17 +00:00
l i s t _ t o _ a d d
)
2014-01-13 12:47:33 +00:00
# Conversion steps
# path_from -> _file_from -> _file_to
# foo/*.dat -> foo.png -> foo.png.c
get_filename_component ( _path_from_abs ${ path_from } ABSOLUTE )
# remove ../'s
get_filename_component ( _file_from ${ CMAKE_CURRENT_BINARY_DIR } / ${ path_from } .png REALPATH )
get_filename_component ( _file_to ${ CMAKE_CURRENT_BINARY_DIR } / ${ path_from } .png.c REALPATH )
list ( APPEND ${ list_to_add } ${ _file_to } )
2015-06-16 23:16:17 +00:00
set ( ${ list_to_add } ${ ${list_to_add } } PARENT_SCOPE )
2014-01-13 12:47:33 +00:00
get_filename_component ( _file_to_path ${ _file_to } PATH )
2018-01-24 00:29:29 +00:00
# Construct a list of absolute paths from input
set ( _icon_files )
foreach ( _var ${ icon_names } )
list ( APPEND _icon_files "${_path_from_abs}/${icon_prefix}${_var}.dat" )
endforeach ( )
2014-01-13 12:47:33 +00:00
add_custom_command (
O U T P U T $ { _ f i l e _ f r o m } $ { _ f i l e _ t o }
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ f i l e _ t o _ p a t h }
#COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py ${_path_from_abs} ${_file_from}
2015-09-02 15:11:38 +00:00
C O M M A N D " $ < T A R G E T _ F I L E : d a t a t o c _ i c o n > " $ { _ p a t h _ f r o m _ a b s } $ { _ f i l e _ f r o m }
C O M M A N D " $ < T A R G E T _ F I L E : d a t a t o c > " $ { _ f i l e _ f r o m } $ { _ f i l e _ t o }
2014-01-27 06:25:29 +00:00
D E P E N D S
$ { _ i c o n _ f i l e s }
d a t a t o c _ i c o n
d a t a t o c
# could be an arg but for now we only create icons depending on UI_icons.h
$ { C M A K E _ S O U R C E _ D I R } / s o u r c e / b l e n d e r / e d i t o r s / i n c l u d e / U I _ i c o n s . h
)
2014-01-13 12:47:33 +00:00
set_source_files_properties ( ${ _file_from } ${ _file_to } PROPERTIES GENERATED TRUE )
2015-06-16 23:16:17 +00:00
endfunction ( )
2014-01-13 12:47:33 +00:00
2013-08-26 12:16:23 +00:00
# XXX Not used for now...
2015-06-16 23:16:17 +00:00
function ( svg_to_png
f i l e _ f r o m
f i l e _ t o
d p i
l i s t _ t o _ a d d
)
2013-08-22 13:51:00 +00:00
# remove ../'s
get_filename_component ( _file_from ${ CMAKE_CURRENT_SOURCE_DIR } / ${ file_from } REALPATH )
get_filename_component ( _file_to ${ CMAKE_CURRENT_SOURCE_DIR } / ${ file_to } REALPATH )
list ( APPEND ${ list_to_add } ${ _file_to } )
2015-06-16 23:16:17 +00:00
set ( ${ list_to_add } ${ ${list_to_add } } PARENT_SCOPE )
2013-08-22 13:51:00 +00:00
find_program ( INKSCAPE_EXE inkscape )
mark_as_advanced ( INKSCAPE_EXE )
if ( INKSCAPE_EXE )
2013-08-26 14:13:04 +00:00
if ( APPLE )
# in OS X app bundle, the binary is a shim that doesn't take any
# command line arguments, replace it with the actual binary
string ( REPLACE "MacOS/Inkscape" "Resources/bin/inkscape" INKSCAPE_REAL_EXE ${ INKSCAPE_EXE } )
if ( EXISTS "${INKSCAPE_REAL_EXE}" )
set ( INKSCAPE_EXE ${ INKSCAPE_REAL_EXE } )
endif ( )
endif ( )
2013-08-22 13:51:00 +00:00
add_custom_command (
O U T P U T $ { _ f i l e _ t o }
C O M M A N D $ { I N K S C A P E _ E X E } $ { _ f i l e _ f r o m } - - e x p o r t - d p i = $ { d p i } - - w i t h o u t - g u i - - e x p o r t - p n g = $ { _ f i l e _ t o }
D E P E N D S $ { _ f i l e _ f r o m } $ { I N K S C A P E _ E X E }
)
else ( )
message ( WARNING "Inkscape not found, could not re-generate ${_file_to} from ${_file_from}!" )
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2013-08-22 13:51:00 +00:00
2015-06-16 23:16:17 +00:00
function ( msgfmt_simple
f i l e _ f r o m
l i s t _ t o _ a d d
)
2013-11-08 20:44:48 +00:00
# remove ../'s
get_filename_component ( _file_from_we ${ file_from } NAME_WE )
get_filename_component ( _file_from ${ file_from } REALPATH )
get_filename_component ( _file_to ${ CMAKE_CURRENT_BINARY_DIR } / ${ _file_from_we } .mo REALPATH )
list ( APPEND ${ list_to_add } ${ _file_to } )
2015-06-16 23:16:17 +00:00
set ( ${ list_to_add } ${ ${list_to_add } } PARENT_SCOPE )
2013-11-08 20:44:48 +00:00
get_filename_component ( _file_to_path ${ _file_to } PATH )
add_custom_command (
O U T P U T $ { _ f i l e _ t o }
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { _ f i l e _ t o _ p a t h }
2015-09-02 15:11:38 +00:00
C O M M A N D " $ < T A R G E T _ F I L E : m s g f m t > " $ { _ f i l e _ f r o m } $ { _ f i l e _ t o }
2014-06-16 07:21:33 +00:00
D E P E N D S m s g f m t $ { _ f i l e _ f r o m } )
2013-11-08 20:44:48 +00:00
set_source_files_properties ( ${ _file_to } PROPERTIES GENERATED TRUE )
2015-06-16 23:16:17 +00:00
endfunction ( )
2013-11-08 20:44:48 +00:00
2015-06-16 23:16:17 +00:00
function ( find_python_package
p a c k a g e
)
2014-07-28 14:42:30 +00:00
string ( TOUPPER ${ package } _upper_package )
# set but invalid
if ( ( NOT ${ PYTHON_${_upper_package } _PATH} STREQUAL "" ) AND
( N O T $ { P Y T H O N _ $ { _ u p p e r _ p a c k a g e } _ P A T H } M A T C H E S N O T F O U N D ) )
# if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}/${package}")
# message(WARNING "PYTHON_${_upper_package}_PATH is invalid, ${package} not found in '${PYTHON_${_upper_package}_PATH}' "
# "WITH_PYTHON_INSTALL_${_upper_package} option will be ignored when installing python")
# set(WITH_PYTHON_INSTALL${_upper_package} OFF)
# endif()
# not set, so initialize
else ( )
string ( REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}" )
list ( GET _PY_VER_SPLIT 0 _PY_VER_MAJOR )
# re-cache
unset ( PYTHON_ ${ _upper_package } _PATH CACHE )
find_path ( PYTHON_ ${ _upper_package } _PATH
N A M E S
$ { p a c k a g e }
H I N T S
2017-08-18 06:24:12 +00:00
" $ { P Y T H O N _ L I B P A T H } / "
2014-07-28 14:42:30 +00:00
" $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { P Y T H O N _ V E R S I O N } / "
" $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { _ P Y _ V E R _ M A J O R } / "
P A T H _ S U F F I X E S
s i t e - p a c k a g e s
d i s t - p a c k a g e s
2017-11-30 06:56:01 +00:00
v e n d o r - p a c k a g e s
2014-07-28 14:42:30 +00:00
N O _ D E F A U L T _ P A T H
)
2019-02-13 21:43:44 +00:00
if ( NOT EXISTS "${PYTHON_${_upper_package}_PATH}" )
2016-01-17 05:01:32 +00:00
message ( WARNING
" P y t h o n p a c k a g e ' $ { p a c k a g e } ' p a t h c o u l d n o t b e f o u n d i n : \ n "
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { P Y T H O N _ V E R S I O N } / s i t e - p a c k a g e s / $ { p a c k a g e } ' , "
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { _ P Y _ V E R _ M A J O R } / s i t e - p a c k a g e s / $ { p a c k a g e } ' , "
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { P Y T H O N _ V E R S I O N } / d i s t - p a c k a g e s / $ { p a c k a g e } ' , "
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { _ P Y _ V E R _ M A J O R } / d i s t - p a c k a g e s / $ { p a c k a g e } ' , "
2017-11-30 06:56:01 +00:00
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { P Y T H O N _ V E R S I O N } / v e n d o r - p a c k a g e s / $ { p a c k a g e } ' , "
" ' $ { P Y T H O N _ L I B P A T H } / p y t h o n $ { _ P Y _ V E R _ M A J O R } / v e n d o r - p a c k a g e s / $ { p a c k a g e } ' , "
2016-01-17 05:01:32 +00:00
" \ n "
" T h e ' W I T H _ P Y T H O N _ I N S T A L L _ $ { _ u p p e r _ p a c k a g e } ' o p t i o n w i l l b e i g n o r e d w h e n i n s t a l l i n g P y t h o n . \ n "
" T h e b u i l d w i l l b e u s a b l e , o n l y a d d - o n s t h a t d e p e n d o n t h i s p a c k a g e w o n ' t b e f u n c t i o n a l . "
)
2015-06-16 23:16:17 +00:00
set ( WITH_PYTHON_INSTALL_ ${ _upper_package } OFF PARENT_SCOPE )
2014-07-28 14:42:30 +00:00
else ( )
message ( STATUS "${package} found at '${PYTHON_${_upper_package}_PATH}'" )
endif ( )
2016-01-17 05:01:32 +00:00
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2014-11-16 11:57:42 +00:00
# like Python's 'print(dir())'
2015-06-16 23:16:17 +00:00
function ( print_all_vars )
2014-11-16 11:57:42 +00:00
get_cmake_property ( _vars VARIABLES )
foreach ( _var ${ _vars } )
message ( "${_var}=${${_var}}" )
endforeach ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2016-07-18 13:16:45 +00:00
macro ( openmp_delayload
p r o j e c t n a m e
)
if ( MSVC )
if ( WITH_OPENMP )
if ( MSVC_VERSION EQUAL 1800 )
set ( OPENMP_DLL_NAME "vcomp120" )
else ( )
set ( OPENMP_DLL_NAME "vcomp140" )
endif ( )
SET_TARGET_PROPERTIES ( ${ projectname } PROPERTIES LINK_FLAGS_RELEASE "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib" )
SET_TARGET_PROPERTIES ( ${ projectname } PROPERTIES LINK_FLAGS_DEBUG "/DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib" )
SET_TARGET_PROPERTIES ( ${ projectname } PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib" )
SET_TARGET_PROPERTIES ( ${ projectname } PROPERTIES LINK_FLAGS_MINSIZEREL "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib" )
2017-10-30 01:58:44 +00:00
endif ( )
endif ( )
2016-07-18 13:16:45 +00:00
endmacro ( )
2016-08-31 12:26:05 +00:00
2018-01-23 06:25:09 +00:00
macro ( WINDOWS_SIGN_TARGET target )
2017-03-11 15:40:04 +00:00
if ( WITH_WINDOWS_CODESIGN )
if ( !SIGNTOOL_EXE )
2016-08-31 12:26:05 +00:00
error ( "Codesigning is enabled, but signtool is not found" )
else ( )
2017-03-11 15:40:04 +00:00
if ( WINDOWS_CODESIGN_PFX_PASSWORD )
2016-08-31 12:26:05 +00:00
set ( CODESIGNPASSWORD /p ${ WINDOWS_CODESIGN_PFX_PASSWORD } )
else ( )
2017-03-11 15:40:04 +00:00
if ( $ENV{ PFXPASSWORD } )
2016-08-31 12:26:05 +00:00
set ( CODESIGNPASSWORD /p $ENV{ PFXPASSWORD } )
else ( )
2017-03-11 15:40:04 +00:00
message ( FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code." )
2016-08-31 12:26:05 +00:00
endif ( )
endif ( )
add_custom_command ( TARGET ${ target }
2017-03-11 15:40:04 +00:00
P O S T _ B U I L D
C O M M A N D $ { S I G N T O O L _ E X E } s i g n / f $ { W I N D O W S _ C O D E S I G N _ P F X } $ { C O D E S I G N P A S S W O R D } $ < T A R G E T _ F I L E : $ { t a r g e t } >
V E R B A T I M
)
2016-08-31 12:26:05 +00:00
endif ( )
endif ( )
2018-01-23 06:25:09 +00:00
endmacro ( )