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.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** 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
)
# 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.
#
# 'name' should alway match the target name,
# 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}" )
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.
2010-12-08 08:43:06 +00:00
link_directories ( ${ JPEG_LIBPATH } ${ PNG_LIBPATH } ${ ZLIB_LIBPATH } ${ FREETYPE_LIBPATH } )
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
link_directories ( ${ PYTHON_LIBPATH } )
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
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 ( )
2011-11-07 15:44:09 +00:00
if ( WITH_BOOST )
link_directories ( ${ BOOST_LIBPATH } )
endif ( )
if ( WITH_OPENIMAGEIO )
link_directories ( ${ OPENIMAGEIO_LIBPATH } )
endif ( )
2012-09-15 10:03:17 +00:00
if ( WITH_OPENCOLORIO )
link_directories ( ${ OPENCOLORIO_LIBPATH } )
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 )
link_directories ( ${ OPENVDB_LIBPATH } )
endif ( )
2010-12-08 08:43:06 +00:00
if ( WITH_OPENAL )
link_directories ( ${ OPENAL_LIBPATH } )
endif ( )
2013-03-27 07:19:54 +00:00
if ( WITH_JACK AND NOT WITH_JACK_DYNLOAD )
2010-12-08 08:43:06 +00:00
link_directories ( ${ JACK_LIBPATH } )
endif ( )
if ( WITH_CODEC_SNDFILE )
link_directories ( ${ SNDFILE_LIBPATH } )
endif ( )
if ( WITH_FFTW3 )
link_directories ( ${ FFTW3_LIBPATH } )
endif ( )
if ( WITH_OPENCOLLADA )
link_directories ( ${ OPENCOLLADA_LIBPATH } )
2016-03-15 02:15:26 +00:00
## Never set
# link_directories(${PCRE_LIBPATH})
# link_directories(${EXPAT_LIBPATH})
2010-12-08 08:43:06 +00:00
endif ( )
2012-10-06 11:00:45 +00:00
if ( WITH_LLVM )
2013-09-25 16:31:54 +00:00
link_directories ( ${ LLVM_LIBPATH } )
2012-10-06 11:00:45 +00:00
endif ( )
2010-12-08 08:43:06 +00:00
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 04:20:37 +00:00
if ( WITH_ALEMBIC )
link_directories ( ${ ALEMBIC_LIBPATH } )
link_directories ( ${ HDF5_LIBPATH } )
endif ( )
2010-12-08 08:43:06 +00:00
if ( WIN32 AND NOT UNIX )
link_directories ( ${ PTHREADS_LIBPATH } )
endif ( )
2015-06-16 23:16:17 +00:00
endfunction ( )
2010-12-08 08:43:06 +00:00
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
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 )
2011-06-18 12:12:19 +00:00
target_link_libraries ( ${ target } ${ SNDFILE_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_CODEC_QUICKTIME )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ QUICKTIME_LIBRARIES } )
2010-12-08 08:43:06 +00:00
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 ( )
2016-09-13 20:55:18 +00:00
if ( WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV )
2015-07-20 14:08:06 +00:00
if ( WIN32 AND NOT UNIX )
file_list_suffix ( OPENSUBDIV_LIBRARIES_DEBUG "${OPENSUBDIV_LIBRARIES}" "_d" )
target_link_libraries_debug ( ${ target } "${OPENSUBDIV_LIBRARIES_DEBUG}" )
target_link_libraries_optimized ( ${ target } "${OPENSUBDIV_LIBRARIES}" )
unset ( OPENSUBDIV_LIBRARIES_DEBUG )
else ( )
target_link_libraries ( ${ target } ${ OPENSUBDIV_LIBRARIES } )
endif ( )
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 )
2016-01-27 11:26:26 +00:00
target_link_libraries ( ${ target } ${ OPENVDB_LIBRARIES } ${ TBB_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 ( )
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 ( )
2012-06-23 14:23:44 +00:00
if ( WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_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 ( )
2011-05-12 11:16:32 +00:00
if ( WITH_MEM_JEMALLOC )
2011-06-18 14:12:54 +00:00
target_link_libraries ( ${ target } ${ JEMALLOC_LIBRARIES } )
2011-05-12 11:16:32 +00:00
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 ( )
2012-04-22 14:33:40 +00:00
2014-08-05 07:57:50 +00:00
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
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 } )
target_link_libraries ( ${ target } ${ PLATFORM_LINKLIBS } ${ CMAKE_DL_LIBS } )
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 ( )
# Sort libraries
set ( BLENDER_SORTED_LIBS
b f _ w i n d o w m a n a g e r
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
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
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 t i l
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 _ g p e n c i l
b f _ e d i t o r _ i n t e r f a c e
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
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
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
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
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
b f _ b m e s h
2015-04-08 01:50:57 +00:00
b f _ g p u
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
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
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
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
b f _ a l e m b i c
2014-06-18 12:49:17 +00:00
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
g e _ b l e n _ r o u t i n e s
g e _ c o n v e r t e r
g e _ p h y s _ d u m m y
g e _ p h y s _ b u l l e t
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
g e _ l o g i c _ k e t s j i
e x t e r n _ r e c a s t n a v i g a t i o n
g e _ l o g i c
g e _ r a s t e r i z e r
g e _ o g l r a s t e r i z e r
g e _ l o g i c _ e x p r e s s i o n s
g e _ s c e n e g r a p h
g e _ l o g i c _ n e t w o r k
g e _ l o g i c _ n g n e t w o r k
g e _ l o g i c _ l o o p b a c k n e t w o r k
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
g e _ v i d e o t e x
b f _ d n a
b f _ b l e n f o n t
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
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
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
b f _ i n t e r n _ o p e n c o l o r i o
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-06-18 12:49:17 +00:00
e x t e r n _ g l o g
2016-01-03 10:07:30 +00:00
e x t e r n _ g f l a g s
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
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_CODEC_QUICKTIME )
list ( APPEND BLENDER_SORTED_LIBS bf_quicktime )
endif ( )
if ( WITH_MOD_BOOLEAN )
list ( APPEND BLENDER_SORTED_LIBS extern_carve )
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 ( )
if ( WITH_BULLET AND NOT WITH_SYSTEM_BULLET )
list_insert_after ( BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet" )
endif ( )
2016-06-10 08:09:26 +00:00
if ( WITH_GAMEENGINE_DECKLINK )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_decklink )
endif ( )
if ( WIN32 )
list ( APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect )
endif ( )
2016-09-13 20:55:18 +00:00
if ( WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV )
2015-07-20 14:08:06 +00:00
list ( APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv )
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
set ( ${ _sse2_flags } "-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 ( )
2014-03-25 08:21:30 +00:00
macro ( TEST_UNORDERED_MAP_SUPPORT )
# - Detect unordered_map availability
# Test if a valid implementation of unordered_map exists
# and define the include path
# This module defines
# HAVE_UNORDERED_MAP, whether unordered_map implementation was found
2016-01-14 07:57:58 +00:00
#
2014-03-25 08:21:30 +00:00
# HAVE_STD_UNORDERED_MAP_HEADER, <unordered_map.h> was found
# HAVE_UNORDERED_MAP_IN_STD_NAMESPACE, unordered_map is in namespace std
# HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE, unordered_map is in namespace std::tr1
2016-01-14 07:57:58 +00:00
#
2014-03-25 08:21:30 +00:00
# UNORDERED_MAP_INCLUDE_PREFIX, include path prefix for unordered_map, if found
# UNORDERED_MAP_NAMESPACE, namespace for unordered_map, if found
include ( CheckIncludeFileCXX )
2016-05-22 11:41:55 +00:00
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
# to a situation when there is <unordered_map> include but which can't be used uless
# C++11 is enabled.
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0" ) AND ( NOT WITH_CXX11 ) )
set ( HAVE_STD_UNORDERED_MAP_HEADER False )
else ( )
CHECK_INCLUDE_FILE_CXX ( "unordered_map" HAVE_STD_UNORDERED_MAP_HEADER )
endif ( )
2014-03-25 08:21:30 +00:00
if ( HAVE_STD_UNORDERED_MAP_HEADER )
# Even so we've found unordered_map header file it doesn't
# mean unordered_map and unordered_set will be declared in
# std namespace.
#
# Namely, MSVC 2008 have unordered_map header which declares
# unordered_map class in std::tr1 namespace. In order to support
# this, we do extra check to see which exactly namespace is
# to be used.
include ( CheckCXXSourceCompiles )
CHECK_CXX_SOURCE_COMPILES ( " #include <unordered_map>
i n t main ( ) {
s t d : : u n o r d e r e d _ m a p < i n t , i n t > m a p ;
r e t u r n 0 ;
} "
H A V E _ U N O R D E R E D _ M A P _ I N _ S T D _ N A M E S P A C E )
if ( HAVE_UNORDERED_MAP_IN_STD_NAMESPACE )
2016-01-14 07:57:58 +00:00
message_first_run ( STATUS "Found unordered_map/set in std namespace." )
2014-03-25 08:21:30 +00:00
set ( HAVE_UNORDERED_MAP "TRUE" )
set ( UNORDERED_MAP_INCLUDE_PREFIX "" )
set ( UNORDERED_MAP_NAMESPACE "std" )
else ( )
CHECK_CXX_SOURCE_COMPILES ( " #include <unordered_map>
i n t main ( ) {
s t d : : t r 1 : : u n o r d e r e d _ m a p < i n t , i n t > m a p ;
r e t u r n 0 ;
} "
H A V E _ U N O R D E R E D _ M A P _ I N _ T R 1 _ N A M E S P A C E )
if ( HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE )
2016-01-14 07:57:58 +00:00
message_first_run ( STATUS "Found unordered_map/set in std::tr1 namespace." )
2014-03-25 08:21:30 +00:00
set ( HAVE_UNORDERED_MAP "TRUE" )
set ( UNORDERED_MAP_INCLUDE_PREFIX "" )
set ( UNORDERED_MAP_NAMESPACE "std::tr1" )
else ( )
2016-01-14 07:57:58 +00:00
message_first_run ( STATUS "Found <unordered_map> but cannot find either std::unordered_map "
" o r s t d : : t r 1 : : u n o r d e r e d _ m a p . " )
2014-03-25 08:21:30 +00:00
endif ( )
endif ( )
else ( )
CHECK_INCLUDE_FILE_CXX ( "tr1/unordered_map" HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE )
if ( HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE )
2016-01-14 07:57:58 +00:00
message_first_run ( STATUS "Found unordered_map/set in std::tr1 namespace." )
2014-03-25 08:21:30 +00:00
set ( HAVE_UNORDERED_MAP "TRUE" )
set ( UNORDERED_MAP_INCLUDE_PREFIX "tr1" )
set ( UNORDERED_MAP_NAMESPACE "std::tr1" )
else ( )
2016-01-14 07:57:58 +00:00
message_first_run ( STATUS "Unable to find <unordered_map> or <tr1/unordered_map>. " )
2014-03-25 08:21:30 +00:00
endif ( )
endif ( )
endmacro ( )
2014-05-01 23:52:56 +00:00
macro ( TEST_SHARED_PTR_SUPPORT )
# This check are coming from Ceres library.
#
# Find shared pointer header and namespace.
#
# This module defines the following variables:
#
# SHARED_PTR_FOUND: TRUE if shared_ptr found.
# SHARED_PTR_TR1_MEMORY_HEADER: True if <tr1/memory> header is to be used
# for the shared_ptr object, otherwise use <memory>.
# SHARED_PTR_TR1_NAMESPACE: TRUE if shared_ptr is defined in std::tr1 namespace,
# otherwise it's assumed to be defined in std namespace.
include ( CheckIncludeFileCXX )
2016-05-30 12:37:07 +00:00
include ( CheckCXXSourceCompiles )
2014-05-01 23:52:56 +00:00
set ( SHARED_PTR_FOUND FALSE )
2016-05-30 12:37:07 +00:00
# Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
# to a situation when there is <unordered_map> include but which can't be used uless
# C++11 is enabled.
if ( CMAKE_COMPILER_IS_GNUCC AND ( NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0" ) AND ( NOT WITH_CXX11 ) )
set ( HAVE_STD_MEMORY_HEADER False )
else ( )
CHECK_INCLUDE_FILE_CXX ( memory HAVE_STD_MEMORY_HEADER )
endif ( )
2014-05-01 23:52:56 +00:00
if ( HAVE_STD_MEMORY_HEADER )
# Finding the memory header doesn't mean that shared_ptr is in std
# namespace.
#
# In particular, MSVC 2008 has shared_ptr declared in std::tr1. In
# order to support this, we do an extra check to see which namespace
# should be used.
CHECK_CXX_SOURCE_COMPILES ( " #include <memory>
i n t main ( ) {
s t d : : s h a r e d _ p t r < i n t > i n t _ p t r ;
r e t u r n 0 ;
} "
H A V E _ S H A R E D _ P T R _ I N _ S T D _ N A M E S P A C E )
if ( HAVE_SHARED_PTR_IN_STD_NAMESPACE )
2016-01-14 07:57:58 +00:00
message_first_run ( "-- Found shared_ptr in std namespace using <memory> header." )
2014-05-01 23:52:56 +00:00
set ( SHARED_PTR_FOUND TRUE )
else ( )
CHECK_CXX_SOURCE_COMPILES ( " #include <memory>
i n t main ( ) {
s t d : : t r 1 : : s h a r e d _ p t r < i n t > i n t _ p t r ;
r e t u r n 0 ;
} "
H A V E _ S H A R E D _ P T R _ I N _ T R 1 _ N A M E S P A C E )
if ( HAVE_SHARED_PTR_IN_TR1_NAMESPACE )
2016-01-14 07:57:58 +00:00
message_first_run ( "-- Found shared_ptr in std::tr1 namespace using <memory> header." )
2014-05-01 23:52:56 +00:00
set ( SHARED_PTR_TR1_NAMESPACE TRUE )
set ( SHARED_PTR_FOUND TRUE )
endif ( )
endif ( )
endif ( )
if ( NOT SHARED_PTR_FOUND )
# Further, gcc defines shared_ptr in std::tr1 namespace and
# <tr1/memory> is to be included for this. And what makes things
# even more tricky is that gcc does have <memory> header, so
# all the checks above wouldn't find shared_ptr.
CHECK_INCLUDE_FILE_CXX ( "tr1/memory" HAVE_TR1_MEMORY_HEADER )
if ( HAVE_TR1_MEMORY_HEADER )
CHECK_CXX_SOURCE_COMPILES ( " #include <tr1/memory>
i n t main ( ) {
s t d : : t r 1 : : s h a r e d _ p t r < i n t > i n t _ p t r ;
r e t u r n 0 ;
} "
H A V E _ S H A R E D _ P T R _ I N _ T R 1 _ N A M E S P A C E _ F R O M _ T R 1 _ M E M O R Y _ H E A D E R )
if ( HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER )
2016-01-14 07:57:58 +00:00
message_first_run ( "-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header." )
2014-05-01 23:52:56 +00:00
set ( SHARED_PTR_TR1_MEMORY_HEADER TRUE )
set ( SHARED_PTR_TR1_NAMESPACE TRUE )
set ( SHARED_PTR_FOUND TRUE )
endif ( )
endif ( )
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 ( )
2011-10-27 07:26:41 +00:00
macro ( add_cc_flag
f l a g )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" )
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'
2011-11-01 00:34:09 +00:00
add_cc_flag ( "${CC_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'
add_cc_flag ( "${CC_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.
macro ( remove_strict_flags_file
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
2013-12-02 00:36:33 +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 " ) )
2013-07-15 08:26:16 +00:00
2011-10-23 17:52:20 +00:00
set_source_files_properties ( ${ _SOURCE }
P R O P E R T I E S
2011-10-30 04:48:00 +00:00
C O M P I L E _ F L A G S " $ { C 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 )
endmacro ( )
2016-05-18 21:36:32 +00:00
# External libs may need 'signed char' to be default.
macro ( remove_cc_flag_unsigned_char )
if ( CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|Intel)$" )
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 )
# ----------------
# MINGW HACK START
# ignore system set flag, use our own
# must be before project(...)
# if the user wants to add their own its ok after first run.
if ( DEFINED CMAKE_C_STANDARD_LIBRARIES )
set ( _reset_standard_libraries OFF )
else ( )
set ( _reset_standard_libraries ON )
endif ( )
# ------------------
# 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 )
# --------------
# MINGW HACK END
2015-02-18 20:44:40 +00:00
if ( _reset_standard_libraries )
2012-08-11 12:26:43 +00:00
# Must come after projecINCt(...)
2011-05-23 14:56:14 +00:00
#
# MINGW workaround for -ladvapi32 being included which surprisingly causes
# string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
# with a meaningless stack trace. by overriding this flag we ensure we only
Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.
What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.
Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.
This commit includes:
- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
(this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
as well
Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit
Reviewed By: campbellbarton, juicyfruit
Differential Revision: https://developer.blender.org/D1680
2016-01-04 09:20:48 +00:00
# have libs we define.
2011-05-23 14:56:14 +00:00
set ( CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE )
set ( CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE )
2011-09-30 15:51:58 +00:00
mark_as_advanced (
C M A K E _ C _ S T A N D A R D _ L I B R A R I E S
C M A K E _ C X X _ S T A N D A R D _ L I B R A R I E S
)
2011-05-23 14:56:14 +00:00
endif ( )
unset ( _reset_standard_libraries )
# ----------------
# 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 )
install ( FILES ${ f } DESTINATION ${ targetdir } / ${ d } )
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 } )
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
p a t h _ f r o m
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 )
# ideally we wouldn't glob, but storing all names for all pixmaps is a bit heavy
file ( GLOB _icon_files "${path_from}/*.dat" )
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
" $ { 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
N O _ D E F A U L T _ P A T H
)
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 } ' , "
" \ 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" )
endif ( WITH_OPENMP )
endif ( MSVC )
endmacro ( )
2016-08-31 12:26:05 +00:00
MACRO ( WINDOWS_SIGN_TARGET target )
if ( WITH_WINDOWS_CODESIGN )
if ( !SIGNTOOL_EXE )
error ( "Codesigning is enabled, but signtool is not found" )
else ( )
if ( WINDOWS_CODESIGN_PFX_PASSWORD )
set ( CODESIGNPASSWORD /p ${ WINDOWS_CODESIGN_PFX_PASSWORD } )
else ( )
if ( $ENV{ PFXPASSWORD } )
set ( CODESIGNPASSWORD /p $ENV{ PFXPASSWORD } )
else ( )
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." )
endif ( )
endif ( )
add_custom_command ( TARGET ${ target }
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
)
endif ( )
endif ( )
2016-09-13 20:55:18 +00:00
ENDMACRO ( )