2016-08-09 15:19:11 +02:00
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows.
add_definitions ( -DWIN32 )
2017-10-29 13:16:22 -06:00
if ( NOT MSVC )
2019-04-17 06:35:54 +02:00
message ( FATAL_ERROR "Compiler is unsupported" )
2016-08-09 15:19:11 +02:00
endif ( )
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
if ( CMAKE_C_COMPILER_ID MATCHES "Clang" )
2019-04-17 06:35:54 +02:00
set ( MSVC_CLANG On )
set ( VC_TOOLS_DIR $ENV{ VCToolsRedistDir } CACHE STRING "Location of the msvc redistributables" )
set ( MSVC_REDIST_DIR ${ VC_TOOLS_DIR } )
if ( DEFINED MSVC_REDIST_DIR )
file ( TO_CMAKE_PATH ${ MSVC_REDIST_DIR } MSVC_REDIST_DIR )
else ( )
message ( "Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt." )
endif ( )
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
endif ( )
2017-10-29 13:16:22 -06:00
2018-02-03 16:38:27 -07:00
set_property ( GLOBAL PROPERTY USE_FOLDERS ${ WINDOWS_USE_VISUAL_STUDIO_FOLDERS } )
if ( NOT WITH_PYTHON_MODULE )
2019-04-17 06:35:54 +02:00
set_property ( DIRECTORY PROPERTY VS_STARTUP_PROJECT blender )
2018-02-03 16:38:27 -07:00
endif ( )
2017-10-29 13:16:22 -06:00
macro ( warn_hardcoded_paths package_name
2019-04-17 06:35:54 +02:00
)
if ( WITH_WINDOWS_FIND_MODULES )
message ( WARNING "Using HARDCODED ${package_name} locations" )
endif ( )
2017-10-29 13:16:22 -06:00
endmacro ( )
macro ( windows_find_package package_name
2019-04-17 06:35:54 +02:00
)
if ( WITH_WINDOWS_FIND_MODULES )
find_package ( ${ package_name } )
endif ( )
2017-10-29 13:16:22 -06:00
endmacro ( )
macro ( find_package_wrapper )
2019-04-17 06:35:54 +02:00
if ( WITH_WINDOWS_FIND_MODULES )
find_package ( ${ ARGV } )
endif ( )
2017-10-29 13:16:22 -06:00
endmacro ( )
add_definitions ( -DWIN32 )
2017-12-10 15:12:31 +11:00
# Needed, otherwise system encoding causes utf-8 encoding to fail in some cases (C4819)
add_compile_options ( "$<$<C_COMPILER_ID:MSVC>:/utf-8>" )
add_compile_options ( "$<$<CXX_COMPILER_ID:MSVC>:/utf-8>" )
2017-10-29 13:16:22 -06:00
# Minimum MSVC Version
if ( CMAKE_CXX_COMPILER_ID MATCHES MSVC )
2019-04-17 06:35:54 +02:00
if ( MSVC_VERSION EQUAL 1800 )
set ( _min_ver "18.0.31101" )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${ _min_ver } )
message ( FATAL_ERROR
" V i s u a l S t u d i o 2013 ( Update 4, ${ _min_ver } ) r e q u i r e d , "
" found ( ${ CMAKE_CXX_COMPILER_VERSION } ) " )
endif ( )
endif ( )
if ( MSVC_VERSION EQUAL 1900 )
set ( _min_ver "19.0.24210" )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${ _min_ver } )
message ( FATAL_ERROR
" V i s u a l S t u d i o 2015 ( Update 3, ${ _min_ver } ) r e q u i r e d , "
" found ( ${ CMAKE_CXX_COMPILER_VERSION } ) " )
endif ( )
endif ( )
2017-10-29 13:16:22 -06:00
endif ( )
unset ( _min_ver )
# needed for some MSVC installations
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO" )
set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO" )
list ( APPEND PLATFORM_LINKLIBS
2019-04-17 06:35:54 +02:00
w s 2 _ 3 2 v f w 3 2 w i n m m k e r n e l 3 2 u s e r 3 2 g d i 3 2 c o m d l g 3 2
a d v a p i 3 2 s h f o l d e r s h e l l 3 2 o l e 3 2 o l e a u t 3 2 u u i d p s a p i D b g h e l p
2017-10-29 13:16:22 -06:00
)
if ( WITH_INPUT_IME )
2019-04-17 06:35:54 +02:00
list ( APPEND PLATFORM_LINKLIBS imm32 )
2017-10-29 13:16:22 -06:00
endif ( )
add_definitions (
2019-04-17 06:35:54 +02:00
- D _ C R T _ N O N S T D C _ N O _ D E P R E C A T E
- D _ C R T _ S E C U R E _ N O _ D E P R E C A T E
- D _ S C L _ S E C U R E _ N O _ D E P R E C A T E
- D _ C O N S O L E
- D _ L I B
2017-10-29 13:16:22 -06:00
)
# MSVC11 needs _ALLOW_KEYWORD_MACROS to build
add_definitions ( -D_ALLOW_KEYWORD_MACROS )
# We want to support Vista level ABI
add_definitions ( -D_WIN32_WINNT=0x600 )
# Make cmake find the msvc redistributables
2018-02-01 08:26:14 -07:00
set ( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP FALSE )
set ( CMAKE_INSTALL_UCRT_LIBRARIES TRUE )
set ( CMAKE_INSTALL_OPENMP_LIBRARIES ${ WITH_OPENMP } )
set ( CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION . )
2017-10-29 13:16:22 -06:00
include ( InstallRequiredSystemLibraries )
2018-05-25 21:46:42 -06:00
remove_cc_flag ( "/MDd" "/MD" )
2018-06-10 08:12:13 +02:00
if ( MSVC_CLANG ) # Clangs version of cl doesn't support all flags
2019-04-17 06:35:54 +02:00
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference " )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference" )
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
else ( )
2019-04-17 06:35:54 +02:00
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP" )
Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
endif ( )
2017-10-29 13:16:22 -06:00
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd" )
set ( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT" )
set ( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT" )
set ( CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT" )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT" )
2018-05-31 11:50:30 -06:00
set ( PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO " )
2017-10-29 13:16:22 -06:00
set ( PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib " )
# Ignore meaningless for us linker warnings.
set ( PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221" )
set ( CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221" )
if ( CMAKE_CL_64 )
2019-04-17 06:35:54 +02:00
set ( PLATFORM_LINKFLAGS "/MACHINE:X64 ${PLATFORM_LINKFLAGS}" )
2017-10-29 13:16:22 -06:00
else ( )
2019-04-17 06:35:54 +02:00
set ( PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}" )
2017-10-29 13:16:22 -06:00
endif ( )
2018-05-31 11:50:30 -06:00
set ( PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib" )
2017-10-29 13:16:22 -06:00
if ( NOT DEFINED LIBDIR )
2019-04-17 06:35:54 +02:00
# Setup 64bit and 64bit windows systems
if ( CMAKE_CL_64 )
message ( STATUS "64 bit compiler detected." )
set ( LIBDIR_BASE "win64" )
else ( )
message ( STATUS "32 bit compiler detected." )
set ( LIBDIR_BASE "windows" )
endif ( )
# Can be 1910..1912
if ( MSVC_VERSION GREATER 1919 )
message ( STATUS "Visual Studio 2019 detected." )
set ( LIBDIR ${ CMAKE_SOURCE_DIR } /../lib/ ${ LIBDIR_BASE } _vc14 )
elseif ( MSVC_VERSION GREATER 1909 )
message ( STATUS "Visual Studio 2017 detected." )
set ( LIBDIR ${ CMAKE_SOURCE_DIR } /../lib/ ${ LIBDIR_BASE } _vc14 )
elseif ( MSVC_VERSION EQUAL 1900 )
message ( STATUS "Visual Studio 2015 detected." )
set ( LIBDIR ${ CMAKE_SOURCE_DIR } /../lib/ ${ LIBDIR_BASE } _vc14 )
else ( )
message ( STATUS "Visual Studio 2013 detected." )
set ( LIBDIR ${ CMAKE_SOURCE_DIR } /../lib/ ${ LIBDIR_BASE } _vc12 )
endif ( )
2017-10-29 13:16:22 -06:00
else ( )
2019-04-17 06:35:54 +02:00
message ( STATUS "Using pre-compiled LIBDIR: ${LIBDIR}" )
2017-10-29 13:16:22 -06:00
endif ( )
if ( NOT EXISTS "${LIBDIR}/" )
2019-04-17 06:35:54 +02:00
message ( FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'" )
2017-10-29 13:16:22 -06:00
endif ( )
2019-05-25 12:13:06 -06:00
# Mark libdir as system headers with a lower warn level, to resolve some warnings
2019-05-26 09:25:17 -06:00
# that we have very little control over
2019-05-27 13:48:40 -06:00
if ( MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG )
2019-05-26 09:25:17 -06:00
add_compile_options ( /experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0 )
2019-05-25 12:13:06 -06:00
endif ( )
2017-10-29 13:16:22 -06:00
# Add each of our libraries to our cmake_prefix_path so find_package() could work
file ( GLOB children RELATIVE ${ LIBDIR } ${ LIBDIR } /* )
foreach ( child ${ children } )
2019-04-17 06:35:54 +02:00
if ( IS_DIRECTORY ${ LIBDIR } / ${ child } )
list ( APPEND CMAKE_PREFIX_PATH ${ LIBDIR } / ${ child } )
endif ( )
2017-10-29 13:16:22 -06:00
endforeach ( )
set ( ZLIB_INCLUDE_DIRS ${ LIBDIR } /zlib/include )
set ( ZLIB_LIBRARIES ${ LIBDIR } /zlib/lib/libz_st.lib )
set ( ZLIB_INCLUDE_DIR ${ LIBDIR } /zlib/include )
set ( ZLIB_LIBRARY ${ LIBDIR } /zlib/lib/libz_st.lib )
set ( ZLIB_DIR ${ LIBDIR } /zlib )
windows_find_package ( zlib ) # we want to find before finding things that depend on it like png
windows_find_package ( png )
if ( NOT PNG_FOUND )
2019-04-17 06:35:54 +02:00
warn_hardcoded_paths ( libpng )
set ( PNG_PNG_INCLUDE_DIR ${ LIBDIR } /png/include )
set ( PNG_LIBRARIES ${ LIBDIR } /png/lib/libpng.lib )
set ( PNG "${LIBDIR}/png" )
set ( PNG_INCLUDE_DIRS "${PNG}/include" )
set ( PNG_LIBPATH ${ PNG } /lib ) # not cmake defined
2017-10-29 13:16:22 -06:00
endif ( )
set ( JPEG_NAMES ${ JPEG_NAMES } libjpeg )
windows_find_package ( jpeg REQUIRED )
if ( NOT JPEG_FOUND )
2019-04-17 06:35:54 +02:00
warn_hardcoded_paths ( jpeg )
set ( JPEG_INCLUDE_DIR ${ LIBDIR } /jpeg/include )
set ( JPEG_LIBRARIES ${ LIBDIR } /jpeg/lib/libjpeg.lib )
2017-10-29 13:16:22 -06:00
endif ( )
set ( PTHREADS_INCLUDE_DIRS ${ LIBDIR } /pthreads/include )
2018-12-11 15:12:56 -07:00
set ( PTHREADS_LIBRARIES ${ LIBDIR } /pthreads/lib/pthreadVC3.lib )
2017-10-29 13:16:22 -06:00
set ( FREETYPE ${ LIBDIR } /freetype )
set ( FREETYPE_INCLUDE_DIRS
2019-04-17 06:35:54 +02:00
$ { L I B D I R } / f r e e t y p e / i n c l u d e
$ { L I B D I R } / f r e e t y p e / i n c l u d e / f r e e t y p e 2
2017-10-29 13:16:22 -06:00
)
set ( FREETYPE_LIBRARY ${ LIBDIR } /freetype/lib/freetype2ST.lib )
windows_find_package ( freetype REQUIRED )
if ( WITH_FFTW3 )
2019-04-17 06:35:54 +02:00
set ( FFTW3 ${ LIBDIR } /fftw3 )
set ( FFTW3_LIBRARIES ${ FFTW3 } /lib/libfftw.lib )
set ( FFTW3_INCLUDE_DIRS ${ FFTW3 } /include )
set ( FFTW3_LIBPATH ${ FFTW3 } /lib )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_OPENCOLLADA )
2019-04-17 06:35:54 +02:00
set ( OPENCOLLADA ${ LIBDIR } /opencollada )
set ( OPENCOLLADA_INCLUDE_DIRS
$ { O P E N C O L L A D A } / i n c l u d e / o p e n c o l l a d a / C O L L A D A S t r e a m W r i t e r
$ { O P E N C O L L A D A } / i n c l u d e / o p e n c o l l a d a / C O L L A D A B a s e U t i l s
$ { O P E N C O L L A D A } / i n c l u d e / o p e n c o l l a d a / C O L L A D A F r a m e w o r k
$ { O P E N C O L L A D A } / i n c l u d e / o p e n c o l l a d a / C O L L A D A S a x F r a m e w o r k L o a d e r
$ { O P E N C O L L A D A } / i n c l u d e / o p e n c o l l a d a / G e n e r a t e d S a x P a r s e r
)
set ( OPENCOLLADA_LIBRARIES
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / O p e n C O L L A D A S a x F r a m e w o r k L o a d e r . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / O p e n C O L L A D A F r a m e w o r k . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / O p e n C O L L A D A B a s e U t i l s . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / O p e n C O L L A D A S t r e a m W r i t e r . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / M a t h M L S o l v e r . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / G e n e r a t e d S a x P a r s e r . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / x m l . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / b u f f e r . l i b
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / f t o a . l i b
)
list ( APPEND OPENCOLLADA_LIBRARIES ${ OPENCOLLADA } /lib/opencollada/UTF.lib )
set ( PCRE_LIBRARIES
$ { O P E N C O L L A D A } / l i b / o p e n c o l l a d a / p c r e . l i b
)
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_CODEC_FFMPEG )
2019-04-17 06:35:54 +02:00
set ( FFMPEG_INCLUDE_DIRS
$ { L I B D I R } / f f m p e g / i n c l u d e
$ { L I B D I R } / f f m p e g / i n c l u d e / m s v c
)
windows_find_package ( FFMPEG )
if ( NOT FFMPEG_FOUND )
warn_hardcoded_paths ( ffmpeg )
set ( FFMPEG_LIBRARIES
$ { L I B D I R } / f f m p e g / l i b / a v c o d e c . l i b
$ { L I B D I R } / f f m p e g / l i b / a v f o r m a t . l i b
$ { L I B D I R } / f f m p e g / l i b / a v d e v i c e . l i b
$ { L I B D I R } / f f m p e g / l i b / a v u t i l . l i b
$ { L I B D I R } / f f m p e g / l i b / s w s c a l e . l i b
)
endif ( )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_IMAGE_OPENEXR )
2019-04-17 06:35:54 +02:00
set ( OPENEXR_ROOT_DIR ${ LIBDIR } /openexr )
set ( OPENEXR_VERSION "2.1" )
windows_find_package ( OPENEXR REQUIRED )
if ( NOT OPENEXR_FOUND )
warn_hardcoded_paths ( OpenEXR )
set ( OPENEXR ${ LIBDIR } /openexr )
set ( OPENEXR_INCLUDE_DIR ${ OPENEXR } /include )
set ( OPENEXR_INCLUDE_DIRS ${ OPENEXR_INCLUDE_DIR } ${ OPENEXR } /include/OpenEXR )
set ( OPENEXR_LIBPATH ${ OPENEXR } /lib )
set ( OPENEXR_LIBRARIES
o p t i m i z e d $ { O P E N E X R _ L I B P A T H } / I e x _ s . l i b
o p t i m i z e d $ { O P E N E X R _ L I B P A T H } / H a l f _ s . l i b
o p t i m i z e d $ { O P E N E X R _ L I B P A T H } / I l m I m f _ s . l i b
o p t i m i z e d $ { O P E N E X R _ L I B P A T H } / I m a t h _ s . l i b
o p t i m i z e d $ { O P E N E X R _ L I B P A T H } / I l m T h r e a d _ s . l i b
d e b u g $ { O P E N E X R _ L I B P A T H } / I e x _ s _ d . l i b
d e b u g $ { O P E N E X R _ L I B P A T H } / H a l f _ s _ d . l i b
d e b u g $ { O P E N E X R _ L I B P A T H } / I l m I m f _ s _ d . l i b
d e b u g $ { O P E N E X R _ L I B P A T H } / I m a t h _ s _ d . l i b
d e b u g $ { O P E N E X R _ L I B P A T H } / I l m T h r e a d _ s _ d . l i b
)
endif ( )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_IMAGE_TIFF )
2019-04-17 06:35:54 +02:00
# Try to find tiff first then complain and set static and maybe wrong paths
windows_find_package ( TIFF )
if ( NOT TIFF_FOUND )
warn_hardcoded_paths ( libtiff )
set ( TIFF_LIBRARY ${ LIBDIR } /tiff/lib/libtiff.lib )
set ( TIFF_INCLUDE_DIR ${ LIBDIR } /tiff/include )
endif ( )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_JACK )
2019-04-17 06:35:54 +02:00
set ( JACK_INCLUDE_DIRS
$ { L I B D I R } / j a c k / i n c l u d e / j a c k
$ { L I B D I R } / j a c k / i n c l u d e
)
set ( JACK_LIBRARIES optimized ${ LIBDIR } /jack/lib/libjack.lib debug ${ LIBDIR } /jack/lib/libjack_d.lib )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_PYTHON )
2019-04-17 06:35:54 +02:00
set ( PYTHON_VERSION 3.7 ) # CACHE STRING)
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
string ( REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${ PYTHON_VERSION } )
# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
set ( PYTHON_LIBRARY ${ LIBDIR } /python/lib/python ${ _PYTHON_VERSION_NO_DOTS } .lib )
2019-04-17 13:26:02 -06:00
set ( PYTHON_LIBRARY_DEBUG ${ LIBDIR } /python/lib/python ${ _PYTHON_VERSION_NO_DOTS } _d.lib )
2019-04-17 06:35:54 +02:00
unset ( _PYTHON_VERSION_NO_DOTS )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
# Shared includes for both vc2008 and vc2010
set ( PYTHON_INCLUDE_DIR ${ LIBDIR } /python/include/python ${ PYTHON_VERSION } )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
# uncached vars
set ( PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}" )
2019-04-17 13:26:02 -06:00
set ( PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_BOOST )
2019-04-17 06:35:54 +02:00
if ( WITH_CYCLES_OSL )
set ( boost_extra_libs wave )
endif ( )
if ( WITH_INTERNATIONAL )
list ( APPEND boost_extra_libs locale )
endif ( )
if ( WITH_OPENVDB )
list ( APPEND boost_extra_libs iostreams )
endif ( )
set ( Boost_USE_STATIC_RUNTIME ON ) # prefix lib
set ( Boost_USE_MULTITHREADED ON ) # suffix -mt
set ( Boost_USE_STATIC_LIBS ON ) # suffix -s
if ( WITH_WINDOWS_FIND_MODULES )
find_package ( Boost COMPONENTS date_time filesystem thread regex system ${ boost_extra_libs } )
endif ( )
if ( NOT Boost_FOUND )
warn_hardcoded_paths ( BOOST )
set ( BOOST ${ LIBDIR } /boost )
set ( BOOST_INCLUDE_DIR ${ BOOST } /include )
set ( BOOST_LIBPATH ${ BOOST } /lib )
if ( CMAKE_CL_64 )
set ( BOOST_POSTFIX "vc140-mt-s-x64-1_68.lib" )
set ( BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x64-1_68.lib" )
else ( )
set ( BOOST_POSTFIX "vc140-mt-s-x32-1_68.lib" )
set ( BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x32-1_68.lib" )
endif ( )
set ( BOOST_LIBRARIES
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ d a t e _ t i m e - $ { B O O S T _ P O S T F I X }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ f i l e s y s t e m - $ { B O O S T _ P O S T F I X }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ r e g e x - $ { B O O S T _ P O S T F I X }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ s y s t e m - $ { B O O S T _ P O S T F I X }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ t h r e a d - $ { B O O S T _ P O S T F I X }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ c h r o n o - $ { B O O S T _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ d a t e _ t i m e - $ { B O O S T _ D E B U G _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ f i l e s y s t e m - $ { B O O S T _ D E B U G _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ r e g e x - $ { B O O S T _ D E B U G _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ s y s t e m - $ { B O O S T _ D E B U G _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ t h r e a d - $ { B O O S T _ D E B U G _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ c h r o n o - $ { B O O S T _ D E B U G _ P O S T F I X }
)
if ( WITH_CYCLES_OSL )
set ( BOOST_LIBRARIES ${ BOOST_LIBRARIES }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ w a v e - $ { B O O S T _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ w a v e - $ { B O O S T _ D E B U G _ P O S T F I X } )
endif ( )
if ( WITH_INTERNATIONAL )
set ( BOOST_LIBRARIES ${ BOOST_LIBRARIES }
o p t i m i z e d $ { B O O S T _ L I B P A T H } / l i b b o o s t _ l o c a l e - $ { B O O S T _ P O S T F I X }
d e b u g $ { B O O S T _ L I B P A T H } / l i b b o o s t _ l o c a l e - $ { B O O S T _ D E B U G _ P O S T F I X } )
endif ( )
else ( ) # we found boost using find_package
set ( BOOST_INCLUDE_DIR ${ Boost_INCLUDE_DIRS } )
set ( BOOST_LIBRARIES ${ Boost_LIBRARIES } )
set ( BOOST_LIBPATH ${ Boost_LIBRARY_DIRS } )
endif ( )
set ( BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB" )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_OPENIMAGEIO )
2019-04-17 06:35:54 +02:00
windows_find_package ( OpenImageIO )
set ( OPENIMAGEIO ${ LIBDIR } /openimageio )
set ( OPENIMAGEIO_LIBPATH ${ OPENIMAGEIO } /lib )
set ( OPENIMAGEIO_INCLUDE_DIRS ${ OPENIMAGEIO } /include )
set ( OIIO_OPTIMIZED optimized ${ OPENIMAGEIO_LIBPATH } /OpenImageIO.lib optimized ${ OPENIMAGEIO_LIBPATH } /OpenImageIO_Util.lib )
set ( OIIO_DEBUG debug ${ OPENIMAGEIO_LIBPATH } /OpenImageIO_d.lib debug ${ OPENIMAGEIO_LIBPATH } /OpenImageIO_Util_d.lib )
set ( OPENIMAGEIO_LIBRARIES ${ OIIO_OPTIMIZED } ${ OIIO_DEBUG } )
2018-06-10 08:12:13 +02:00
2019-04-17 06:35:54 +02:00
set ( OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0" )
set ( OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD" )
set ( OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe" )
add_definitions ( -DOIIO_STATIC_BUILD )
add_definitions ( -DOIIO_NO_SSE=1 )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_LLVM )
2019-04-17 06:35:54 +02:00
set ( LLVM_ROOT_DIR ${ LIBDIR } /llvm CACHE PATH "Path to the LLVM installation" )
set ( LLVM_INCLUDE_DIRS ${ LLVM_ROOT_DIR } / $< $<CONFIG:Debug > :Debug>/include CACHE PATH "Path to the LLVM include directory" )
file ( GLOB LLVM_LIBRARY_OPTIMIZED ${ LLVM_ROOT_DIR } /lib/*.lib )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
if ( EXISTS ${ LLVM_ROOT_DIR } /debug/lib )
foreach ( LLVM_OPTIMIZED_LIB ${ LLVM_LIBRARY_OPTIMIZED } )
get_filename_component ( LIBNAME ${ LLVM_OPTIMIZED_LIB } ABSOLUTE )
list ( APPEND LLVM_LIBS optimized ${ LIBNAME } )
endforeach ( LLVM_OPTIMIZED_LIB )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
file ( GLOB LLVM_LIBRARY_DEBUG ${ LLVM_ROOT_DIR } /debug/lib/*.lib )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
foreach ( LLVM_DEBUG_LIB ${ LLVM_LIBRARY_DEBUG } )
get_filename_component ( LIBNAME ${ LLVM_DEBUG_LIB } ABSOLUTE )
list ( APPEND LLVM_LIBS debug ${ LIBNAME } )
endforeach ( LLVM_DEBUG_LIB )
2017-10-29 13:16:22 -06:00
2019-04-17 06:35:54 +02:00
set ( LLVM_LIBRARY ${ LLVM_LIBS } )
else ( )
message ( WARNING "LLVM debug libs not present on this system. Using release libs for debug builds." )
set ( LLVM_LIBRARY ${ LLVM_LIBRARY_OPTIMIZED } )
endif ( )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_OPENCOLORIO )
2019-04-17 06:35:54 +02:00
set ( OPENCOLORIO ${ LIBDIR } /opencolorio )
set ( OPENCOLORIO_INCLUDE_DIRS ${ OPENCOLORIO } /include )
set ( OPENCOLORIO_LIBPATH ${ LIBDIR } /opencolorio/lib )
set ( OPENCOLORIO_LIBRARIES
o p t i m i z e d $ { O P E N C O L O R I O _ L I B P A T H } / O p e n C o l o r I O . l i b
o p t i m i z e d $ { O P E N C O L O R I O _ L I B P A T H } / t i n y x m l . l i b
o p t i m i z e d $ { O P E N C O L O R I O _ L I B P A T H } / l i b y a m l - c p p . l i b
d e b u g $ { O P E N C O L O R I O _ L I B P A T H } / O p e n C o l o r I O _ d . l i b
d e b u g $ { O P E N C O L O R I O _ L I B P A T H } / t i n y x m l _ d . l i b
d e b u g $ { O P E N C O L O R I O _ L I B P A T H } / l i b y a m l - c p p _ d . l i b
)
set ( OPENCOLORIO_DEFINITIONS )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_OPENVDB )
2019-04-17 06:35:54 +02:00
set ( BLOSC_LIBRARIES optimized ${ LIBDIR } /blosc/lib/libblosc.lib debug ${ LIBDIR } /blosc/lib/libblosc_d.lib )
set ( TBB_LIBRARIES optimized ${ LIBDIR } /tbb/lib/tbb.lib debug ${ LIBDIR } /tbb/lib/tbb_debug.lib )
set ( TBB_INCLUDE_DIR ${ LIBDIR } /tbb/include )
set ( OPENVDB ${ LIBDIR } /openvdb )
set ( OPENVDB_LIBPATH ${ LIBDIR } /openvdb/lib )
set ( OPENVDB_INCLUDE_DIRS ${ OPENVDB } /include ${ TBB_INCLUDE_DIR } )
set ( OPENVDB_LIBRARIES optimized ${ OPENVDB_LIBPATH } /openvdb.lib debug ${ OPENVDB_LIBPATH } /openvdb_d.lib ${ TBB_LIBRARIES } ${ BLOSC_LIBRARIES } )
set ( OPENVDB_DEFINITIONS -DNOMINMAX )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_ALEMBIC )
2019-04-17 06:35:54 +02:00
set ( ALEMBIC ${ LIBDIR } /alembic )
set ( ALEMBIC_INCLUDE_DIR ${ ALEMBIC } /include )
set ( ALEMBIC_INCLUDE_DIRS ${ ALEMBIC_INCLUDE_DIR } )
set ( ALEMBIC_LIBPATH ${ ALEMBIC } /lib )
set ( ALEMBIC_LIBRARIES optimized ${ ALEMBIC } /lib/alembic.lib debug ${ ALEMBIC } /lib/alembic_d.lib )
set ( ALEMBIC_FOUND 1 )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_MOD_CLOTH_ELTOPO )
2019-04-17 06:35:54 +02:00
set ( LAPACK ${ LIBDIR } /lapack )
# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
set ( LAPACK_LIBPATH ${ LAPACK } /lib )
set ( LAPACK_LIBRARIES
$ { L I B D I R } / l a p a c k / l i b / l i b f 2 c . l i b
$ { L I B D I R } / l a p a c k / l i b / c l a p a c k _ n o w r a p . l i b
$ { L I B D I R } / l a p a c k / l i b / B L A S _ n o w r a p . l i b
)
2017-10-29 13:16:22 -06:00
endif ( )
2018-08-27 19:37:55 -06:00
if ( WITH_IMAGE_OPENJPEG )
2019-04-17 06:35:54 +02:00
set ( OPENJPEG ${ LIBDIR } /openjpeg )
set ( OPENJPEG_INCLUDE_DIRS ${ OPENJPEG } /include/openjpeg-2.3 )
set ( OPENJPEG_LIBRARIES ${ OPENJPEG } /lib/openjp2.lib )
2018-08-27 19:37:55 -06:00
endif ( )
2018-11-26 11:41:38 +01:00
if ( WITH_OPENSUBDIV )
2019-04-17 06:35:54 +02:00
set ( OPENSUBDIV_INCLUDE_DIR ${ LIBDIR } /opensubdiv/include )
set ( OPENSUBDIV_LIBPATH ${ LIBDIR } /opensubdiv/lib )
set ( OPENSUBDIV_LIBRARIES
o p t i m i z e d $ { O P E N S U B D I V _ L I B P A T H } / o s d C P U . l i b
o p t i m i z e d $ { O P E N S U B D I V _ L I B P A T H } / o s d G P U . l i b
d e b u g $ { O P E N S U B D I V _ L I B P A T H } / o s d C P U _ d . l i b
d e b u g $ { O P E N S U B D I V _ L I B P A T H } / o s d G P U _ d . l i b
)
set ( OPENSUBDIV_HAS_OPENMP TRUE )
set ( OPENSUBDIV_HAS_TBB FALSE )
set ( OPENSUBDIV_HAS_OPENCL TRUE )
set ( OPENSUBDIV_HAS_CUDA FALSE )
set ( OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK TRUE )
set ( OPENSUBDIV_HAS_GLSL_COMPUTE TRUE )
windows_find_package ( OpenSubdiv )
2017-10-29 13:16:22 -06:00
endif ( )
if ( WITH_SDL )
2019-04-17 06:35:54 +02:00
set ( SDL ${ LIBDIR } /sdl )
set ( SDL_INCLUDE_DIR ${ SDL } /include )
set ( SDL_LIBPATH ${ SDL } /lib )
set ( SDL_LIBRARY ${ SDL_LIBPATH } /SDL2.lib )
2017-10-29 13:16:22 -06:00
endif ( )
# Audio IO
if ( WITH_SYSTEM_AUDASPACE )
2019-04-17 06:35:54 +02:00
set ( AUDASPACE_INCLUDE_DIRS ${ LIBDIR } /audaspace/include/audaspace )
set ( AUDASPACE_LIBRARIES ${ LIBDIR } /audaspace/lib/audaspace.lib )
set ( AUDASPACE_C_INCLUDE_DIRS ${ LIBDIR } /audaspace/include/audaspace )
set ( AUDASPACE_C_LIBRARIES ${ LIBDIR } /audaspace/lib/audaspace-c.lib )
set ( AUDASPACE_PY_INCLUDE_DIRS ${ LIBDIR } /audaspace/include/audaspace )
set ( AUDASPACE_PY_LIBRARIES ${ LIBDIR } /audaspace/lib/audaspace-py.lib )
2017-10-29 13:16:22 -06:00
endif ( )
# used in many places so include globally, like OpenGL
blender_include_dirs_sys ( "${PTHREADS_INCLUDE_DIRS}" )
#find signtool
set ( ProgramFilesX86_NAME "ProgramFiles(x86)" ) #env dislikes the ( )
find_program ( SIGNTOOL_EXE signtool
2019-04-17 06:35:54 +02:00
H I N T S
" $ E N V { $ { P r o g r a m F i l e s X 8 6 _ N A M E } } / W i n d o w s K i t s / 1 0 / b i n / x 8 6 / "
" $ E N V { P r o g r a m F i l e s } / W i n d o w s K i t s / 1 0 / b i n / x 8 6 / "
" $ E N V { $ { P r o g r a m F i l e s X 8 6 _ N A M E } } / W i n d o w s K i t s / 8 . 1 / b i n / x 8 6 / "
" $ E N V { P r o g r a m F i l e s } / W i n d o w s K i t s / 8 . 1 / b i n / x 8 6 / "
" $ E N V { $ { P r o g r a m F i l e s X 8 6 _ N A M E } } / W i n d o w s K i t s / 8 . 0 / b i n / x 8 6 / "
" $ E N V { P r o g r a m F i l e s } / W i n d o w s K i t s / 8 . 0 / b i n / x 8 6 / "
2017-10-29 13:16:22 -06:00
)
2016-08-09 15:19:11 +02:00
set ( WINTAB_INC ${ LIBDIR } /wintab/include )
if ( WITH_OPENAL )
2019-04-17 06:35:54 +02:00
set ( OPENAL ${ LIBDIR } /openal )
set ( OPENALDIR ${ LIBDIR } /openal )
set ( OPENAL_INCLUDE_DIR ${ OPENAL } /include/AL )
set ( OPENAL_LIBPATH ${ OPENAL } /lib )
if ( MSVC )
set ( OPENAL_LIBRARY ${ OPENAL_LIBPATH } /openal32.lib )
else ( )
set ( OPENAL_LIBRARY ${ OPENAL_LIBPATH } /wrap_oal.lib )
endif ( )
2017-10-29 18:20:24 -02:00
2016-08-09 15:19:11 +02:00
endif ( )
if ( WITH_CODEC_SNDFILE )
2019-04-17 06:35:54 +02:00
set ( LIBSNDFILE ${ LIBDIR } /sndfile )
set ( LIBSNDFILE_INCLUDE_DIRS ${ LIBSNDFILE } /include )
set ( LIBSNDFILE_LIBPATH ${ LIBSNDFILE } /lib ) # TODO, deprecate
set ( LIBSNDFILE_LIBRARIES ${ LIBSNDFILE_LIBPATH } /libsndfile-1.lib )
2016-08-09 15:19:11 +02:00
endif ( )
if ( WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD )
2019-04-17 06:35:54 +02:00
add_definitions ( -D__SSE__ -D__MMX__ )
2016-08-09 15:19:11 +02:00
endif ( )
if ( WITH_CYCLES_OSL )
2019-04-17 06:35:54 +02:00
set ( CYCLES_OSL ${ LIBDIR } /osl CACHE PATH "Path to OpenShadingLanguage installation" )
find_library ( OSL_LIB_EXEC NAMES oslexec PATHS ${ CYCLES_OSL } /lib )
find_library ( OSL_LIB_COMP NAMES oslcomp PATHS ${ CYCLES_OSL } /lib )
find_library ( OSL_LIB_QUERY NAMES oslquery PATHS ${ CYCLES_OSL } /lib )
find_library ( OSL_LIB_EXEC_DEBUG NAMES oslexec_d PATHS ${ CYCLES_OSL } /lib )
find_library ( OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${ CYCLES_OSL } /lib )
find_library ( OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${ CYCLES_OSL } /lib )
list ( APPEND OSL_LIBRARIES
o p t i m i z e d $ { O S L _ L I B _ C O M P }
o p t i m i z e d $ { O S L _ L I B _ E X E C }
o p t i m i z e d $ { O S L _ L I B _ Q U E R Y }
o p t i m i z e d $ { C Y C L E S _ O S L } / l i b / p u g i x m l . l i b
d e b u g $ { O S L _ L I B _ E X E C _ D E B U G }
d e b u g $ { O S L _ L I B _ C O M P _ D E B U G }
d e b u g $ { O S L _ L I B _ Q U E R Y _ D E B U G }
d e b u g $ { C Y C L E S _ O S L } / l i b / p u g i x m l _ d . l i b
)
find_path ( OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${ CYCLES_OSL } /include )
find_program ( OSL_COMPILER NAMES oslc PATHS ${ CYCLES_OSL } /bin )
if ( OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER )
set ( OSL_FOUND TRUE )
else ( )
message ( STATUS "OSL not found" )
set ( WITH_CYCLES_OSL OFF )
endif ( )
2016-08-09 15:19:11 +02:00
endif ( )
2018-10-22 10:17:08 -06:00
2018-11-07 12:58:12 +01:00
if ( WITH_CYCLES_EMBREE )
2019-04-17 06:35:54 +02:00
windows_find_package ( Embree )
if ( NOT EMBREE_FOUND )
set ( EMBREE_INCLUDE_DIRS ${ LIBDIR } /embree/include )
set ( EMBREE_LIBRARIES
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / e m b r e e 3 . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ a v x 2 . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ a v x . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ s s e 4 2 . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / l e x e r s . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / m a t h . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / s i m d . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / s y s . l i b
o p t i m i z e d $ { L I B D I R } / e m b r e e / l i b / t a s k i n g . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / e m b r e e 3 _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ a v x 2 _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ a v x _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / e m b r e e _ s s e 4 2 _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / l e x e r s _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / m a t h _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / s i m d _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / s y s _ d . l i b
d e b u g $ { L I B D I R } / e m b r e e / l i b / t a s k i n g _ d . l i b )
endif ( )
2018-11-07 12:58:12 +01:00
endif ( )
2018-10-22 10:17:08 -06:00
if ( WINDOWS_PYTHON_DEBUG )
2019-04-17 06:35:54 +02:00
# Include the system scripts in the blender_python_system_scripts project.
FILE ( GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
ADD_CUSTOM_TARGET ( blender_python_system_scripts SOURCES ${ inFiles } )
foreach ( _source IN ITEMS ${ inFiles } )
get_filename_component ( _source_path "${_source}" PATH )
string ( REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}" )
string ( REPLACE "/" "\\" _group_path "${_source_path}" )
source_group ( "${_group_path}" FILES "${_source}" )
endforeach ( )
# Include the user scripts from the profile folder in the blender_python_user_scripts project.
set ( USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}" )
file ( TO_CMAKE_PATH ${ USER_SCRIPTS_ROOT } USER_SCRIPTS_ROOT )
FILE ( GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/scripts/*.*" )
ADD_CUSTOM_TARGET ( blender_python_user_scripts SOURCES ${ inFiles } )
foreach ( _source IN ITEMS ${ inFiles } )
get_filename_component ( _source_path "${_source}" PATH )
string ( REPLACE "${USER_SCRIPTS_ROOT}/scripts" "" _source_path "${_source_path}" )
string ( REPLACE "/" "\\" _group_path "${_source_path}" )
source_group ( "${_group_path}" FILES "${_source}" )
endforeach ( )
set_target_properties ( blender_python_system_scripts PROPERTIES FOLDER "scripts" )
set_target_properties ( blender_python_user_scripts PROPERTIES FOLDER "scripts" )
# Set the default debugging options for the project, only write this file once so the user
# is free to override them at their own perril.
set ( USER_PROPS_FILE "${CMAKE_CURRENT_BINARY_DIR}/source/creator/blender.Cpp.user.props" )
if ( NOT EXISTS ${ USER_PROPS_FILE } )
# Layout below is messy, because otherwise the generated file will look messy.
file ( WRITE ${ USER_PROPS_FILE } "<?xml version=\" 1.0\ " encoding=\" utf-8\ " ?>
2018-10-22 10:17:08 -06:00
< P r o j e c t D e f a u l t T a r g e t s = \ " B u i l d \ " x m l n s = \ " h t t p : / / s c h e m a s . m i c r o s o f t . c o m / d e v e l o p e r / m s b u i l d / 2 0 0 3 \ " >
2019-04-17 06:35:54 +02:00
< P r o p e r t y G r o u p >
< L o c a l D e b u g g e r C o m m a n d A r g u m e n t s > - c o n - - e n v - s y s t e m - s c r i p t s \ " $ { C M A K E _ S O U R C E _ D I R } / r e l e a s e / s c r i p t s \ " < / L o c a l D e b u g g e r C o m m a n d A r g u m e n t s >
< / P r o p e r t y G r o u p >
2018-10-22 10:17:08 -06:00
< / P r o j e c t > " )
2019-04-17 06:35:54 +02:00
endif ( )
2018-10-22 10:17:08 -06:00
endif ( )