Compare commits
47 Commits
outliner-c
...
soc-2020-c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
11aa61274d | ||
![]() |
1b8bc74b1f | ||
![]() |
705acb423b | ||
![]() |
114987ee42 | ||
![]() |
f8ebfd0e88 | ||
![]() |
0dfe6a6a37 | ||
![]() |
fd2d7e7a48 | ||
81aeb7ab08 | |||
![]() |
2772910b32 | ||
![]() |
79d256a06d | ||
![]() |
278b753088 | ||
![]() |
0137777137 | ||
a7e8e509a7 | |||
8da4917156 | |||
![]() |
4279181f10 | ||
![]() |
b1269effa9 | ||
![]() |
ca64458b61 | ||
04ef339f74 | |||
![]() |
1e68909800 | ||
![]() |
0de94b2b62 | ||
![]() |
d225ddec4a | ||
![]() |
8d0a3b5c1c | ||
![]() |
9ca8bf13d5 | ||
![]() |
2ae9183f4b | ||
a1dcb2aa70 | |||
9f60b06c8b | |||
![]() |
48b5c90975 | ||
![]() |
1cd405850c | ||
![]() |
cd610269dc | ||
![]() |
9fe9eb5240 | ||
![]() |
3c9ba5e994 | ||
![]() |
b83e559956 | ||
![]() |
fe0e9900d5 | ||
![]() |
3a519e00c5 | ||
![]() |
2eba146a88 | ||
9c530388ca | |||
![]() |
bf3c22ec55 | ||
![]() |
7f7a7efc62 | ||
52b2901156 | |||
![]() |
8344c0acc5 | ||
![]() |
3229939eae | ||
![]() |
d1921a46ca | ||
![]() |
b997a7cb51 | ||
![]() |
8a661f5dd1 | ||
![]() |
717dfa198c | ||
![]() |
935b518ec7 | ||
![]() |
4e04c9b874 |
33
.clang-tidy
33
.clang-tidy
@@ -1,6 +1,3 @@
|
||||
# The warnings below are disabled because they are too pedantic and not worth fixing.
|
||||
# Some of them will be enabled as part of the Clang-Tidy task, see T78535.
|
||||
|
||||
Checks: >
|
||||
-*,
|
||||
readability-*,
|
||||
@@ -15,10 +12,15 @@ Checks: >
|
||||
|
||||
-readability-misleading-indentation,
|
||||
|
||||
-readability-inconsistent-declaration-parameter-name,
|
||||
-readability-redundant-preprocessor,
|
||||
-readability-redundant-member-init,
|
||||
-readability-const-return-type,
|
||||
-readability-static-accessed-through-instance,
|
||||
-readability-redundant-declaration,
|
||||
-readability-qualified-auto,
|
||||
-readability-use-anyofallof,
|
||||
|
||||
-readability-function-cognitive-complexity,
|
||||
|
||||
bugprone-*,
|
||||
-bugprone-narrowing-conversions,
|
||||
-bugprone-unhandled-self-assignment,
|
||||
@@ -28,24 +30,7 @@ Checks: >
|
||||
|
||||
-bugprone-sizeof-expression,
|
||||
-bugprone-integer-division,
|
||||
|
||||
-bugprone-exception-escape,
|
||||
-bugprone-redundant-branch-condition,
|
||||
|
||||
modernize-*,
|
||||
-modernize-use-auto,
|
||||
-modernize-use-trailing-return-type,
|
||||
-modernize-deprecated-headers,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-use-equals-default,
|
||||
-modernize-use-nodiscard,
|
||||
-modernize-use-using,
|
||||
-modernize-loop-convert,
|
||||
-modernize-pass-by-value,
|
||||
-modernize-use-default-member-init,
|
||||
-modernize-raw-string-literal,
|
||||
-modernize-avoid-bind,
|
||||
-modernize-use-override,
|
||||
-modernize-use-transparent-functors,
|
||||
-bugprone-incorrect-roundings,
|
||||
-bugprone-copy-constructor-init,
|
||||
|
||||
WarningsAsErrors: '*'
|
||||
|
@@ -1,93 +0,0 @@
|
||||
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
#
|
||||
# After running the above, commits listed in this file will be
|
||||
# ignored by git blame. The blame will be shifted to the person
|
||||
# who edited the line(s) before the ignored commit.
|
||||
#
|
||||
# To disable this ignorance for a command, run as follows
|
||||
# git blame --ignore-revs-file="" <other options>
|
||||
#
|
||||
# Changes that belong here:
|
||||
# - Massive comment, doxy-sections, or spelling corrections.
|
||||
# - Clang-format, PEP8 or other automated changes which are *strictly* "no functional change".
|
||||
# - Several smaller commits should be added to this list at once, because adding
|
||||
# one extra commit (to edit this file) after every small cleanup is noisy.
|
||||
#
|
||||
# Note:
|
||||
# - The comment above the SHA should be the first line of the commit.
|
||||
# - It is fine to pack together similar commits if they have the same explanatory comment.
|
||||
# - Use only 40 character git SHAs; not smaller ones, not prefixed with rB.
|
||||
#
|
||||
# https://git-scm.com/docs/git-blame/2.23.0
|
||||
|
||||
# white space commit. (2 spaces -> tab).
|
||||
0a3694cd6ebec710da7110e9f168a72d47c71ee0
|
||||
|
||||
# Cycles: Cleanup, spacing after preprocessor
|
||||
cb4b5e12abf1fc6cf9ffc0944e0a1bc406286c63
|
||||
|
||||
# ClangFormat: apply to source, most of intern
|
||||
e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
|
||||
|
||||
# Code Style: use "#pragma once" in source directory
|
||||
91694b9b58ab953f3b313be9389cc1303e472fc2
|
||||
|
||||
# Code Style: use "#pragma once" in some newer headers
|
||||
8198dbb888856b8c11757586df02aca15f132f90
|
||||
|
||||
# Code Style: use "#pragma once" in intern/ghost
|
||||
1b1129f82a9cf316b54fbc025f8cfcc1a74b8589
|
||||
|
||||
# Cleanup: mostly comments, use doxy syntax & typos
|
||||
e0cb02587012b4b2f4b18363dc7d0a7da2c02093
|
||||
|
||||
# Cleanup: use C comments for descriptive text
|
||||
2abfcebb0eb7989e3d1e7d03f37ecf5c088210af
|
||||
|
||||
# use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed.
|
||||
afacd184982e58a9c830a3d5366e25983939a7ba
|
||||
|
||||
# Spelling: It's Versus Its
|
||||
3a7fd309fce89213b0224b3c6807adb2d1fe7ca8
|
||||
|
||||
# Spelling: Then Versus Than
|
||||
d1eefc421544e2ea632fb35cb6bcaade4c39ce6b
|
||||
|
||||
# Spelling: Miscellaneous
|
||||
84ef3b80de4915a24a9fd2fd214d0fa44e59b854
|
||||
|
||||
# Spelling: Loose Versus Lose
|
||||
c0a6bc19794c69843c38451c762e91bc10136e0f
|
||||
|
||||
# Spelling: Apart Versus A Part
|
||||
3d26cd01b9ba6381eb165e11536345ae652dfb41
|
||||
|
||||
# Cleanup: use 2 space indentation for CMake
|
||||
3076d95ba441cd32706a27d18922a30f8fd28b8a
|
||||
|
||||
# Cleanup: use over-line for doxy comments
|
||||
4b188bb08cf5aaae3c68ab57bbcfa037eef1ac10
|
||||
|
||||
# Cleanup: General comment style clean up of graph_edit.c and fcurve.c
|
||||
0105f146bb40bd609ccbda3d3f6aeb8e14ad3f9e
|
||||
|
||||
# Cleanup: pep8 (indentation, spacing, long lines)
|
||||
41d2d6da0c96d351b47acb64d3e0decdba16cb16
|
||||
|
||||
# Cleanup: pep8, blank lines
|
||||
bab9de2a52929fe2b45ecddb1eb09da3378e303b
|
||||
|
||||
# Cleanup: PEP8 for python changes
|
||||
1e7e94588daa66483190f45a9de5e98228f80e05
|
||||
|
||||
# GPencil: Cleanup pep8
|
||||
a09cc3ee1a99f2cd5040bbf30c8ab8c588bb2bb1
|
||||
|
||||
# Cleanup: trailing space, remove tabs, pep8
|
||||
c42a6b77b52560d257279de2cb624b4ef2c0d24c
|
||||
|
||||
# Cleanup: use C style doxygen comments
|
||||
8c1726918374e1d2d2123e17bae8db5aadde3433
|
||||
|
||||
# Cleanup: use doxy sections for imbuf
|
||||
c207f7c22e1439e0b285fba5d2c072bdae23f981
|
219
CMakeLists.txt
219
CMakeLists.txt
@@ -43,8 +43,8 @@ endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Prefer LEGACY OpenGL to be compatible with all the existing releases and
|
||||
# platforms which don't have GLVND yet. Only do it if preference was not set
|
||||
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
|
||||
# platforms which don't hare GLVND yet. Only do it if preference was not set
|
||||
# externally.
|
||||
if(NOT DEFINED OpenGL_GL_PREFERENCE)
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
@@ -128,9 +128,7 @@ enable_testing()
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE)
|
||||
|
||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(GENERATOR_IS_MULTI_CONFIG)
|
||||
if(MSVC)
|
||||
set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/$<CONFIG>/ CACHE INTERNAL "" FORCE)
|
||||
else()
|
||||
set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests/ CACHE INTERNAL "" FORCE)
|
||||
@@ -198,12 +196,10 @@ option(WITH_OPENIMAGEDENOISE "Enable the OpenImageDenoise compositing node" ON
|
||||
|
||||
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ON)
|
||||
|
||||
option(WITH_POTRACE "Enable features relying on potrace" ON)
|
||||
option(WITH_OPENVDB "Enable features relying on OpenVDB" ON)
|
||||
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ON)
|
||||
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
|
||||
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
|
||||
option(WITH_NANOVDB "Enable usage of NanoVDB data structure for rendering on the GPU" ON)
|
||||
|
||||
# GHOST Windowing Library Options
|
||||
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
|
||||
@@ -224,6 +220,8 @@ if(WITH_GHOST_X11)
|
||||
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
|
||||
endif()
|
||||
|
||||
option(WITH_GMP "Use the gmp library for more accurate booleans" OFF)
|
||||
|
||||
# Misc...
|
||||
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
|
||||
mark_as_advanced(WITH_HEADLESS)
|
||||
@@ -377,7 +375,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
|
||||
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
|
||||
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
|
||||
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 sm_86 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 compute_75 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
|
||||
@@ -439,12 +437,8 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
# This should be turned off when Blender enter beta/rc/release
|
||||
if("${BLENDER_VERSION_CYCLE}" STREQUAL "release" OR
|
||||
"${BLENDER_VERSION_CYCLE}" STREQUAL "rc")
|
||||
set(WITH_EXPERIMENTAL_FEATURES OFF)
|
||||
else()
|
||||
set(WITH_EXPERIMENTAL_FEATURES ON)
|
||||
endif()
|
||||
option(WITH_EXPERIMENTAL_FEATURES "Enable experimental features (still need to enable them in the user preferences)" ON)
|
||||
mark_as_advanced(WITH_EXPERIMENTAL_FEATURES)
|
||||
|
||||
# Unit testsing
|
||||
option(WITH_GTESTS "Enable GTest unit testing" OFF)
|
||||
@@ -516,22 +510,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
-fno-sanitize=alignment \
|
||||
")
|
||||
|
||||
if(MSVC)
|
||||
# clang-cl doesn't support all sanitizers, but leak and object-size give errors/warnings.
|
||||
set(_asan_defaults "${_asan_defaults}")
|
||||
elseif(APPLE)
|
||||
# AppleClang doesn't support all sanitizers, but leak gives error.
|
||||
# Build type is not known for multi-config generator, so don't add object-size sanitizer.
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Debug" OR GENERATOR_IS_MULTI_CONFIG)
|
||||
# Silence the warning that object-size is not effective in -O0.
|
||||
set(_asan_defaults "${_asan_defaults}")
|
||||
else()
|
||||
string(APPEND _asan_defaults " -fsanitize=object-size")
|
||||
endif()
|
||||
else()
|
||||
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
|
||||
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
|
||||
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
|
||||
endif()
|
||||
|
||||
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
||||
mark_as_advanced(COMPILER_ASAN_CFLAGS)
|
||||
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
|
||||
@@ -539,42 +520,20 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
unset(_asan_defaults)
|
||||
|
||||
if(MSVC)
|
||||
find_library(
|
||||
COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
||||
if(NOT MSVC)
|
||||
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||
else()
|
||||
find_library(
|
||||
COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
||||
)
|
||||
elseif(APPLE)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
|
||||
-print-file-name=lib
|
||||
OUTPUT_VARIABLE CLANG_LIB_DIR
|
||||
)
|
||||
string(STRIP "${CLANG_LIB_DIR}" CLANG_LIB_DIR)
|
||||
find_library(
|
||||
COMPILER_ASAN_LIBRARY
|
||||
NAMES
|
||||
libclang_rt.asan_osx_dynamic.dylib
|
||||
PATHS
|
||||
"${CLANG_LIB_DIR}/darwin/"
|
||||
)
|
||||
unset(CLANG_LIB_DIR)
|
||||
else()
|
||||
find_library(
|
||||
COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ relative to top level source and build directories." ON)
|
||||
mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
# Use hardcoded paths or find_package to find externals
|
||||
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
|
||||
@@ -710,9 +669,6 @@ set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE OFF)
|
||||
set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF)
|
||||
set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
|
||||
|
||||
# NanoVDB requires OpenVDB to convert the data structure
|
||||
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
|
||||
|
||||
# OpenVDB uses 'half' type from OpenEXR & fails to link without OpenEXR enabled.
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
|
||||
|
||||
@@ -847,10 +803,11 @@ set(CXX_WARNINGS)
|
||||
set(C_REMOVE_STRICT_FLAGS)
|
||||
set(CXX_REMOVE_STRICT_FLAGS)
|
||||
|
||||
# Libraries to link to targets in setup_platform_linker_libs
|
||||
# libraries to link the binary with passed to target_link_libraries()
|
||||
# known as LLIBS to scons
|
||||
set(PLATFORM_LINKLIBS "")
|
||||
|
||||
# Added to target linker flags in setup_platform_linker_flags
|
||||
# Added to linker flags in setup_liblinks
|
||||
# - CMAKE_EXE_LINKER_FLAGS
|
||||
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||
set(PLATFORM_LINKFLAGS "")
|
||||
@@ -858,27 +815,15 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
if(WITH_COMPILER_ASAN)
|
||||
if(NOT APPLE)
|
||||
# Avoid passing address sanitizer compiler flags to `try_compile`.
|
||||
# Since linker flags are not set, all compiler checks and `find_package`
|
||||
# calls that rely on `try_compile` will fail.
|
||||
# See CMP0066 also.
|
||||
string(APPEND CMAKE_C_FLAGS_DEBUG " ${COMPILER_ASAN_CFLAGS}")
|
||||
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CFLAGS}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${COMPILER_ASAN_CXXFLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMPILER_ASAN_CXXFLAGS}")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
|
||||
if(MSVC)
|
||||
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
|
||||
endif()
|
||||
|
||||
if(APPLE AND COMPILER_ASAN_LIBRARY)
|
||||
string(REPLACE " " ";" _list_COMPILER_ASAN_CFLAGS ${COMPILER_ASAN_CFLAGS})
|
||||
add_compile_options("$<$<NOT:$<CONFIG:Release>>:${_list_COMPILER_ASAN_CFLAGS}>")
|
||||
add_link_options("$<$<NOT:$<CONFIG:Release>>:-fno-omit-frame-pointer;-fsanitize=address>")
|
||||
unset(_list_COMPILER_ASAN_CFLAGS)
|
||||
elseif(COMPILER_ASAN_LIBRARY)
|
||||
if(COMPILER_ASAN_LIBRARY)
|
||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
|
||||
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
|
||||
@@ -946,11 +891,11 @@ endif()
|
||||
# Do it globally, SSE2 is required for quite some time now.
|
||||
# Doing it now allows to use SSE/SSE2 in inline headers.
|
||||
if(SUPPORT_SSE_BUILD)
|
||||
string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ")
|
||||
set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
|
||||
add_definitions(-D__SSE__ -D__MMX__)
|
||||
endif()
|
||||
if(SUPPORT_SSE2_BUILD)
|
||||
string(APPEND PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG}")
|
||||
set(PLATFORM_CFLAGS " ${PLATFORM_CFLAGS} ${COMPILER_SSE2_FLAG}")
|
||||
add_definitions(-D__SSE2__)
|
||||
if(NOT SUPPORT_SSE_BUILD) # don't double up
|
||||
add_definitions(-D__MMX__)
|
||||
@@ -1162,8 +1107,8 @@ if(WITH_OPENMP)
|
||||
|
||||
if(OPENMP_FOUND)
|
||||
if(NOT WITH_OPENMP_STATIC)
|
||||
string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${OpenMP_CXX_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
else()
|
||||
# Typically avoid adding flags as defines but we can't
|
||||
# pass OpenMP flags to the linker for static builds, meaning
|
||||
@@ -1522,7 +1467,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_VARIABLE -Wno-unused-variable)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
|
||||
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
|
||||
@@ -1533,7 +1477,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
|
||||
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
|
||||
@@ -1543,7 +1486,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNDEFINED_VAR_TEMPLATE -Wno-undefined-var-template)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_INSTANTIATION_AFTER_SPECIALIZATION -Wno-instantiation-after-specialization)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_MISLEADING_INDENTATION -Wno-misleading-indentation)
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
|
||||
@@ -1556,8 +1498,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
|
||||
|
||||
# disable numbered, false positives
|
||||
string(APPEND C_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||
string(APPEND CXX_WARNINGS " -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
# most msvc warnings are C & C++
|
||||
set(_WARNINGS
|
||||
@@ -1588,7 +1530,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
|
||||
if(MSVC_VERSION GREATER_EQUAL 1911)
|
||||
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
|
||||
string(APPEND _WARNINGS " /w35038") # order of initialization in c++ constructors
|
||||
set(_WARNINGS "${_WARNINGS} /w35038") # order of initialization in c++ constructors
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
|
||||
@@ -1629,19 +1571,19 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /std:c++17")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
|
||||
# Make MSVC properly report the value of the __cplusplus preprocessor macro
|
||||
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
|
||||
# of the C++ standard chosen above
|
||||
# of the C++ standard chosen above
|
||||
if(MSVC_VERSION GREATER 1913)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
|
||||
endif()
|
||||
elseif(
|
||||
CMAKE_COMPILER_IS_GNUCC OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "Intel"
|
||||
)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -std=c++17")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
|
||||
endif()
|
||||
@@ -1654,47 +1596,12 @@ if(
|
||||
(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
)
|
||||
# Use C11 + GNU extensions, works with GCC, Clang, ICC
|
||||
string(APPEND CMAKE_C_FLAGS " -std=gnu11")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(NOT WITH_CXX11_ABI)
|
||||
string(APPEND PLATFORM_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_COMPILER_SHORT_FILE_MACRO)
|
||||
# Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_PREFIX_MAP_FLAGS CXX_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
|
||||
if(C_MACRO_PREFIX_MAP AND CXX_MACRO_PREFIX_MAP)
|
||||
if(APPLE)
|
||||
if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0)
|
||||
# Developers may have say LLVM Clang-10.0.1 toolchain (which supports the flag)
|
||||
# with Xcode-11 (the Clang of which doesn't support the flag).
|
||||
message(WARNING
|
||||
"-fmacro-prefix-map flag is NOT supported by Clang shipped with Xcode-${XCODE_VERSION}."
|
||||
" Some Xcode functionality in Product menu may not work. Disabling WITH_COMPILER_SHORT_FILE_MACRO."
|
||||
)
|
||||
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_COMPILER_SHORT_FILE_MACRO)
|
||||
path_ensure_trailing_slash(_src_dir "${CMAKE_SOURCE_DIR}")
|
||||
path_ensure_trailing_slash(_bin_dir "${CMAKE_BINARY_DIR}")
|
||||
# Keep this variable so it can be stripped from build-info.
|
||||
set(PLATFORM_CFLAGS_FMACRO_PREFIX_MAP
|
||||
"-fmacro-prefix-map=\"${_src_dir}\"=\"\" -fmacro-prefix-map=\"${_bin_dir}\"=\"\"")
|
||||
string(APPEND PLATFORM_CFLAGS " ${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}")
|
||||
unset(_src_dir)
|
||||
unset(_bin_dir)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING
|
||||
"-fmacro-prefix-map flag is NOT supported by C/C++ compiler."
|
||||
" Disabling WITH_COMPILER_SHORT_FILE_MACRO."
|
||||
)
|
||||
set(WITH_COMPILER_SHORT_FILE_MACRO OFF)
|
||||
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1798,7 +1705,7 @@ if(FIRST_RUN)
|
||||
set(_msg " - ${_setting}")
|
||||
string(LENGTH "${_msg}" _len)
|
||||
while("32" GREATER "${_len}")
|
||||
string(APPEND _msg " ")
|
||||
set(_msg "${_msg} ")
|
||||
math(EXPR _len "${_len} + 1")
|
||||
endwhile()
|
||||
|
||||
@@ -1816,24 +1723,24 @@ if(FIRST_RUN)
|
||||
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
|
||||
|
||||
info_cfg_text("Build Options:")
|
||||
info_cfg_option(WITH_ALEMBIC)
|
||||
info_cfg_option(WITH_BULLET)
|
||||
info_cfg_option(WITH_CYCLES)
|
||||
info_cfg_option(WITH_FFTW3)
|
||||
info_cfg_option(WITH_FREESTYLE)
|
||||
info_cfg_option(WITH_GMP)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
info_cfg_option(WITH_IK_SOLVER)
|
||||
info_cfg_option(WITH_INPUT_NDOF)
|
||||
info_cfg_option(WITH_INTERNATIONAL)
|
||||
info_cfg_option(WITH_IK_ITASC)
|
||||
info_cfg_option(WITH_OPENCOLLADA)
|
||||
info_cfg_option(WITH_FFTW3)
|
||||
info_cfg_option(WITH_INTERNATIONAL)
|
||||
info_cfg_option(WITH_INPUT_NDOF)
|
||||
info_cfg_option(WITH_CYCLES)
|
||||
info_cfg_option(WITH_FREESTYLE)
|
||||
info_cfg_option(WITH_OPENCOLORIO)
|
||||
info_cfg_option(WITH_XR_OPENXR)
|
||||
info_cfg_option(WITH_OPENIMAGEDENOISE)
|
||||
info_cfg_option(WITH_OPENVDB)
|
||||
info_cfg_option(WITH_ALEMBIC)
|
||||
info_cfg_option(WITH_QUADRIFLOW)
|
||||
info_cfg_option(WITH_TBB)
|
||||
info_cfg_option(WITH_USD)
|
||||
info_cfg_option(WITH_XR_OPENXR)
|
||||
info_cfg_option(WITH_TBB)
|
||||
info_cfg_option(WITH_GMP)
|
||||
|
||||
info_cfg_text("Compiler Options:")
|
||||
info_cfg_option(WITH_BUILDINFO)
|
||||
@@ -1841,58 +1748,58 @@ if(FIRST_RUN)
|
||||
|
||||
info_cfg_text("System Options:")
|
||||
info_cfg_option(WITH_INSTALL_PORTABLE)
|
||||
info_cfg_option(WITH_MEM_JEMALLOC)
|
||||
info_cfg_option(WITH_MEM_VALGRIND)
|
||||
info_cfg_option(WITH_SYSTEM_GLEW)
|
||||
info_cfg_option(WITH_X11_ALPHA)
|
||||
info_cfg_option(WITH_X11_XF86VMODE)
|
||||
info_cfg_option(WITH_X11_XFIXES)
|
||||
info_cfg_option(WITH_X11_XINPUT)
|
||||
info_cfg_option(WITH_MEM_JEMALLOC)
|
||||
info_cfg_option(WITH_MEM_VALGRIND)
|
||||
info_cfg_option(WITH_SYSTEM_GLEW)
|
||||
|
||||
info_cfg_text("Image Formats:")
|
||||
info_cfg_option(WITH_OPENIMAGEIO)
|
||||
info_cfg_option(WITH_IMAGE_CINEON)
|
||||
info_cfg_option(WITH_IMAGE_DDS)
|
||||
info_cfg_option(WITH_IMAGE_HDR)
|
||||
info_cfg_option(WITH_IMAGE_OPENEXR)
|
||||
info_cfg_option(WITH_IMAGE_OPENJPEG)
|
||||
info_cfg_option(WITH_IMAGE_TIFF)
|
||||
info_cfg_option(WITH_OPENIMAGEIO)
|
||||
|
||||
info_cfg_text("Audio:")
|
||||
info_cfg_option(WITH_CODEC_AVI)
|
||||
info_cfg_option(WITH_CODEC_FFMPEG)
|
||||
info_cfg_option(WITH_CODEC_SNDFILE)
|
||||
info_cfg_option(WITH_JACK)
|
||||
info_cfg_option(WITH_JACK_DYNLOAD)
|
||||
info_cfg_option(WITH_OPENAL)
|
||||
info_cfg_option(WITH_SDL)
|
||||
info_cfg_option(WITH_SDL_DYNLOAD)
|
||||
info_cfg_option(WITH_JACK)
|
||||
info_cfg_option(WITH_JACK_DYNLOAD)
|
||||
info_cfg_option(WITH_CODEC_AVI)
|
||||
info_cfg_option(WITH_CODEC_FFMPEG)
|
||||
info_cfg_option(WITH_CODEC_SNDFILE)
|
||||
|
||||
info_cfg_text("Compression:")
|
||||
info_cfg_option(WITH_LZMA)
|
||||
info_cfg_option(WITH_LZO)
|
||||
|
||||
info_cfg_text("Python:")
|
||||
if(APPLE)
|
||||
info_cfg_option(WITH_PYTHON_FRAMEWORK)
|
||||
endif()
|
||||
info_cfg_option(WITH_PYTHON_INSTALL)
|
||||
info_cfg_option(WITH_PYTHON_INSTALL_NUMPY)
|
||||
info_cfg_option(WITH_PYTHON_MODULE)
|
||||
info_cfg_option(WITH_PYTHON_SAFETY)
|
||||
if(APPLE)
|
||||
info_cfg_option(WITH_PYTHON_FRAMEWORK)
|
||||
endif()
|
||||
|
||||
info_cfg_text("Modifiers:")
|
||||
info_cfg_option(WITH_MOD_REMESH)
|
||||
info_cfg_option(WITH_MOD_FLUID)
|
||||
info_cfg_option(WITH_MOD_OCEANSIM)
|
||||
info_cfg_option(WITH_MOD_REMESH)
|
||||
|
||||
info_cfg_text("OpenGL:")
|
||||
info_cfg_option(WITH_GLEW_ES)
|
||||
info_cfg_option(WITH_GL_EGL)
|
||||
info_cfg_option(WITH_GL_PROFILE_ES20)
|
||||
if(WIN32)
|
||||
info_cfg_option(WITH_GL_ANGLE)
|
||||
endif()
|
||||
info_cfg_option(WITH_GL_EGL)
|
||||
info_cfg_option(WITH_GL_PROFILE_ES20)
|
||||
info_cfg_option(WITH_GLEW_ES)
|
||||
|
||||
info_cfg_text("")
|
||||
|
||||
|
29
GNUmakefile
29
GNUmakefile
@@ -81,19 +81,11 @@ Static Source Code Checking
|
||||
* check_splint: Run blenders source through splint (C only).
|
||||
* check_sparse: Run blenders source through sparse (C only).
|
||||
* check_smatch: Run blenders source through smatch (C only).
|
||||
* check_descriptions: Check for duplicate/invalid descriptions.
|
||||
|
||||
Spell Checkers
|
||||
|
||||
* check_spelling_c: Check for spelling errors (C/C++ only),
|
||||
* check_spelling_c: Check for spelling errors (C/C++ only).
|
||||
* check_spelling_c_qtc: Same as check_spelling_c but outputs QtCreator tasks format.
|
||||
* check_spelling_osl: Check for spelling errors (OSL only).
|
||||
* check_spelling_py: Check for spelling errors (Python only).
|
||||
|
||||
Note that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
|
||||
so re-running does not need to re-check unchanged files.
|
||||
|
||||
Example:
|
||||
make check_spelling_c CHECK_SPELLING_CACHE=../spelling_cache.data
|
||||
* check_descriptions: Check for duplicate/invalid descriptions.
|
||||
|
||||
Utilities
|
||||
Not associated with building Blender.
|
||||
@@ -465,17 +457,26 @@ check_spelling_c: .FORCE
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
--cache-file=$(CHECK_SPELLING_CACHE) \
|
||||
"$(BLENDER_DIR)/source" \
|
||||
"$(BLENDER_DIR)/intern/cycles" \
|
||||
"$(BLENDER_DIR)/intern/guardedalloc" \
|
||||
"$(BLENDER_DIR)/intern/ghost" \
|
||||
|
||||
check_spelling_c_qtc: .FORCE
|
||||
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
"$(BLENDER_DIR)/source" \
|
||||
"$(BLENDER_DIR)/intern/cycles" \
|
||||
"$(BLENDER_DIR)/intern/guardedalloc" \
|
||||
"$(BLENDER_DIR)/intern/ghost" \
|
||||
> \
|
||||
"$(BLENDER_DIR)/check_spelling_c.tasks"
|
||||
|
||||
check_spelling_osl: .FORCE
|
||||
cd "$(BUILD_DIR)" ;\
|
||||
PYTHONIOENCODING=utf_8 $(PYTHON) \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
--cache-file=$(CHECK_SPELLING_CACHE) \
|
||||
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
|
||||
|
||||
check_descriptions: .FORCE
|
||||
@@ -517,7 +518,7 @@ doc_py: .FORCE
|
||||
ASAN_OPTIONS=halt_on_error=0 \
|
||||
$(BLENDER_BIN) --background -noaudio --factory-startup \
|
||||
--python doc/python_api/sphinx_doc_gen.py
|
||||
sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
|
||||
|
||||
doc_doxy: .FORCE
|
||||
|
@@ -30,11 +30,11 @@
|
||||
# build_deps 2015 x64 / build_deps 2015 x86
|
||||
#
|
||||
# MAC OS X USAGE:
|
||||
# Install with homebrew: brew install autoconf automake bison cmake libtool pkg-config yasm
|
||||
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison
|
||||
# Run "make deps" from main Blender directory
|
||||
#
|
||||
# LINUX USAGE:
|
||||
# Install compiler cmake autoconf automake libtool yasm tcl
|
||||
# Install compiler cmake autoconf automake libtool yasm nasm tcl
|
||||
# Run "make deps" from main Blender directory
|
||||
#
|
||||
####################################################################################################
|
||||
@@ -75,8 +75,6 @@ include(cmake/llvm.cmake)
|
||||
include(cmake/clang.cmake)
|
||||
if(APPLE)
|
||||
include(cmake/openmp.cmake)
|
||||
endif()
|
||||
if(UNIX)
|
||||
include(cmake/nasm.cmake)
|
||||
endif()
|
||||
include(cmake/openimageio.cmake)
|
||||
@@ -85,13 +83,11 @@ include(cmake/flexbison.cmake)
|
||||
include(cmake/osl.cmake)
|
||||
include(cmake/tbb.cmake)
|
||||
include(cmake/openvdb.cmake)
|
||||
include(cmake/nanovdb.cmake)
|
||||
include(cmake/python.cmake)
|
||||
include(cmake/python_site_packages.cmake)
|
||||
include(cmake/package_python.cmake)
|
||||
include(cmake/numpy.cmake)
|
||||
include(cmake/usd.cmake)
|
||||
include(cmake/potrace.cmake)
|
||||
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
|
||||
include(cmake/boost.cmake)
|
||||
if(UNIX)
|
||||
@@ -118,6 +114,7 @@ if(WIN32)
|
||||
include(cmake/yamlcpp.cmake)
|
||||
# LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
|
||||
# include(cmake/lcms.cmake)
|
||||
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 OR ENABLE_MINGW64)
|
||||
|
@@ -26,11 +26,11 @@ if(UNIX)
|
||||
set(_required_software
|
||||
autoconf
|
||||
automake
|
||||
bison
|
||||
${_libtoolize_name}
|
||||
pkg-config
|
||||
tclsh
|
||||
nasm
|
||||
yasm
|
||||
tclsh
|
||||
bison
|
||||
)
|
||||
|
||||
foreach(_software ${_required_software})
|
||||
@@ -43,7 +43,7 @@ if(UNIX)
|
||||
|
||||
if(APPLE)
|
||||
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
|
||||
string(APPEND _software_missing " bison")
|
||||
set(_software_missing "${_software_missing} bison")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -54,10 +54,10 @@ if(UNIX)
|
||||
" ${_software_missing}\n"
|
||||
"\n"
|
||||
"On Debian and Ubuntu:\n"
|
||||
" apt install autoconf automake libtool yasm tcl\n"
|
||||
" apt install autoconf automake libtool yasm nasm tcl\n"
|
||||
"\n"
|
||||
"On macOS (with homebrew):\n"
|
||||
" brew install autoconf automake bison libtool pkg-config yasm\n"
|
||||
" brew install cmake autoconf automake libtool yasm nasm bison\n"
|
||||
"\n"
|
||||
"Other platforms:\n"
|
||||
" Install equivalent packages.\n")
|
||||
|
@@ -64,11 +64,3 @@ add_dependencies(
|
||||
external_clang
|
||||
ll
|
||||
)
|
||||
|
||||
# We currently do not build libxml2 on Windows.
|
||||
if(NOT WIN32)
|
||||
add_dependencies(
|
||||
external_clang
|
||||
external_xml2
|
||||
)
|
||||
endif()
|
||||
|
@@ -52,11 +52,6 @@ if(APPLE)
|
||||
--target-os=darwin
|
||||
--x86asmexe=${LIBDIR}/nasm/bin/nasm
|
||||
)
|
||||
elseif(UNIX)
|
||||
set(FFMPEG_EXTRA_FLAGS
|
||||
${FFMPEG_EXTRA_FLAGS}
|
||||
--x86asmexe=${LIBDIR}/nasm/bin/nasm
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_ffmpeg
|
||||
@@ -147,7 +142,7 @@ if(WIN32)
|
||||
external_zlib_mingw
|
||||
)
|
||||
endif()
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
add_dependencies(
|
||||
external_ffmpeg
|
||||
external_nasm
|
||||
|
@@ -20,31 +20,11 @@ set(GMP_EXTRA_ARGS -enable-cxx)
|
||||
|
||||
if(WIN32)
|
||||
# Shared for windows because static libs will drag in a libgcc dependency.
|
||||
set(GMP_OPTIONS --disable-static --enable-shared --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
|
||||
set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
|
||||
else()
|
||||
set(GMP_OPTIONS --enable-static --disable-shared )
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
||||
set(GMP_OPTIONS
|
||||
${GMP_OPTIONS}
|
||||
--disable-assembly
|
||||
)
|
||||
else()
|
||||
set(GMP_OPTIONS
|
||||
${GMP_OPTIONS}
|
||||
--with-pic
|
||||
)
|
||||
endif()
|
||||
elseif(UNIX)
|
||||
set(GMP_OPTIONS
|
||||
${GMP_OPTIONS}
|
||||
--with-pic
|
||||
--enable-fat
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_gmp
|
||||
URL ${GMP_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
|
@@ -26,7 +26,6 @@ endif()
|
||||
message("HARVEST_TARGET = ${HARVEST_TARGET}")
|
||||
|
||||
if(WIN32)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
add_custom_target(Harvest_Release_Results
|
||||
COMMAND # jpeg rename libfile + copy include
|
||||
@@ -147,7 +146,6 @@ harvest(opensubdiv/include opensubdiv/include "*.h")
|
||||
harvest(opensubdiv/lib opensubdiv/lib "*.a")
|
||||
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
|
||||
harvest(openvdb/lib openvdb/lib "*.a")
|
||||
harvest(nanovdb/nanovdb nanovdb/include/nanovdb "*.h")
|
||||
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
|
||||
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
|
||||
harvest(osl/bin osl/bin "oslc")
|
||||
@@ -179,8 +177,6 @@ harvest(xvidcore/lib ffmpeg/lib "*.a")
|
||||
harvest(usd/include usd/include "*.h")
|
||||
harvest(usd/lib/usd usd/lib/usd "*")
|
||||
harvest(usd/plugin usd/plugin "*")
|
||||
harvest(potrace/include potrace/include "*.h")
|
||||
harvest(potrace/lib potrace/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
|
@@ -43,7 +43,6 @@ set(ISPC_EXTRA_ARGS
|
||||
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
|
||||
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
|
||||
-DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
|
||||
-DCLANGPP_EXECUTABLE=${LIBDIR}/clang/bin/clang++
|
||||
-DISPC_INCLUDE_TESTS=Off
|
||||
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
|
||||
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
|
||||
|
@@ -59,4 +59,4 @@ else(WIN32)
|
||||
)
|
||||
|
||||
set(JPEG_LIBRARY libjpeg${LIBEXT})
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
@@ -1,54 +0,0 @@
|
||||
# ***** 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.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(NANOVDB_EXTRA_ARGS
|
||||
# NanoVDB is header-only, so only need the install target
|
||||
-DNANOVDB_BUILD_UNITTESTS=OFF
|
||||
-DNANOVDB_BUILD_EXAMPLES=OFF
|
||||
-DNANOVDB_BUILD_BENCHMARK=OFF
|
||||
-DNANOVDB_BUILD_DOCS=OFF
|
||||
-DNANOVDB_BUILD_TOOLS=OFF
|
||||
-DNANOVDB_CUDA_KEEP_PTX=OFF
|
||||
# Do not need to include any of the dependencies because of this
|
||||
-DNANOVDB_USE_OPENVDB=OFF
|
||||
-DNANOVDB_USE_OPENGL=OFF
|
||||
-DNANOVDB_USE_OPENCL=OFF
|
||||
-DNANOVDB_USE_CUDA=OFF
|
||||
-DNANOVDB_USE_TBB=OFF
|
||||
-DNANOVDB_USE_BLOSC=OFF
|
||||
-DNANOVDB_USE_ZLIB=OFF
|
||||
-DNANOVDB_USE_OPTIX=OFF
|
||||
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
|
||||
)
|
||||
|
||||
ExternalProject_Add(nanovdb
|
||||
URL ${NANOVDB_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH MD5=${NANOVDB_HASH}
|
||||
PREFIX ${BUILD_DIR}/nanovdb
|
||||
SOURCE_SUBDIR nanovdb
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/nanovdb ${DEFAULT_CMAKE_FLAGS} ${NANOVDB_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/nanovdb
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
ExternalProject_Add_Step(nanovdb after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/nanovdb/nanovdb ${HARVEST_TARGET}/nanovdb/include/nanovdb
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
@@ -96,7 +96,7 @@ add_dependencies(
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(openvdb after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include/openvdb ${HARVEST_TARGET}/openvdb/include/openvdb
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
|
||||
DEPENDEES install
|
||||
|
@@ -56,7 +56,7 @@ if(WIN32)
|
||||
if(MSVC_VERSION GREATER 1909)
|
||||
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
|
||||
endif()
|
||||
string(APPEND COMMON_MSVC_FLAGS " /bigobj")
|
||||
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
|
||||
if(WITH_OPTIMIZED_DEBUG)
|
||||
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
|
||||
else()
|
||||
|
@@ -1,38 +0,0 @@
|
||||
# ***** 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.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
set(POTRACE_EXTRA_ARGS
|
||||
)
|
||||
|
||||
if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
|
||||
ExternalProject_Add(external_potrace
|
||||
URL ${POTRACE_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH MD5=${POTRACE_HASH}
|
||||
PREFIX ${BUILD_DIR}/potrace
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_potrace.txt ${BUILD_DIR}/potrace/src/external_potrace/CMakeLists.txt
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/potrace ${DEFAULT_CMAKE_FLAGS} ${POTRACE_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/potrace
|
||||
)
|
||||
if(WIN32)
|
||||
ExternalProject_Add_Step(external_potrace after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/potrace ${HARVEST_TARGET}/potrace
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
@@ -39,5 +39,5 @@ if(WIN32)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
@@ -146,13 +146,9 @@ set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
|
||||
set(TBB_HASH 26263622e9187212ec240dcf01b66207)
|
||||
|
||||
set(OPENVDB_VERSION 7.0.0)
|
||||
set(OPENVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
||||
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
|
||||
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
|
||||
|
||||
set(NANOVDB_GIT_UID e62f7a0bf1e27397223c61ddeaaf57edf111b77f)
|
||||
set(NANOVDB_URI https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_GIT_UID}.tar.gz)
|
||||
set(NANOVDB_HASH 90919510bc6ccd630fedc56f748cb199)
|
||||
|
||||
set(IDNA_VERSION 2.9)
|
||||
set(CHARDET_VERSION 3.0.4)
|
||||
set(URLLIB3_VERSION 1.25.9)
|
||||
@@ -297,9 +293,9 @@ set(USD_VERSION 20.05)
|
||||
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
|
||||
set(USD_HASH 6d679e739e7f65725d9c029e37dda9fc)
|
||||
|
||||
set(OIDN_VERSION 1.2.3)
|
||||
set(OIDN_VERSION 1.2.1)
|
||||
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
|
||||
set(OIDN_HASH 1f11466c2c3efc27faba5ec7078d12b2)
|
||||
set(OIDN_HASH cbebc1a25eb6de62af3a59e943063608)
|
||||
|
||||
set(LIBGLU_VERSION 9.0.1)
|
||||
set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
|
||||
@@ -317,14 +313,10 @@ set(XR_OPENXR_SDK_VERSION 1.0.8)
|
||||
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
|
||||
set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
|
||||
|
||||
set(ISPC_VERSION v1.14.1)
|
||||
set(ISPC_VERSION v1.13.0)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
set(ISPC_HASH 968fbc8dfd16a60ba4e32d2e0e03ea7a)
|
||||
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
|
||||
|
||||
set(GMP_VERSION 6.2.0)
|
||||
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
|
||||
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
|
||||
|
||||
set(POTRACE_VERSION 1.16)
|
||||
set(POTRACE_URI http://potrace.sourceforge.net/download/${POTRACE_VERSION}/potrace-${POTRACE_VERSION}.tar.gz)
|
||||
set(POTRACE_HASH 5f0bd87ddd9a620b0c4e65652ef93d69)
|
||||
|
@@ -34,12 +34,6 @@ else()
|
||||
set(X264_CONFIGURE_ENV echo .)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(X264_CONFIGURE_ENV
|
||||
export AS=${LIBDIR}/nasm/bin/nasm
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_x264
|
||||
URL ${X264_URI}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
@@ -60,7 +54,7 @@ if(MSVC)
|
||||
set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
add_dependencies(
|
||||
external_x264
|
||||
external_nasm
|
||||
|
@@ -51,7 +51,7 @@ ARGS=$( \
|
||||
getopt \
|
||||
-o s:i:t:h \
|
||||
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
|
||||
with-all,with-opencollada,with-jack,with-embree,with-oidn,with-nanovdb,\
|
||||
with-all,with-opencollada,with-jack,with-embree,with-oidn,\
|
||||
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,\
|
||||
force-all,force-python,force-numpy,force-boost,force-tbb,\
|
||||
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
|
||||
@@ -151,9 +151,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--with-oidn
|
||||
Build and install the OpenImageDenoise libraries.
|
||||
|
||||
--with-nanovdb
|
||||
Build and install the NanoVDB branch of OpenVDB (instead of official release of OpenVDB).
|
||||
|
||||
--with-jack
|
||||
Install the jack libraries.
|
||||
|
||||
@@ -438,7 +435,7 @@ _with_built_openexr=false
|
||||
|
||||
OIIO_VERSION="2.1.15.0"
|
||||
OIIO_VERSION_SHORT="2.1"
|
||||
OIIO_VERSION_MIN="2.1.12"
|
||||
OIIO_VERSION_MIN="1.8"
|
||||
OIIO_VERSION_MAX="3.0"
|
||||
OIIO_FORCE_BUILD=false
|
||||
OIIO_FORCE_REBUILD=false
|
||||
@@ -477,7 +474,7 @@ OPENVDB_BLOSC_VERSION="1.5.0"
|
||||
OPENVDB_VERSION="7.0.0"
|
||||
OPENVDB_VERSION_SHORT="7.0"
|
||||
OPENVDB_VERSION_MIN="7.0"
|
||||
OPENVDB_VERSION_MAX="7.1"
|
||||
OPENVDB_VERSION_MAX="8.0"
|
||||
OPENVDB_FORCE_BUILD=false
|
||||
OPENVDB_FORCE_REBUILD=false
|
||||
OPENVDB_SKIP=false
|
||||
@@ -515,7 +512,7 @@ EMBREE_FORCE_BUILD=false
|
||||
EMBREE_FORCE_REBUILD=false
|
||||
EMBREE_SKIP=false
|
||||
|
||||
OIDN_VERSION="1.2.3"
|
||||
OIDN_VERSION="1.2.1"
|
||||
OIDN_VERSION_SHORT="1.2"
|
||||
OIDN_VERSION_MIN="1.2.0"
|
||||
OIDN_VERSION_MAX="1.3"
|
||||
@@ -523,7 +520,7 @@ OIDN_FORCE_BUILD=false
|
||||
OIDN_FORCE_REBUILD=false
|
||||
OIDN_SKIP=false
|
||||
|
||||
ISPC_VERSION="1.14.1"
|
||||
ISPC_VERSION="1.14.0"
|
||||
|
||||
FFMPEG_VERSION="4.2.3"
|
||||
FFMPEG_VERSION_SHORT="4.2"
|
||||
@@ -679,10 +676,6 @@ while true; do
|
||||
--with-oidn)
|
||||
WITH_OIDN=true; shift; continue
|
||||
;;
|
||||
--with-nanovdb)
|
||||
WITH_NANOVDB=true;
|
||||
shift; continue
|
||||
;;
|
||||
--with-jack)
|
||||
WITH_JACK=true; shift; continue;
|
||||
;;
|
||||
@@ -964,11 +957,6 @@ if [ "$WITH_ALL" = true -a "$OIDN_SKIP" = false ]; then
|
||||
fi
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
WITH_JACK=true
|
||||
WITH_NANOVDB=true
|
||||
fi
|
||||
|
||||
if [ "$WITH_NANOVDB" = true ]; then
|
||||
OPENVDB_FORCE_BUILD=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -1041,15 +1029,11 @@ OSD_SOURCE=( "https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${OSD
|
||||
|
||||
OPENVDB_USE_REPO=false
|
||||
OPENVDB_BLOSC_SOURCE=( "https://github.com/Blosc/c-blosc/archive/v${OPENVDB_BLOSC_VERSION}.tar.gz" )
|
||||
OPENVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )
|
||||
#~ OPENVDB_SOURCE_REPO=( "https://github.com/AcademySoftwareFoundation/openvdb.git" )
|
||||
OPENVDB_SOURCE=( "https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz" )
|
||||
#~ OPENVDB_SOURCE_REPO=( "https:///dreamworksanimation/openvdb.git" )
|
||||
#~ OPENVDB_SOURCE_REPO_UID="404659fffa659da075d1c9416e4fc939139a84ee"
|
||||
#~ OPENVDB_SOURCE_REPO_BRANCH="dev"
|
||||
|
||||
NANOVDB_USE_REPO=false
|
||||
NANOVDB_SOURCE_REPO_UID="e62f7a0bf1e27397223c61ddeaaf57edf111b77f"
|
||||
NANOVDB_SOURCE=( "https://github.com/AcademySoftwareFoundation/openvdb/archive/${NANOVDB_SOURCE_REPO_UID}.tar.gz" )
|
||||
|
||||
ALEMBIC_USE_REPO=false
|
||||
ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz" )
|
||||
# ALEMBIC_SOURCE_REPO=( "https://github.com/alembic/alembic.git" )
|
||||
@@ -1103,7 +1087,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
||||
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
|
||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
|
||||
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig.\""
|
||||
* libsdl2, libglew, [libgmp], [libglewmx], fontconfig.\""
|
||||
|
||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||
|
||||
@@ -1275,16 +1259,13 @@ version_match() {
|
||||
# ----------------------------------------------------------------------------
|
||||
# Generic compile helpers
|
||||
|
||||
prepare_inst() {
|
||||
prepare_opt() {
|
||||
INFO "Ensuring $INST exists and is writable by us"
|
||||
if [ ! $SUDO ]; then
|
||||
WARNING "--no-sudo enabled, might be impossible to create install dir..."
|
||||
fi
|
||||
|
||||
if [ ! -d $INST ]; then
|
||||
# Try to create normal user directory first to possibly avoid excessive
|
||||
# system operations
|
||||
mkdir -p $INST || $SUDO mkdir -p $INST
|
||||
$SUDO mkdir -p $INST
|
||||
fi
|
||||
|
||||
if [ ! -w $INST ]; then
|
||||
@@ -1385,7 +1366,7 @@ compile_Python() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_python
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -1471,7 +1452,7 @@ compile_Numpy() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_numpy
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -1560,7 +1541,7 @@ compile_Boost() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_boost
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading Boost-$BOOST_VERSION"
|
||||
@@ -1654,7 +1635,7 @@ compile_TBB() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_tbb
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
|
||||
@@ -1771,7 +1752,7 @@ compile_OCIO() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ocio
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading OpenColorIO-$OCIO_VERSION"
|
||||
@@ -1903,7 +1884,7 @@ compile_OPENEXR() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_openexr
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading OpenEXR-$OPENEXR_VERSION"
|
||||
@@ -2029,7 +2010,7 @@ compile_OIIO() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_oiio
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2184,7 +2165,7 @@ compile_LLVM() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_llvm
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src -o true ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2294,7 +2275,7 @@ compile_OSL() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_osl
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2438,7 +2419,7 @@ compile_OSD() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_osd
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2556,7 +2537,7 @@ compile_BLOSC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_blosc
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading Blosc-$OPENVDB_BLOSC_VERSION"
|
||||
@@ -2610,115 +2591,11 @@ compile_BLOSC() {
|
||||
# ----------------------------------------------------------------------------
|
||||
# Build OpenVDB
|
||||
|
||||
_init_nanovdb() {
|
||||
_src=$SRC/openvdb-$OPENVDB_VERSION/nanovdb
|
||||
_inst=$INST/nanovdb-$OPENVDB_VERSION_SHORT
|
||||
_inst_shortcut=$INST/nanovdb
|
||||
}
|
||||
|
||||
_update_deps_nanovdb() {
|
||||
:
|
||||
}
|
||||
|
||||
clean_nanovdb() {
|
||||
_init_nanovdb
|
||||
if [ -d $_inst ]; then
|
||||
_update_deps_nanovdb
|
||||
fi
|
||||
_git=true # Mere trick to prevent clean from removing $_src...
|
||||
_clean
|
||||
}
|
||||
|
||||
install_NanoVDB() {
|
||||
# To be changed each time we make edits that would modify the compiled results!
|
||||
nanovdb_magic=1
|
||||
_init_nanovdb
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check nanovdb-$OPENVDB_VERSION $nanovdb_magic
|
||||
if [ $? -eq 1 ]; then
|
||||
clean_nanovdb
|
||||
fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Installing NanoVDB v$OPENVDB_VERSION"
|
||||
_is_building=true
|
||||
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_nanovdb
|
||||
|
||||
prepare_inst
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
ERROR "NanoVDB not found in openvdb-$OPENVDB_VERSION ($_src), exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
rm -rf build
|
||||
fi
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
|
||||
# NanoVDB is header-only, so only need the install target
|
||||
cmake_d="$cmake_d -D NANOVDB_BUILD_UNITTESTS=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_BUILD_EXAMPLES=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_BUILD_BENCHMARK=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_BUILD_DOCS=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_BUILD_TOOLS=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_CUDA_KEEP_PTX=OFF"
|
||||
|
||||
# Do not need to include any of the dependencies because of this
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_OPENVDB=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_OPENGL=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_OPENCL=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_CUDA=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_TBB=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_BLOSC=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_ZLIB=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_USE_OPTIX=OFF"
|
||||
cmake_d="$cmake_d -D NANOVDB_ALLOW_FETCHCONTENT=OFF"
|
||||
|
||||
cmake $cmake_d $_src
|
||||
|
||||
make -j$THREADS install
|
||||
make clean
|
||||
|
||||
#~ mkdir -p $_inst
|
||||
#~ cp -r $_src/include $_inst/include
|
||||
|
||||
if [ -d $_inst ]; then
|
||||
_create_inst_shortcut
|
||||
else
|
||||
ERROR "NanoVDB-v$OPENVDB_VERSION failed to install, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
magic_compile_set nanovdb-$OPENVDB_VERSION $nanovdb_magic
|
||||
|
||||
cd $CWD
|
||||
INFO "Done compiling NanoVDB-v$OPENVDB_VERSION!"
|
||||
_is_building=false
|
||||
else
|
||||
INFO "Own NanoVDB-v$OPENVDB_VERSION is up to date, nothing to do!"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
_init_openvdb() {
|
||||
_src=$SRC/openvdb-$OPENVDB_VERSION
|
||||
_git=false
|
||||
_inst=$INST/openvdb-$OPENVDB_VERSION_SHORT
|
||||
_inst_shortcut=$INST/openvdb
|
||||
|
||||
_openvdb_source=$OPENVDB_SOURCE
|
||||
if [ "$WITH_NANOVDB" = true ]; then
|
||||
_openvdb_source=$NANOVDB_SOURCE
|
||||
fi
|
||||
}
|
||||
|
||||
_update_deps_openvdb() {
|
||||
@@ -2743,7 +2620,7 @@ compile_OPENVDB() {
|
||||
PRINT ""
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
openvdb_magic=2
|
||||
openvdb_magic=1
|
||||
_init_openvdb
|
||||
|
||||
# Clean install if needed!
|
||||
@@ -2753,25 +2630,20 @@ compile_OPENVDB() {
|
||||
fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Building OpenVDB-$OPENVDB_VERSION (with NanoVDB: $WITH_NANOVDB)"
|
||||
INFO "Building OpenVDB-$OPENVDB_VERSION"
|
||||
_is_building=true
|
||||
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_openvdb
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
if [ ! -d $_src -o true ]; then
|
||||
mkdir -p $SRC
|
||||
download _openvdb_source[@] "$_src.tar.gz"
|
||||
download OPENVDB_SOURCE[@] "$_src.tar.gz"
|
||||
|
||||
INFO "Unpacking OpenVDB-$OPENVDB_VERSION"
|
||||
if [ "$WITH_NANOVDB" = true ]; then
|
||||
tar -C $SRC --transform "s,(.*/?)openvdb-$NANOVDB_SOURCE_REPO_UID[^/]*(.*),\1openvdb-$OPENVDB_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
else
|
||||
tar -C $SRC -xf $_src.tar.gz
|
||||
fi
|
||||
tar -C $SRC -xf $_src.tar.gz
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
@@ -2785,40 +2657,33 @@ compile_OPENVDB() {
|
||||
#~ git reset --hard
|
||||
#~ fi
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
rm -rf build
|
||||
fi
|
||||
mkdir build
|
||||
cd build
|
||||
# Source builds here
|
||||
cd openvdb
|
||||
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D USE_STATIC_DEPENDENCIES=OFF"
|
||||
cmake_d="$cmake_d -D OPENVDB_BUILD_BINARIES=OFF"
|
||||
make_d="DESTDIR=$_inst"
|
||||
make_d="$make_d HDSO=/usr"
|
||||
|
||||
if [ -d $INST/boost ]; then
|
||||
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost"
|
||||
cmake_d="$cmake_d -D Boost_USE_MULTITHREADED=ON"
|
||||
cmake_d="$cmake_d -D Boost_NO_SYSTEM_PATHS=ON"
|
||||
cmake_d="$cmake_d -D Boost_NO_BOOST_CMAKE=ON"
|
||||
make_d="$make_d BOOST_INCL_DIR=$INST/boost/include BOOST_LIB_DIR=$INST/boost/lib"
|
||||
fi
|
||||
if [ -d $INST/tbb ]; then
|
||||
cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
|
||||
make_d="$make_d TBB_ROOT=$INST/tbb TBB_USE_STATIC_LIBS=OFF"
|
||||
fi
|
||||
|
||||
if [ "$_with_built_openexr" = true ]; then
|
||||
cmake_d="$cmake_d -D IlmBase_ROOT=$INST/openexr"
|
||||
cmake_d="$cmake_d -D OpenEXR_ROOT=$INST/openexr"
|
||||
make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib"
|
||||
make_d="$make_d EXR_INCL_DIR=$INST/openexr/include EXR_LIB_DIR=$INST/openexr/lib"
|
||||
INFO "ILMBASE_HOME=$INST/openexr"
|
||||
fi
|
||||
|
||||
if [ -d $INST/blosc ]; then
|
||||
cmake_d="$cmake_d -D Blosc_ROOT=$INST/blosc"
|
||||
make_d="$make_d BLOSC_INCL_DIR=$INST/blosc/include BLOSC_LIB_DIR=$INST/blosc/lib"
|
||||
fi
|
||||
|
||||
cmake $cmake_d ..
|
||||
|
||||
make -j$THREADS install
|
||||
# Build without log4cplus, glfw, python module & docs
|
||||
make_d="$make_d LOG4CPLUS_INCL_DIR= GLFW_INCL_DIR= PYTHON_VERSION= DOXYGEN="
|
||||
|
||||
make -j$THREADS lib $make_d install
|
||||
make clean
|
||||
|
||||
if [ -d $_inst ]; then
|
||||
@@ -2839,10 +2704,6 @@ compile_OPENVDB() {
|
||||
fi
|
||||
|
||||
run_ldconfig "openvdb"
|
||||
|
||||
if [ "$WITH_NANOVDB" = true ]; then
|
||||
install_NanoVDB
|
||||
fi
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -2890,7 +2751,7 @@ compile_ALEMBIC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_alembic
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -2995,7 +2856,7 @@ compile_USD() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_usd
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3094,7 +2955,7 @@ compile_OpenCOLLADA() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_collada
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3200,7 +3061,7 @@ compile_Embree() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_embree
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3310,7 +3171,7 @@ install_ISPC() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ispc
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3389,7 +3250,7 @@ compile_OIDN() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_oidn
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3499,7 +3360,7 @@ compile_FFmpeg() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_ffmpeg
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading ffmpeg-$FFMPEG_VERSION"
|
||||
@@ -3628,7 +3489,7 @@ compile_XR_OpenXR_SDK() {
|
||||
# Rebuild dependencies as well!
|
||||
_update_deps_xr_openxr_sdk
|
||||
|
||||
prepare_inst
|
||||
prepare_opt
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
@@ -3798,7 +3659,7 @@ install_DEB() {
|
||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
|
||||
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
|
||||
libgmp-dev libpugixml-dev libpotrace-dev"
|
||||
libgmp-dev"
|
||||
# libglewmx-dev (broken in deb testing currently...)
|
||||
|
||||
VORBIS_USE=true
|
||||
@@ -4094,7 +3955,7 @@ install_DEB() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_DEB llvm-dev clang
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_DEB llvm-dev`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
@@ -4464,8 +4325,7 @@ install_RPM() {
|
||||
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
|
||||
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
|
||||
gmp-devel pugixml-devel potrace-devel"
|
||||
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel gmp-devel"
|
||||
|
||||
OPENJPEG_USE=true
|
||||
VORBIS_USE=true
|
||||
@@ -4743,7 +4603,7 @@ install_RPM() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_RPM llvm-devel $CLANG_DEV
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_RPM llvm-devel`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
@@ -5041,7 +4901,7 @@ install_ARCH() {
|
||||
_packages="$BASE_DEVEL git cmake fontconfig \
|
||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml"
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp"
|
||||
|
||||
OPENJPEG_USE=true
|
||||
VORBIS_USE=true
|
||||
@@ -5265,7 +5125,7 @@ install_ARCH() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_ARCH llvm clang
|
||||
have_llvm=true
|
||||
LLVM_VERSION=`llvm-config --version`
|
||||
LLVM_VERSION=`get_package_version_ARCH llvm`
|
||||
LLVM_VERSION_FOUND=$LLVM_VERSION
|
||||
clean_LLVM
|
||||
else
|
||||
@@ -5827,13 +5687,6 @@ print_info() {
|
||||
PRINT " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
if [ -d $INST/nanovdb ]; then
|
||||
_1="-D WITH_NANOVDB=ON"
|
||||
_2="-D NANOVDB_ROOT_DIR=$INST/nanovdb"
|
||||
PRINT " $_1"
|
||||
PRINT " $_2"
|
||||
_buildargs="$_buildargs $_1 $_2"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$WITH_OPENCOLLADA" = true ]; then
|
||||
|
@@ -1,54 +0,0 @@
|
||||
project(potrace)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(src/include)
|
||||
|
||||
set(SOURCES
|
||||
src/backend_dxf.c
|
||||
src/backend_eps.c
|
||||
src/backend_geojson.c
|
||||
src/backend_pdf.c
|
||||
src/backend_pgm.c
|
||||
src/backend_svg.c
|
||||
src/backend_xfig.c
|
||||
src/bbox.c
|
||||
src/bitmap_io.c
|
||||
src/curve.c
|
||||
src/decompose.c
|
||||
src/flate.c
|
||||
src/greymap.c
|
||||
src/lzw.c
|
||||
src/potracelib.c
|
||||
src/progress_bar.c
|
||||
src/render.c
|
||||
src/trace.c
|
||||
src/trans.c
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
src/potracelib.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(/D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
||||
add_definitions(/DPOTRACE="POTrace")
|
||||
add_definitions(/DVERSION="Blender")
|
||||
add_definitions(/DHAVE_INTTYPES_H)
|
||||
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
LIBRARY_OUTPUT_NAME "${PROJECT_NAME}"
|
||||
PUBLIC_HEADER "${HEADERS}"
|
||||
)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include
|
||||
)
|
||||
|
@@ -19,16 +19,16 @@ diff -Naur orig/CMakeLists.txt external_ispc/CMakeLists.txt
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
- ${LLVM_INCLUDE_DIRS}
|
||||
+ ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
|
||||
${GENX_DEPS_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
# Compile options
|
||||
diff -Naur orig/cmake/GenerateBuiltins.cmake.txt external_ispc/cmake/GenerateBuiltins.cmake.txt
|
||||
+++ orig/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
|
||||
+++ external_ispc/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
|
||||
@@ -97,6 +97,8 @@
|
||||
|
||||
if ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "x86")
|
||||
set(target_arch "i686")
|
||||
set(target_arch "i386")
|
||||
+ # Blender: disable 32bit due to build issues on Linux and being unnecessary.
|
||||
+ set(SKIP ON)
|
||||
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")
|
||||
|
@@ -24,7 +24,6 @@ import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def is_tool(name):
|
||||
"""Check whether `name` is on PATH and marked as executable."""
|
||||
|
||||
@@ -33,7 +32,6 @@ def is_tool(name):
|
||||
|
||||
return which(name) is not None
|
||||
|
||||
|
||||
class Builder:
|
||||
def __init__(self, name, branch, codesign):
|
||||
self.name = name
|
||||
@@ -50,23 +48,22 @@ class Builder:
|
||||
# Detect platform
|
||||
if name.startswith('mac'):
|
||||
self.platform = 'mac'
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
elif name.startswith('linux'):
|
||||
self.platform = 'linux'
|
||||
if is_tool('scl'):
|
||||
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
|
||||
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
|
||||
else:
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
elif name.startswith('win'):
|
||||
self.platform = 'win'
|
||||
self.command_prefix = []
|
||||
self.command_prefix = []
|
||||
else:
|
||||
raise ValueError('Unkonw platform for builder ' + self.platform)
|
||||
|
||||
# Always 64 bit now
|
||||
self.bits = 64
|
||||
|
||||
|
||||
def create_builder_from_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('builder_name')
|
||||
@@ -107,7 +104,7 @@ class VersionInfo:
|
||||
|
||||
def _parse_header_file(self, filename, define):
|
||||
import re
|
||||
regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
|
||||
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
|
||||
with open(filename, "r") as file:
|
||||
for l in file:
|
||||
match = regex.match(l)
|
||||
|
@@ -102,7 +102,7 @@ class ArchiveWithIndicator:
|
||||
|
||||
# Wait for until archive is fully stored.
|
||||
actual_archive_size = self.archive_filepath.stat().st_size
|
||||
if actual_archive_size != expected_archive_size:
|
||||
if actual_archive_size != expected_archive_size:
|
||||
print('Partial/invalid archive size (expected '
|
||||
f'{expected_archive_size} got {actual_archive_size})')
|
||||
return False
|
||||
|
@@ -23,7 +23,6 @@ import shutil
|
||||
|
||||
import buildbot_utils
|
||||
|
||||
|
||||
def get_cmake_options(builder):
|
||||
codesign_script = os.path.join(
|
||||
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
|
||||
@@ -45,24 +44,11 @@ def get_cmake_options(builder):
|
||||
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
|
||||
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
|
||||
|
||||
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture
|
||||
if builder.platform == 'win':
|
||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1')
|
||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe')
|
||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1')
|
||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe')
|
||||
elif builder.platform == 'linux':
|
||||
options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.1')
|
||||
options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.1/bin/nvcc')
|
||||
options.append('-DCUDA11_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-11.1')
|
||||
options.append('-DCUDA11_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-11.1/bin/nvcc')
|
||||
|
||||
options.append("-C" + os.path.join(builder.blender_dir, config_file))
|
||||
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))
|
||||
|
||||
return options
|
||||
|
||||
|
||||
def update_git(builder):
|
||||
# Do extra git fetch because not all platform/git/buildbot combinations
|
||||
# update the origin remote, causing buildinfo to detect local changes.
|
||||
@@ -72,7 +58,6 @@ def update_git(builder):
|
||||
command = ['git', 'fetch', '--all']
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
def clean_directories(builder):
|
||||
# Make sure no garbage remained from the previous run
|
||||
if os.path.isdir(builder.install_dir):
|
||||
@@ -88,7 +73,6 @@ def clean_directories(builder):
|
||||
print("Removing {}" . format(buildinfo))
|
||||
os.remove(full_path)
|
||||
|
||||
|
||||
def cmake_configure(builder):
|
||||
# CMake configuration
|
||||
os.chdir(builder.build_dir)
|
||||
@@ -103,7 +87,6 @@ def cmake_configure(builder):
|
||||
command = ['cmake', builder.blender_dir] + cmake_options
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
def cmake_build(builder):
|
||||
# CMake build
|
||||
os.chdir(builder.build_dir)
|
||||
@@ -126,7 +109,6 @@ def cmake_build(builder):
|
||||
print("CMake build:")
|
||||
buildbot_utils.call(builder.command_prefix + command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = buildbot_utils.create_builder_from_arguments()
|
||||
update_git(builder)
|
||||
|
@@ -29,20 +29,18 @@ from pathlib import Path
|
||||
|
||||
import buildbot_utils
|
||||
|
||||
|
||||
def get_package_name(builder, platform=None):
|
||||
info = buildbot_utils.VersionInfo(builder)
|
||||
|
||||
package_name = 'blender-' + info.full_version
|
||||
if platform:
|
||||
package_name += '-' + platform
|
||||
package_name += '-' + platform
|
||||
if not (builder.branch == 'master' or builder.is_release_branch):
|
||||
if info.is_development_build:
|
||||
package_name = builder.branch + "-" + package_name
|
||||
|
||||
return package_name
|
||||
|
||||
|
||||
def sign_file_or_directory(path):
|
||||
from codesign.simple_code_signer import SimpleCodeSigner
|
||||
code_signer = SimpleCodeSigner()
|
||||
@@ -66,7 +64,6 @@ def create_buildbot_upload_zip(builder, package_files):
|
||||
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def create_tar_xz(src, dest, package_name):
|
||||
# One extra to remove leading os.sep when cleaning root for package_root
|
||||
ln = len(src) + 1
|
||||
@@ -94,7 +91,6 @@ def create_tar_xz(src, dest, package_name):
|
||||
package.add(entry[0], entry[1], recursive=False, filter=_fakeroot)
|
||||
package.close()
|
||||
|
||||
|
||||
def cleanup_files(dirpath, extension):
|
||||
for f in os.listdir(dirpath):
|
||||
filepath = os.path.join(dirpath, f)
|
||||
@@ -175,11 +171,7 @@ def pack_linux(builder):
|
||||
|
||||
print("Stripping python...")
|
||||
py_target = os.path.join(builder.install_dir, info.short_version)
|
||||
buildbot_utils.call(
|
||||
builder.command_prefix + [
|
||||
'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
|
||||
],
|
||||
)
|
||||
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
|
||||
|
||||
# Construct package name
|
||||
platform_name = 'linux64'
|
||||
|
@@ -22,21 +22,18 @@ import buildbot_utils
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def get_ctest_arguments(builder):
|
||||
args = ['--output-on-failure']
|
||||
if builder.platform == 'win':
|
||||
args += ['-C', 'Release']
|
||||
return args
|
||||
|
||||
|
||||
def test(builder):
|
||||
os.chdir(builder.build_dir)
|
||||
|
||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
||||
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
|
||||
buildbot_utils.call(command)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
builder = buildbot_utils.create_builder_from_arguments()
|
||||
test(builder)
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_IN
|
||||
IF(ALEMBIC_FOUND)
|
||||
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
|
||||
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(ALEMBIC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ALEMBIC_INCLUDE_DIR
|
||||
|
@@ -30,7 +30,7 @@ SET(_audaspace_SEARCH_DIRS
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(AUDASPACE_PKGCONF audaspace)
|
||||
ENDIF()
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
# Include dir
|
||||
FIND_PATH(AUDASPACE_INCLUDE_DIR
|
||||
@@ -88,17 +88,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Audaspace_Py DEFAULT_MSG AUDASPACE_PY_LIBRAR
|
||||
IF(AUDASPACE_FOUND)
|
||||
SET(AUDASPACE_LIBRARIES ${AUDASPACE_LIBRARY})
|
||||
SET(AUDASPACE_INCLUDE_DIRS ${AUDASPACE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_FOUND)
|
||||
|
||||
IF(AUDASPACE_C_FOUND)
|
||||
SET(AUDASPACE_C_LIBRARIES ${AUDASPACE_C_LIBRARY})
|
||||
SET(AUDASPACE_C_INCLUDE_DIRS ${AUDASPACE_C_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_C_FOUND)
|
||||
|
||||
IF(AUDASPACE_PY_FOUND)
|
||||
SET(AUDASPACE_PY_LIBRARIES ${AUDASPACE_PY_LIBRARY})
|
||||
SET(AUDASPACE_PY_INCLUDE_DIRS ${AUDASPACE_PY_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(AUDASPACE_PY_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
AUDASPACE_LIBRARY
|
||||
|
@@ -43,10 +43,7 @@ find_program(CLANG_TIDY_EXECUTABLE
|
||||
${_clang_tidy_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
if(CLANG_TIDY_EXECUTABLE AND NOT EXISTS ${CLANG_TIDY_EXECUTABLE})
|
||||
message(WARNING "Cached or directly specified Clang-Tidy executable does not exist.")
|
||||
set(CLANG_TIDY_FOUND FALSE)
|
||||
elseif(CLANG_TIDY_EXECUTABLE)
|
||||
if(CLANG_TIDY_EXECUTABLE)
|
||||
# Mark clang-tidy as found.
|
||||
set(CLANG_TIDY_FOUND TRUE)
|
||||
|
||||
|
@@ -41,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
|
||||
|
||||
IF(EIGEN3_FOUND)
|
||||
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(EIGEN3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EIGEN3_INCLUDE_DIR
|
||||
|
@@ -37,9 +37,9 @@ FIND_PATH(EMBREE_INCLUDE_DIR
|
||||
|
||||
SET(_embree_FIND_COMPONENTS
|
||||
embree3
|
||||
embree_sse42
|
||||
embree_avx
|
||||
embree_avx2
|
||||
embree_sse42
|
||||
lexers
|
||||
math
|
||||
simd
|
||||
@@ -80,7 +80,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Embree DEFAULT_MSG
|
||||
IF(EMBREE_FOUND)
|
||||
SET(EMBREE_LIBRARIES ${_embree_LIBRARIES})
|
||||
SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(EMBREE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EMBREE_INCLUDE_DIR
|
||||
|
@@ -1,83 +0,0 @@
|
||||
# - Find FFmpeg library and includes.
|
||||
# Set FFMPEG_FIND_COMPONENTS to the canonical names of the libraries
|
||||
# before using the module.
|
||||
# This module defines
|
||||
# FFMPEG_INCLUDE_DIRS, where to find libavcodec/ac3_parser.h.
|
||||
# FFMPEG_LIBRARIES, libraries to link against to use FFmpeg.
|
||||
# FFMPEG_ROOT_DIR, The base directory to search for FFmpeg.
|
||||
# This can also be an environment variable.
|
||||
# FFMPEG_FOUND, If false, do not try to use FFmpeg.
|
||||
# FFMPEG_<COMPONENT>_LIBRARY, the given individual component libraries.
|
||||
#=============================================================================
|
||||
# Copyright 2020 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If FFMPEG_ROOT_DIR was defined in the environment, use it.
|
||||
if(NOT FFMPEG_ROOT_DIR AND NOT $ENV{FFMPEG_ROOT_DIR} STREQUAL "")
|
||||
set(FFMPEG_ROOT_DIR $ENV{FFMPEG_ROOT_DIR})
|
||||
endif()
|
||||
|
||||
set(_ffmpeg_SEARCH_DIRS
|
||||
${FFMPEG_ROOT_DIR}
|
||||
/opt/lib/ffmpeg
|
||||
)
|
||||
|
||||
if(NOT FFMPEG_FIND_COMPONENTS)
|
||||
set(FFMPEG_FIND_COMPONENTS
|
||||
# List taken from http://ffmpeg.org/download.html#build-mac
|
||||
avcodec
|
||||
avdevice
|
||||
avfilter
|
||||
avformat
|
||||
avutil
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path(_ffmpeg_INCLUDE_DIR
|
||||
NAMES
|
||||
libavcodec/ac3_parser.h
|
||||
HINTS
|
||||
${_ffmpeg_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
set(_ffmpeg_LIBRARIES)
|
||||
foreach(_component ${FFMPEG_FIND_COMPONENTS})
|
||||
string(TOUPPER ${_component} _upper_COMPONENT)
|
||||
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${_upper_COMPONENT}
|
||||
HINTS
|
||||
${LIBDIR}/ffmpeg
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
if(NOT FFMPEG_${_upper_COMPONENT}_LIBRARY)
|
||||
message(WARNING "Could NOT find FFmpeg ${_upper_COMPONENT}.")
|
||||
endif()
|
||||
list(APPEND _ffmpeg_LIBRARIES ${FFMPEG_${_upper_COMPONENT}_LIBRARY})
|
||||
mark_as_advanced(FFMPEG_${_upper_COMPONENT}_LIBRARY)
|
||||
endforeach()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set FFMPEG_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FFmpeg DEFAULT_MSG
|
||||
_ffmpeg_LIBRARIES _ffmpeg_INCLUDE_DIR)
|
||||
|
||||
IF(FFMPEG_FOUND)
|
||||
set(FFMPEG_LIBRARIES ${_ffmpeg_LIBRARIES})
|
||||
set(FFMPEG_INCLUDE_DIRS ${_ffmpeg_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
|
||||
mark_as_advanced(
|
||||
FFMPEG_INCLUDE_DIR
|
||||
)
|
||||
|
||||
unset(_ffmpeg_SEARCH_DIRS)
|
||||
unset(_ffmpeg_LIBRARIES)
|
||||
unset(_ffmpeg_INCLUDE_DIR)
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG
|
||||
IF(FFTW3_FOUND)
|
||||
SET(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
|
||||
SET(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(FFTW3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
FFTW3_INCLUDE_DIR
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
|
||||
|
||||
IF(GLEW_FOUND)
|
||||
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(GLEW_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
|
@@ -82,7 +82,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
|
||||
IF(GMP_FOUND)
|
||||
SET(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
|
||||
SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(GMP_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GMP_INCLUDE_DIR
|
||||
|
@@ -124,7 +124,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Icu DEFAULT_MSG
|
||||
IF(ICU_FOUND)
|
||||
SET(ICU_LIBRARIES ${ICU_LIBRARY_DATA} ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_IO} ${ICU_LIBRARY_LE} ${ICU_LIBRARY_LX} ${ICU_LIBRARY_TU} ${ICU_LIBRARY_UC})
|
||||
SET(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(ICU_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ICU_INCLUDE_DIR
|
||||
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG
|
||||
IF(JACK_FOUND)
|
||||
SET(JACK_LIBRARIES ${JACK_LIBRARY})
|
||||
SET(JACK_INCLUDE_DIRS ${JACK_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(JACK_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JACK_INCLUDE_DIR
|
||||
|
@@ -64,7 +64,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
|
||||
IF(JEMALLOC_FOUND)
|
||||
SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
|
||||
SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(JEMALLOC_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
JEMALLOC_INCLUDE_DIR
|
||||
|
@@ -34,10 +34,6 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --includedir
|
||||
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT DEFINED LLVM_VERSION)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --version
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
@@ -84,7 +80,7 @@ if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
||||
endif()
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LLVM_FOUND to TRUE if
|
||||
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
|
||||
IF(LZO_FOUND)
|
||||
SET(LZO_LIBRARIES ${LZO_LIBRARY})
|
||||
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(LZO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LZO_INCLUDE_DIR
|
||||
|
@@ -1,49 +0,0 @@
|
||||
# - Find NanoVDB library
|
||||
# Find the native NanoVDB includes and library
|
||||
# This module defines
|
||||
# NANOVDB_INCLUDE_DIRS, where to find nanovdb.h, Set when
|
||||
# NANOVDB_INCLUDE_DIR is found.
|
||||
# NANOVDB_ROOT_DIR, The base directory to search for NanoVDB.
|
||||
# This can also be an environment variable.
|
||||
# NANOVDB_FOUND, If false, do not try to use NanoVDB.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2020 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If NANOVDB_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT NANOVDB_ROOT_DIR AND NOT $ENV{NANOVDB_ROOT_DIR} STREQUAL "")
|
||||
SET(NANOVDB_ROOT_DIR $ENV{NANOVDB_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_nanovdb_SEARCH_DIRS
|
||||
${NANOVDB_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(NANOVDB_INCLUDE_DIR
|
||||
NAMES
|
||||
nanovdb/NanoVDB.h
|
||||
HINTS
|
||||
${_nanovdb_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set NANOVDB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NanoVDB DEFAULT_MSG
|
||||
NANOVDB_INCLUDE_DIR)
|
||||
|
||||
IF(NANOVDB_FOUND)
|
||||
SET(NANOVDB_INCLUDE_DIRS ${NANOVDB_INCLUDE_DIR})
|
||||
ENDIF(NANOVDB_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
NANOVDB_INCLUDE_DIR
|
||||
)
|
||||
|
||||
UNSET(_nanovdb_SEARCH_DIRS)
|
@@ -95,7 +95,7 @@ IF(OSL_FOUND)
|
||||
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
|
||||
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
|
||||
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
|
||||
ENDIF()
|
||||
ENDIF(OSL_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OSL_INCLUDE_DIR
|
||||
|
@@ -129,7 +129,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA DEFAULT_MSG
|
||||
IF(OPENCOLLADA_FOUND)
|
||||
SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
|
||||
SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
|
||||
ENDIF()
|
||||
ENDIF(OPENCOLLADA_FOUND)
|
||||
|
||||
UNSET(COMPONENT)
|
||||
UNSET(UPPERCOMPONENT)
|
||||
|
@@ -70,7 +70,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG
|
||||
IF(OPENCOLORIO_FOUND)
|
||||
SET(OPENCOLORIO_LIBRARIES ${_opencolorio_LIBRARIES})
|
||||
SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENCOLORIO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENCOLORIO_INCLUDE_DIR
|
||||
|
@@ -65,7 +65,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG
|
||||
IF(OPENJPEG_FOUND)
|
||||
SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
|
||||
SET(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENJPEG_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENJPEG_INCLUDE_DIR
|
||||
|
@@ -90,7 +90,7 @@ IF(OPENSUBDIV_FOUND)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("cudaEvaluator.h" OPENSUBDIV_HAS_CUDA)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glXFBEvaluator.h" OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK)
|
||||
OPENSUBDIV_CHECK_CONTROLLER("glComputeEvaluator.h" OPENSUBDIV_HAS_GLSL_COMPUTE)
|
||||
ENDIF()
|
||||
ENDIF(OPENSUBDIV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENSUBDIV_INCLUDE_DIR
|
||||
|
@@ -55,7 +55,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB DEFAULT_MSG
|
||||
IF(OPENVDB_FOUND)
|
||||
SET(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
|
||||
SET(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPENVDB_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENVDB_INCLUDE_DIR
|
||||
|
@@ -41,7 +41,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX DEFAULT_MSG
|
||||
|
||||
IF(OPTIX_FOUND)
|
||||
SET(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(OPTIX_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPTIX_INCLUDE_DIR
|
||||
|
@@ -57,7 +57,7 @@ SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
|
||||
|
||||
IF(PCRE_FOUND)
|
||||
SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(PCRE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
PCRE_INCLUDE_DIR
|
||||
|
@@ -1,65 +0,0 @@
|
||||
# - Find potrace library
|
||||
# Find the potrace include and library
|
||||
# This module defines
|
||||
# POTRACE_INCLUDE_DIRS, where to find potracelib.h, Set when
|
||||
# POTRACE is found.
|
||||
# POTRACE_LIBRARIES, libraries to link against to use POTRACE.
|
||||
# POTRACE_ROOT_DIR, The base directory to search for POTRACE.
|
||||
# This can also be an environment variable.
|
||||
# POTRACE_FOUND, If false, do not try to use POTRACE.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# POTRACE_LIBRARY, where to find the POTRACE library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2020 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD 3-Clause License,
|
||||
# see accompanying file BSD-3-Clause-license.txt for details.
|
||||
#=============================================================================
|
||||
|
||||
# If POTRACE_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT POTRACE_ROOT_DIR AND NOT $ENV{POTRACE_ROOT_DIR} STREQUAL "")
|
||||
SET(POTRACE_ROOT_DIR $ENV{POTRACE_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_potrace_SEARCH_DIRS
|
||||
${POTRACE_ROOT_DIR}
|
||||
/opt/lib/potrace
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
FIND_PATH(POTRACE_INCLUDE_DIR
|
||||
NAMES
|
||||
potracelib.h
|
||||
HINTS
|
||||
${_potrace_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(POTRACE_LIBRARY
|
||||
NAMES
|
||||
potrace
|
||||
HINTS
|
||||
${_potrace_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set POTRACE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Potrace DEFAULT_MSG
|
||||
POTRACE_LIBRARY POTRACE_INCLUDE_DIR)
|
||||
|
||||
IF(POTRACE_FOUND)
|
||||
SET(POTRACE_LIBRARIES ${POTRACE_LIBRARY})
|
||||
SET(POTRACE_INCLUDE_DIRS ${POTRACE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
POTRACE_INCLUDE_DIR
|
||||
POTRACE_LIBRARY
|
||||
)
|
@@ -53,7 +53,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
|
||||
IF(SDL2_FOUND)
|
||||
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
|
||||
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SDL2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SDL2_INCLUDE_DIR
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
|
||||
IF(SNDFILE_FOUND)
|
||||
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
|
||||
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SNDFILE_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LIBSNDFILE_INCLUDE_DIR
|
||||
|
@@ -54,7 +54,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spacenav DEFAULT_MSG
|
||||
IF(SPACENAV_FOUND)
|
||||
SET(SPACENAV_LIBRARIES ${SPACENAV_LIBRARY})
|
||||
SET(SPACENAV_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(SPACENAV_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SPACENAV_INCLUDE_DIR
|
||||
|
@@ -59,7 +59,7 @@ ELSE()
|
||||
get_filename_component(USD_LIBRARY_DIR ${USD_LIBRARY} DIRECTORY)
|
||||
SET(USD_INCLUDE_DIRS ${USD_INCLUDE_DIR})
|
||||
set(USD_LIBRARIES ${USD_LIBRARY})
|
||||
ENDIF()
|
||||
ENDIF(USD_FOUND)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
|
@@ -52,7 +52,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG
|
||||
IF(XML2_FOUND)
|
||||
SET(XML2_LIBRARIES ${XML2_LIBRARY})
|
||||
SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(XML2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XML2_INCLUDE_DIR
|
||||
|
@@ -61,7 +61,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OpenXR_SDK DEFAULT_MSG
|
||||
IF(XR_OPENXR_SDK_FOUND)
|
||||
SET(XR_OPENXR_SDK_LIBRARIES ${XR_OPENXR_SDK_LOADER_LIBRARY})
|
||||
SET(XR_OPENXR_SDK_INCLUDE_DIRS ${XR_OPENXR_SDK_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
ENDIF(XR_OPENXR_SDK_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
XR_OPENXR_SDK_INCLUDE_DIR
|
||||
|
@@ -39,7 +39,6 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
add_definitions(${GLOG_DEFINES})
|
||||
|
||||
add_executable(${TARGET_NAME} ${ARG_SRC} ${MANIFEST})
|
||||
setup_platform_linker_flags(${TARGET_NAME})
|
||||
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
|
||||
target_link_libraries(${TARGET_NAME} ${ARG_EXTRA_LIBS} ${PLATFORM_LINKLIBS})
|
||||
@@ -97,7 +96,6 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
set_tests_properties(${TARGET_NAME} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
|
||||
endif()
|
||||
if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES VS_GLOBAL_VcpkgEnabled "false")
|
||||
unset(MANIFEST)
|
||||
endif()
|
||||
unset(TEST_INC)
|
||||
|
@@ -128,7 +128,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(NOT _git_changed_files STREQUAL "")
|
||||
string(APPEND MY_WC_BRANCH " (modified)")
|
||||
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
|
||||
else()
|
||||
# Unpushed commits are also considered local modifications
|
||||
execute_process(COMMAND git log @{u}..
|
||||
@@ -137,7 +137,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
if(NOT _git_unpushed_log STREQUAL "")
|
||||
string(APPEND MY_WC_BRANCH " (modified)")
|
||||
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
|
||||
endif()
|
||||
unset(_git_unpushed_log)
|
||||
endif()
|
||||
@@ -161,7 +161,6 @@ file(WRITE buildinfo.h.txt
|
||||
"#define BUILD_BRANCH \"${MY_WC_BRANCH}\"\n"
|
||||
"#define BUILD_DATE \"${BUILD_DATE}\"\n"
|
||||
"#define BUILD_TIME \"${BUILD_TIME}\"\n"
|
||||
"#include \"buildinfo_static.h\"\n"
|
||||
)
|
||||
|
||||
# cleanup
|
||||
|
@@ -1,8 +0,0 @@
|
||||
/* CMake expanded values that won't change between CMake execution (unlike date/time).
|
||||
* This is included by `buildinfo.h` generated by `buildinfo.cmake`. */
|
||||
#define BUILD_PLATFORM "@BUILD_PLATFORM@"
|
||||
#define BUILD_TYPE "@BUILD_TYPE@"
|
||||
#define BUILD_CFLAGS "@BUILD_CFLAGS@"
|
||||
#define BUILD_CXXFLAGS "@BUILD_CXXFLAGS@"
|
||||
#define BUILD_LINKFLAGS "@BUILD_LINKFLAGS@"
|
||||
#define BUILD_SYSTEM "@BUILD_SYSTEM@"
|
@@ -355,8 +355,6 @@ def recursive_arg_sizes(node, ):
|
||||
# print("adding", node.spelling)
|
||||
for c in node.get_children():
|
||||
recursive_arg_sizes(c)
|
||||
|
||||
|
||||
# cache function sizes
|
||||
recursive_arg_sizes(tu.cursor)
|
||||
_defs.update(defs_precalc)
|
||||
|
@@ -21,7 +21,7 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import sys
|
||||
if sys.version_info.major < 3:
|
||||
if not sys.version.startswith("3"):
|
||||
print("\nPython3.x needed, found %s.\nAborting!\n" %
|
||||
sys.version.partition(" ")[0])
|
||||
sys.exit(1)
|
||||
|
@@ -182,7 +182,7 @@ def create_nb_project_main():
|
||||
f.write(' </logicalFolder>\n')
|
||||
# default, but this dir is infact not in blender dir so we can ignore it
|
||||
# f.write(' <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n')
|
||||
f.write(r' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
|
||||
f.write(' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
|
||||
|
||||
f.write(' <sourceRootList>\n')
|
||||
f.write(' <Elem>%s</Elem>\n' % SOURCE_DIR) # base_root_rel
|
||||
|
@@ -8,7 +8,6 @@ import sys
|
||||
|
||||
cmakelists_file = sys.argv[-1]
|
||||
|
||||
|
||||
def main():
|
||||
options = []
|
||||
for l in open(cmakelists_file, 'r').readlines():
|
||||
|
@@ -49,8 +49,8 @@ def main():
|
||||
check_commands = []
|
||||
for c, inc_dirs, defs in source_info:
|
||||
|
||||
# ~if "source/blender" not in c:
|
||||
# ~ continue
|
||||
#~if "source/blender" not in c:
|
||||
#~ continue
|
||||
|
||||
cmd = ([CHECKER_BIN] +
|
||||
CHECKER_ARGS +
|
||||
|
@@ -5,22 +5,24 @@
|
||||
#
|
||||
|
||||
set(WITH_ALEMBIC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_BULLET ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
@@ -29,13 +31,12 @@ set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_OCEANSIM ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
|
||||
@@ -44,7 +45,6 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_BOOST OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
|
||||
@@ -15,17 +14,20 @@ set(WITH_BULLET OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_EMBREE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
|
||||
@@ -35,13 +37,12 @@ set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LZMA OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_LZO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_FLUID OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_OCEANSIM OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -4,7 +4,6 @@
|
||||
# cmake -C../blender/build_files/cmake/config/blender_release.cmake ../blender
|
||||
#
|
||||
|
||||
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_ALEMBIC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_ASSERT_ABORT OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
|
||||
@@ -12,12 +11,15 @@ set(WITH_BULLET ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
@@ -30,13 +32,12 @@ set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZMA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_LZO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_OCEANSIM ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
|
||||
@@ -45,7 +46,6 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_POTRACE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL ON CACHE BOOL "" FORCE)
|
||||
@@ -55,7 +55,7 @@ set(WITH_USD ON CACHE BOOL "" FORCE)
|
||||
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;sm_86;compute_75 CACHE STRING "" FORCE)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;compute_75 CACHE STRING "" FORCE)
|
||||
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
|
||||
|
||||
# platform dependent options
|
||||
|
@@ -33,9 +33,18 @@ set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
||||
# Depends on Python install, do this to quiet warning.
|
||||
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# Jemalloc does not work with dlopen() of Python modules:
|
||||
# https://github.com/jemalloc/jemalloc/issues/1237
|
||||
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
|
||||
# Note, if linking errors can be resolved, lines below can be removed.
|
||||
# Until then, disable configurations known to fail.
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# jemalloc causes linking error on import, disable.
|
||||
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
# OpenMP causes linking error on build, disable.
|
||||
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(WITH_WINDOWS_BUNDLE_CRT OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -114,6 +114,5 @@ def main():
|
||||
import subprocess
|
||||
subprocess.call(cmd)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -60,19 +60,6 @@ function(list_assert_duplicates
|
||||
unset(_len_after)
|
||||
endfunction()
|
||||
|
||||
# Adds a native path separator to the end of the path:
|
||||
#
|
||||
# - 'example' -> 'example/'
|
||||
# - '/example///' -> '/example/'
|
||||
#
|
||||
macro(path_ensure_trailing_slash
|
||||
path_new path_input
|
||||
)
|
||||
file(TO_NATIVE_PATH "/" _path_sep)
|
||||
string(REGEX REPLACE "[${_path_sep}]+$" "" ${path_new} ${path_input})
|
||||
set(${path_new} "${${path_new}}${_path_sep}")
|
||||
unset(_path_sep)
|
||||
endmacro()
|
||||
|
||||
# foo_bar.spam --> foo_barMySuffix.spam
|
||||
macro(file_suffix
|
||||
@@ -196,7 +183,7 @@ function(blender_user_header_search_paths
|
||||
foreach(_INC ${includes})
|
||||
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||
# _ALL_INCS is a space-separated string of file paths in quotes.
|
||||
string(APPEND _ALL_INCS " \"${_ABS_INC}\"")
|
||||
set(_ALL_INCS "${_ALL_INCS} \"${_ABS_INC}\"")
|
||||
endforeach()
|
||||
set_target_properties(${name} PROPERTIES XCODE_ATTRIBUTE_USER_HEADER_SEARCH_PATHS "${_ALL_INCS}")
|
||||
endif()
|
||||
@@ -263,11 +250,11 @@ macro(add_cc_flags_custom_test
|
||||
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}\"")
|
||||
string(APPEND CMAKE_C_FLAGS " ${CMAKE_C_FLAGS_${_name_upper}}" ${ARGV1})
|
||||
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}\"")
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS_${_name_upper}}" ${ARGV1})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_name_upper}}" ${ARGV1})
|
||||
endif()
|
||||
unset(_name_upper)
|
||||
|
||||
@@ -315,14 +302,14 @@ function(blender_add_lib__impl
|
||||
#
|
||||
# What this code does it traverses library_deps and extracts information about whether
|
||||
# library is to provided as general, debug or optimized. This is a little state machine which
|
||||
# keeps track of which build type library is to provided for:
|
||||
# keeps track of whiuch build type library is to provided for:
|
||||
#
|
||||
# - If "debug" or "optimized" word is found, the next element in the list is expected to be
|
||||
# a library which will be passed to target_link_libraries() under corresponding build type.
|
||||
#
|
||||
# - If there is no "debug" or "optimized" used library is specified for all build types.
|
||||
#
|
||||
# NOTE: If separated libraries for debug and release are needed every library is the list are
|
||||
# NOTE: If separated libraries for debug and release ar eneeded every library is the list are
|
||||
# to be prefixed explicitly.
|
||||
#
|
||||
# Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d"
|
||||
@@ -388,8 +375,9 @@ function(blender_add_lib
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
|
||||
endfunction()
|
||||
|
||||
# Add tests for a Blender library, to be called in tandem with blender_add_lib().
|
||||
# The tests will be part of the blender_test executable (see tests/gtests/runner).
|
||||
# blender_add_test_lib() is used to define a test library. It is intended to be
|
||||
# called in tandem with blender_add_lib(). The test library will be linked into
|
||||
# the bf_gtest_runner_test executable (see tests/gtests/CMakeLists.txt).
|
||||
function(blender_add_test_lib
|
||||
name
|
||||
sources
|
||||
@@ -423,48 +411,6 @@ function(blender_add_test_lib
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_TEST_LIBS ${name})
|
||||
endfunction()
|
||||
|
||||
|
||||
# Add tests for a Blender library, to be called in tandem with blender_add_lib().
|
||||
# Test will be compiled into a ${name}_test executable.
|
||||
#
|
||||
# To be used for smaller isolated libraries, that do not have many dependencies.
|
||||
# For libraries that do drag in many other Blender libraries and would create a
|
||||
# very large executable, blender_add_test_lib() should be used instead.
|
||||
function(blender_add_test_executable
|
||||
name
|
||||
sources
|
||||
includes
|
||||
includes_sys
|
||||
library_deps
|
||||
)
|
||||
|
||||
add_cc_flags_custom_test(${name} PARENT_SCOPE)
|
||||
|
||||
## Otherwise external projects will produce warnings that we cannot fix.
|
||||
remove_strict_flags()
|
||||
|
||||
include_directories(${includes})
|
||||
include_directories(${includes_sys})
|
||||
setup_libdirs()
|
||||
|
||||
BLENDER_SRC_GTEST_EX(
|
||||
NAME ${name}
|
||||
SRC "${sources}"
|
||||
EXTRA_LIBS "${library_deps}"
|
||||
SKIP_ADD_TEST
|
||||
)
|
||||
|
||||
include(GTest)
|
||||
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
|
||||
${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/GTestAddTests.cmake
|
||||
)
|
||||
|
||||
gtest_discover_tests(${name}_test
|
||||
DISCOVERY_MODE PRE_TEST
|
||||
WORKING_DIRECTORY "${TEST_INSTALL_DIR}"
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Ninja only: assign 'heavy pool' to some targets that are especially RAM-consuming to build.
|
||||
function(setup_heavy_lib_pool)
|
||||
if(WITH_NINJA_POOL_JOBS AND NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
|
||||
@@ -490,8 +436,8 @@ function(SETUP_LIBDIRS)
|
||||
|
||||
# NOTE: For all new libraries, use absolute library paths.
|
||||
# This should eventually be phased out.
|
||||
# APPLE plaform uses full paths for linking libraries, and avoids link_directories.
|
||||
if(NOT MSVC AND NOT APPLE)
|
||||
|
||||
if(NOT MSVC)
|
||||
link_directories(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH})
|
||||
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
@@ -568,18 +514,33 @@ function(SETUP_LIBDIRS)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Platform specific linker flags for targets.
|
||||
function(setup_platform_linker_flags
|
||||
target)
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${PLATFORM_LINKFLAGS}")
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " ${PLATFORM_LINKFLAGS_RELEASE}")
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
endfunction()
|
||||
macro(setup_platform_linker_flags)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
endmacro()
|
||||
|
||||
# Platform specific libraries for targets.
|
||||
function(setup_platform_linker_libs
|
||||
function(setup_liblinks
|
||||
target
|
||||
)
|
||||
|
||||
# NOTE: This might look like it affects global scope, accumulating linker flags on every call
|
||||
# to setup_liblinks, but this isn't how CMake works. These flags will only affect current
|
||||
# directory from where the function is called.
|
||||
# This means that setup_liblinks() called for ffmpeg_test will not affect blender, and each
|
||||
# of thsoe targets will have single set of linker flags.
|
||||
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)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
||||
|
||||
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)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
||||
|
||||
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)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
|
||||
|
||||
# jemalloc must be early in the list, to be before pthread (see T57998)
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
|
||||
@@ -688,14 +649,14 @@ endmacro()
|
||||
macro(add_c_flag
|
||||
flag)
|
||||
|
||||
string(APPEND CMAKE_C_FLAGS " ${flag}")
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${flag}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endmacro()
|
||||
|
||||
macro(add_cxx_flag
|
||||
flag)
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${flag}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endmacro()
|
||||
|
||||
macro(remove_strict_flags)
|
||||
@@ -1254,16 +1215,8 @@ endmacro()
|
||||
|
||||
macro(without_system_libs_begin)
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
|
||||
if(APPLE)
|
||||
# Avoid searching for headers in frameworks (like Mono), and libraries in LIBDIR.
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(without_system_libs_end)
|
||||
unset(CMAKE_IGNORE_PATH)
|
||||
if(APPLE)
|
||||
# FIRST is the default.
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -86,7 +86,7 @@ if(WIN32)
|
||||
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
|
||||
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/license/GPL-3.0.txt)
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt)
|
||||
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
|
||||
|
||||
set(BLENDER_NAMESPACE_GUID "507F933F-5898-404A-9A05-18282FD491A6")
|
||||
|
@@ -30,47 +30,6 @@ macro(find_package_wrapper)
|
||||
# do nothing, just satisfy the macro
|
||||
endmacro()
|
||||
|
||||
function(print_found_status
|
||||
lib_name
|
||||
lib_path
|
||||
)
|
||||
|
||||
if(FIRST_RUN)
|
||||
if(lib_path)
|
||||
message(STATUS "Found ${lib_name}: ${lib_path}")
|
||||
else()
|
||||
message(WARNING "Could NOT find ${lib_name}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Find system provided libraries.
|
||||
|
||||
# Find system ZLIB, not the pre-compiled one supplied with OpenCollada.
|
||||
set(ZLIB_ROOT /usr)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(BZip2 REQUIRED)
|
||||
list(APPEND ZLIB_LIBRARIES ${BZIP2_LIBRARIES})
|
||||
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(NOT OPENAL_FOUND)
|
||||
set(WITH_OPENAL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
find_library(JACK_FRAMEWORK
|
||||
NAMES jackmp
|
||||
)
|
||||
if(NOT JACK_FRAMEWORK)
|
||||
set(WITH_JACK OFF)
|
||||
else()
|
||||
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
|
||||
# Prefer lib directory paths
|
||||
@@ -83,15 +42,22 @@ if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Find precompiled libraries, and avoid system or user-installed ones.
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_begin()
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL)
|
||||
if(OPENAL_FOUND)
|
||||
set(WITH_OPENAL ON)
|
||||
else()
|
||||
set(WITH_OPENAL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_ALEMBIC)
|
||||
find_package(Alembic)
|
||||
set(ALEMBIC ${LIBDIR}/alembic)
|
||||
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
|
||||
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
|
||||
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
|
||||
set(ALEMBIC_LIBRARIES Alembic)
|
||||
set(ALEMBIC_FOUND ON)
|
||||
endif()
|
||||
|
||||
if(WITH_USD)
|
||||
@@ -102,27 +68,30 @@ if(WITH_USD)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
find_package(OpenSubdiv)
|
||||
set(OPENSUBDIV ${LIBDIR}/opensubdiv)
|
||||
set(OPENSUBDIV_LIBPATH ${OPENSUBDIV}/lib)
|
||||
find_library(OSD_LIB_CPU NAMES osdCPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
find_library(OSD_LIB_GPU NAMES osdGPU PATHS ${OPENSUBDIV_LIBPATH})
|
||||
set(OPENSUBDIV_INCLUDE_DIR ${OPENSUBDIV}/include)
|
||||
set(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR})
|
||||
list(APPEND OPENSUBDIV_LIBRARIES ${OSD_LIB_CPU} ${OSD_LIB_GPU})
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
find_library(JACK_FRAMEWORK
|
||||
NAMES jackmp
|
||||
)
|
||||
set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
|
||||
if(NOT JACK_FRAMEWORK)
|
||||
set(WITH_JACK OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
find_package(SndFile)
|
||||
find_library(_sndfile_FLAC_LIBRARY NAMES flac HINTS ${LIBDIR}/sndfile/lib)
|
||||
find_library(_sndfile_OGG_LIBRARY NAMES ogg HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
list(APPEND LIBSNDFILE_LIBRARIES
|
||||
${_sndfile_FLAC_LIBRARY}
|
||||
${_sndfile_OGG_LIBRARY}
|
||||
${_sndfile_VORBIS_LIBRARY}
|
||||
${_sndfile_VORBISENC_LIBRARY}
|
||||
)
|
||||
|
||||
print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
|
||||
unset(_sndfile_FLAC_LIBRARY)
|
||||
unset(_sndfile_OGG_LIBRARY)
|
||||
unset(_sndfile_VORBIS_LIBRARY)
|
||||
unset(_sndfile_VORBISENC_LIBRARY)
|
||||
set(LIBSNDFILE ${LIBDIR}/sndfile)
|
||||
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
|
||||
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
|
||||
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
@@ -161,27 +130,54 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
find_package(Fftw3)
|
||||
set(FFTW3 ${LIBDIR}/fftw3)
|
||||
set(FFTW3_INCLUDE_DIRS ${FFTW3}/include)
|
||||
set(FFTW3_LIBRARIES fftw3)
|
||||
set(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
endif()
|
||||
|
||||
find_package(Freetype REQUIRED)
|
||||
set(ZLIB /usr)
|
||||
set(ZLIB_INCLUDE_DIRS "${ZLIB}/include")
|
||||
set(ZLIB_LIBRARIES z bz2)
|
||||
|
||||
set(PNG_LIBRARIES png ${ZLIB_LIBRARIES})
|
||||
set(JPEG_LIBRARIES jpeg)
|
||||
|
||||
set(FREETYPE ${LIBDIR}/freetype)
|
||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
|
||||
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
set(FREETYPE_LIBRARY freetype)
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
find_package(OpenEXR)
|
||||
set(OPENEXR ${LIBDIR}/openexr)
|
||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR}/include/OpenEXR)
|
||||
set(OPENEXR_LIBRARIES
|
||||
Iex
|
||||
Half
|
||||
IlmImf
|
||||
Imath
|
||||
IlmThread)
|
||||
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG_FIND_COMPONENTS
|
||||
set(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
|
||||
set(FFMPEG_LIBRARIES
|
||||
avcodec avdevice avformat avutil
|
||||
mp3lame ogg opus swresample swscale
|
||||
theora theoradec theoraenc vorbis vorbisenc
|
||||
vorbisfile vpx x264 xvidcore)
|
||||
find_package(FFmpeg)
|
||||
mp3lame swscale x264 xvidcore
|
||||
theora theoradec theoraenc
|
||||
vorbis vorbisenc vorbisfile ogg opus
|
||||
vpx swresample)
|
||||
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
|
||||
# use openjpeg from libdir that is linked into ffmpeg
|
||||
find_package(OpenJPEG)
|
||||
set(OPENJPEG ${LIBDIR}/openjpeg)
|
||||
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include)
|
||||
set(OPENJPEG_LIBRARIES ${OPENJPEG}/lib/libopenjp2.a)
|
||||
endif()
|
||||
|
||||
find_library(SYSTEMSTUBS_LIBRARY
|
||||
@@ -194,7 +190,7 @@ if(SYSTEMSTUBS_LIBRARY)
|
||||
list(APPEND PLATFORM_LINKLIBS SystemStubs)
|
||||
endif()
|
||||
|
||||
string(APPEND PLATFORM_CFLAGS " -pipe -funsigned-char -fno-strict-aliasing")
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char")
|
||||
set(PLATFORM_LINKFLAGS
|
||||
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework Metal -framework QuartzCore"
|
||||
)
|
||||
@@ -202,76 +198,97 @@ set(PLATFORM_LINKFLAGS
|
||||
list(APPEND PLATFORM_LINKLIBS c++)
|
||||
|
||||
if(WITH_JACK)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -F/Library/Frameworks -weak_framework jackmp")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -F/Library/Frameworks -weak_framework jackmp")
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
|
||||
# force cmake to link right framework
|
||||
string(APPEND PLATFORM_LINKFLAGS " /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
find_package(OpenCOLLADA)
|
||||
find_library(PCRE_LIBRARIES NAMES pcre HINTS ${LIBDIR}/opencollada/lib)
|
||||
find_library(XML2_LIBRARIES NAMES xml2 HINTS ${LIBDIR}/opencollada/lib)
|
||||
print_found_status("PCRE" "${PCRE_LIBRARIES}")
|
||||
print_found_status("XML2" "${XML2_LIBRARIES}")
|
||||
set(OPENCOLLADA ${LIBDIR}/opencollada)
|
||||
|
||||
set(OPENCOLLADA_INCLUDE_DIRS
|
||||
${LIBDIR}/opencollada/include/COLLADAStreamWriter
|
||||
${LIBDIR}/opencollada/include/COLLADABaseUtils
|
||||
${LIBDIR}/opencollada/include/COLLADAFramework
|
||||
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader
|
||||
${LIBDIR}/opencollada/include/GeneratedSaxParser
|
||||
)
|
||||
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIBRARIES
|
||||
OpenCOLLADASaxFrameworkLoader
|
||||
-lOpenCOLLADAFramework
|
||||
-lOpenCOLLADABaseUtils
|
||||
-lOpenCOLLADAStreamWriter
|
||||
-lMathMLSolver
|
||||
-lGeneratedSaxParser
|
||||
-lbuffer -lftoa -lUTF
|
||||
)
|
||||
# PCRE and XML2 are bundled with OpenCollada.
|
||||
set(PCRE_LIBRARIES pcre)
|
||||
set(XML2_LIBRARIES xml2)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
find_package(SDL2)
|
||||
set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIRS})
|
||||
set(SDL_LIBRARY ${SDL2_LIBRARIES})
|
||||
string(APPEND PLATFORM_LINKFLAGS " -framework ForceFeedback")
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework ForceFeedback")
|
||||
endif()
|
||||
|
||||
set(PNG_ROOT ${LIBDIR}/png)
|
||||
find_package(PNG REQUIRED)
|
||||
set(PNG "${LIBDIR}/png")
|
||||
set(PNG_INCLUDE_DIRS "${PNG}/include")
|
||||
set(PNG_LIBPATH ${PNG}/lib)
|
||||
|
||||
set(JPEG_ROOT ${LIBDIR}/jpeg)
|
||||
find_package(JPEG REQUIRED)
|
||||
set(JPEG "${LIBDIR}/jpeg")
|
||||
set(JPEG_INCLUDE_DIR "${JPEG}/include")
|
||||
set(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
set(TIFF_ROOT ${LIBDIR}/tiff)
|
||||
find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
message(WARNING "TIFF not found, disabling WITH_IMAGE_TIFF")
|
||||
set(WITH_IMAGE_TIFF OFF)
|
||||
endif()
|
||||
set(TIFF ${LIBDIR}/tiff)
|
||||
set(TIFF_INCLUDE_DIR ${TIFF}/include)
|
||||
set(TIFF_LIBRARY tiff)
|
||||
set(TIFF_LIBPATH ${TIFF}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_BOOST)
|
||||
set(Boost_NO_BOOST_CMAKE ON)
|
||||
set(BOOST_ROOT ${LIBDIR}/boost)
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
set(_boost_FIND_COMPONENTS date_time filesystem regex system thread wave)
|
||||
set(BOOST ${LIBDIR}/boost)
|
||||
set(BOOST_INCLUDE_DIR ${BOOST}/include)
|
||||
set(BOOST_POSTFIX)
|
||||
set(BOOST_LIBRARIES
|
||||
boost_date_time${BOOST_POSTFIX}
|
||||
boost_filesystem${BOOST_POSTFIX}
|
||||
boost_regex${BOOST_POSTFIX}
|
||||
boost_system${BOOST_POSTFIX}
|
||||
boost_thread${BOOST_POSTFIX}
|
||||
boost_wave${BOOST_POSTFIX}
|
||||
)
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND _boost_FIND_COMPONENTS locale)
|
||||
list(APPEND BOOST_LIBRARIES boost_locale${BOOST_POSTFIX})
|
||||
endif()
|
||||
if(WITH_CYCLES_NETWORK)
|
||||
list(APPEND _boost_FIND_COMPONENTS serialization)
|
||||
list(APPEND BOOST_LIBRARIES boost_serialization${BOOST_POSTFIX})
|
||||
endif()
|
||||
if(WITH_OPENVDB)
|
||||
list(APPEND _boost_FIND_COMPONENTS iostreams)
|
||||
list(APPEND BOOST_LIBRARIES boost_iostreams${BOOST_POSTFIX})
|
||||
endif()
|
||||
find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
|
||||
|
||||
set(BOOST_LIBRARIES ${Boost_LIBRARIES})
|
||||
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
|
||||
set(BOOST_LIBPATH ${BOOST}/lib)
|
||||
set(BOOST_DEFINITIONS)
|
||||
|
||||
mark_as_advanced(Boost_LIBRARIES)
|
||||
mark_as_advanced(Boost_INCLUDE_DIRS)
|
||||
unset(_boost_FIND_COMPONENTS)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it !
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it !
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
find_package(OpenImageIO)
|
||||
list(APPEND OPENIMAGEIO_LIBRARIES
|
||||
set(OPENIMAGEIO ${LIBDIR}/openimageio)
|
||||
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
|
||||
set(OPENIMAGEIO_LIBRARIES
|
||||
${OPENIMAGEIO}/lib/libOpenImageIO.a
|
||||
${PNG_LIBRARIES}
|
||||
${JPEG_LIBRARIES}
|
||||
${TIFF_LIBRARY}
|
||||
@@ -279,30 +296,69 @@ if(WITH_OPENIMAGEIO)
|
||||
${OPENJPEG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
set(OPENIMAGEIO_LIBPATH
|
||||
${OPENIMAGEIO}/lib
|
||||
${JPEG_LIBPATH}
|
||||
${PNG_LIBPATH}
|
||||
${TIFF_LIBPATH}
|
||||
${OPENEXR_LIBPATH}
|
||||
${ZLIB_LIBPATH}
|
||||
)
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
|
||||
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
find_package(OpenColorIO)
|
||||
set(OPENCOLORIO ${LIBDIR}/opencolorio)
|
||||
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
|
||||
set(OPENCOLORIO_LIBRARIES OpenColorIO tinyxml yaml-cpp)
|
||||
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENVDB)
|
||||
find_package(OpenVDB)
|
||||
find_library(BLOSC_LIBRARIES NAMES blosc HINTS ${LIBDIR}/openvdb/lib)
|
||||
print_found_status("Blosc" "${BLOSC_LIBRARIES}")
|
||||
list(APPEND OPENVDB_LIBRARIES ${BLOSC_LIBRARIES})
|
||||
set(OPENVDB ${LIBDIR}/openvdb)
|
||||
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
|
||||
set(OPENVDB_LIBRARIES openvdb blosc)
|
||||
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
|
||||
set(OPENVDB_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(NANOVDB ${LIBDIR}/nanovdb)
|
||||
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
find_package(LLVM)
|
||||
if(NOT LLVM_FOUND)
|
||||
set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
|
||||
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
else()
|
||||
set(LLVM_CONFIG llvm-config)
|
||||
endif()
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --version
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --includedir
|
||||
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libdir
|
||||
OUTPUT_VARIABLE LLVM_LIBPATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
find_library(LLVM_LIBRARY
|
||||
NAMES LLVMAnalysis # first of a whole bunch of libs to get
|
||||
PATHS ${LLVM_LIBPATH})
|
||||
|
||||
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
||||
if(LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
# way for LLVM_LIBRARY.
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
|
||||
OUTPUT_VARIABLE LLVM_LIBRARY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
|
||||
else()
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "LLVM not found.")
|
||||
endif()
|
||||
endif()
|
||||
@@ -335,20 +391,7 @@ endif()
|
||||
|
||||
if(WITH_CYCLES_EMBREE)
|
||||
find_package(Embree 3.8.0 REQUIRED)
|
||||
# Increase stack size for Embree, only works for executables.
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -Xlinker -stack_size -Xlinker 0x100000")
|
||||
endif()
|
||||
|
||||
# Embree static library linking can mix up SSE and AVX symbols, causing
|
||||
# crashes on macOS systems with older CPUs that don't have AVX. Using
|
||||
# force load avoids that. The Embree shared library does not suffer from
|
||||
# this problem, precisely because linking a shared library uses force load.
|
||||
set(_embree_libraries_force_load)
|
||||
foreach(_embree_library ${EMBREE_LIBRARIES})
|
||||
list(APPEND _embree_libraries_force_load "-Wl,-force_load,${_embree_library}")
|
||||
endforeach()
|
||||
set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
@@ -364,42 +407,35 @@ if(WITH_TBB)
|
||||
find_package(TBB)
|
||||
endif()
|
||||
|
||||
if(WITH_POTRACE)
|
||||
find_package(Potrace)
|
||||
if(NOT POTRACE_FOUND)
|
||||
message(WARNING "potrace not found, disabling WITH_POTRACE")
|
||||
set(WITH_POTRACE OFF)
|
||||
if(WITH_GMP)
|
||||
find_package(GMP)
|
||||
|
||||
if(NOT GMP_FOUND)
|
||||
set(WITH_GMP OFF)
|
||||
message(STATUS "GMP not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
||||
set(OPENMP_FOUND ON)
|
||||
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -L'${LIBDIR}/openmp/lib' -lomp")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
|
||||
|
||||
# Copy libomp.dylib to allow executables like datatoc and tests to work.
|
||||
# `@executable_path/../Resources/lib/` is a default dylib search path.
|
||||
# For single config generator datatoc, tests etc.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
|
||||
)
|
||||
# For multi-config generator datatoc, etc.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
|
||||
)
|
||||
# For multi-config generator tests.
|
||||
execute_process(
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
|
||||
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -419,32 +455,25 @@ if(WITH_GMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Set compiler and linker flags.
|
||||
|
||||
set(EXETYPE MACOSX_BUNDLE)
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 -mssse3")
|
||||
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
string(APPEND CMAKE_C_FLAGS_RELEASE " -ftree-vectorize -fvariable-expansion-in-unroller")
|
||||
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -ftree-vectorize -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
|
||||
endif()
|
||||
|
||||
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
|
||||
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
|
||||
string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
|
||||
endif()
|
||||
|
||||
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
||||
@@ -453,8 +482,8 @@ set(PLATFORM_LINKFLAGS
|
||||
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||
)
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++")
|
||||
string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
|
||||
|
||||
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
@@ -150,7 +150,7 @@ endif()
|
||||
|
||||
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
|
||||
# Force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else (CMake bug?)
|
||||
string(APPEND CMAKE_C_FLAGS " -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
@@ -52,19 +52,12 @@ if(EXISTS ${LIBDIR})
|
||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||
|
||||
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||
# Ignore Mesa software OpenGL libraries, they are not intended to be
|
||||
# linked against but to optionally override at runtime.
|
||||
list(REMOVE_ITEM LIB_SUBDIRS ${LIBDIR}/mesa)
|
||||
# NOTE: Make sure "proper" compiled zlib comes first before the one
|
||||
# which is a part of OpenCollada. They have different ABI, and we
|
||||
# do need to use the official one.
|
||||
set(CMAKE_PREFIX_PATH ${LIBDIR}/zlib ${LIB_SUBDIRS})
|
||||
set(WITH_STATIC_LIBS ON)
|
||||
# OpenMP usually can't be statically linked into shared libraries,
|
||||
# due to not being compiled with position independent code.
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
set(WITH_OPENMP_STATIC ON)
|
||||
endif()
|
||||
set(WITH_OPENMP_STATIC ON)
|
||||
set(Boost_NO_BOOST_CMAKE ON)
|
||||
set(BOOST_ROOT ${LIBDIR}/boost)
|
||||
set(BOOST_LIBRARYDIR ${LIBDIR}/boost/lib)
|
||||
@@ -73,7 +66,7 @@ if(EXISTS ${LIBDIR})
|
||||
endif()
|
||||
|
||||
if(WITH_STATIC_LIBS)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -static-libstdc++")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
|
||||
endif()
|
||||
|
||||
# Wrapper to prefer static libraries
|
||||
@@ -264,7 +257,6 @@ endif()
|
||||
if(WITH_OPENVDB)
|
||||
find_package_wrapper(OpenVDB)
|
||||
find_package_wrapper(Blosc)
|
||||
|
||||
if(NOT OPENVDB_FOUND)
|
||||
set(WITH_OPENVDB OFF)
|
||||
set(WITH_OPENVDB_BLOSC OFF)
|
||||
@@ -275,15 +267,6 @@ if(WITH_OPENVDB)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
find_package_wrapper(NanoVDB)
|
||||
|
||||
if(NOT NANOVDB_FOUND)
|
||||
set(WITH_NANOVDB OFF)
|
||||
message(STATUS "NanoVDB not found, disabling it")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_ALEMBIC)
|
||||
find_package_wrapper(Alembic)
|
||||
|
||||
@@ -444,6 +427,15 @@ if(WITH_TBB)
|
||||
find_package_wrapper(TBB)
|
||||
endif()
|
||||
|
||||
if(WITH_GMP)
|
||||
find_package(GMP)
|
||||
|
||||
if(NOT GMP_FOUND)
|
||||
set(WITH_GMP OFF)
|
||||
message(STATUS "GMP not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_XR_OPENXR)
|
||||
find_package(XR_OpenXR_SDK)
|
||||
if(NOT XR_OPENXR_SDK_FOUND)
|
||||
@@ -460,14 +452,6 @@ if(WITH_GMP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_POTRACE)
|
||||
find_package_wrapper(Potrace)
|
||||
if(NOT POTRACE_FOUND)
|
||||
message(WARNING "potrace not found, disabling WITH_POTRACE")
|
||||
set(WITH_POTRACE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
@@ -620,7 +604,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(PREPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
unset(GCC_EXTRA_FLAGS_RELEASE)
|
||||
|
||||
if(WITH_LINKER_GOLD)
|
||||
@@ -628,8 +612,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "GNU gold")
|
||||
string(APPEND CMAKE_C_FLAGS " -fuse-ld=gold")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=gold")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
|
||||
else()
|
||||
message(STATUS "GNU gold linker isn't available, using the default system linker.")
|
||||
endif()
|
||||
@@ -641,8 +625,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
if("${LD_VERSION}" MATCHES "LLD")
|
||||
string(APPEND CMAKE_C_FLAGS " -fuse-ld=lld")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -fuse-ld=lld")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
|
||||
else()
|
||||
message(STATUS "LLD linker isn't available, using the default system linker.")
|
||||
endif()
|
||||
@@ -667,12 +651,12 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
endif()
|
||||
mark_as_advanced(XILD)
|
||||
|
||||
string(APPEND CMAKE_C_FLAGS " -fp-model precise -prec_div -parallel")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -fp-model precise -prec_div -parallel")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel")
|
||||
|
||||
# string(APPEND PLATFORM_CFLAGS " -diag-enable sc3")
|
||||
# set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3")
|
||||
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
|
||||
string(APPEND PLATFORM_LINKFLAGS " -static-intel")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
|
||||
endif()
|
||||
|
||||
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
|
||||
@@ -685,5 +669,5 @@ set(PLATFORM_LINKFLAGS
|
||||
# browsers can't properly detect blender as an executable then. Still enabled
|
||||
# for non-portable installs as typically used by Linux distributions.
|
||||
if(WITH_INSTALL_PORTABLE)
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -no-pie")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
|
||||
endif()
|
||||
|
@@ -49,7 +49,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(NOT EXISTS "${CLANG_OPENMP_DLL}")
|
||||
message(FATAL_ERROR "Clang OpenMP library (${CLANG_OPENMP_DLL}) not found.")
|
||||
endif()
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " \"${CLANG_OPENMP_LIB}\"")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \"${CLANG_OPENMP_LIB}\"")
|
||||
endif()
|
||||
if(WITH_WINDOWS_STRIPPED_PDB)
|
||||
message(WARNING "stripped pdb not supported with clang, disabling..")
|
||||
@@ -112,9 +112,9 @@ unset(_min_ver)
|
||||
|
||||
# needed for some MSVC installations
|
||||
# 4099 : PDB 'filename' was not found with 'object/library'
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099")
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " /SAFESEH:NO /ignore:4099")
|
||||
string(APPEND CMAKE_MODULE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version
|
||||
@@ -149,23 +149,23 @@ include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
|
||||
remove_cc_flag("/MDd" "/MD" "/Zi")
|
||||
|
||||
if(WITH_WINDOWS_PDB)
|
||||
set(PDB_INFO_OVERRIDE_FLAGS "/Z7")
|
||||
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||
set(PDB_INFO_OVERRIDE_FLAGS "/Z7")
|
||||
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||
endif()
|
||||
|
||||
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
|
||||
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")
|
||||
else()
|
||||
string(APPEND CMAKE_CXX_FLAGS " /nologo /J /Gd /MP /EHsc /bigobj")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc /bigobj")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
|
||||
endif()
|
||||
|
||||
# C++ standards conformace (/permissive-) is available on msvc 15.5 (1912) and up
|
||||
if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /permissive-")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
|
||||
# Two-phase name lookup does not place nicely with OpenMP yet, so disable for now
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:twoPhase-")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:twoPhase-")
|
||||
endif()
|
||||
|
||||
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
|
||||
@@ -183,33 +183,33 @@ else()
|
||||
set(SYMBOL_FORMAT /ZI)
|
||||
endif()
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /MDd ${SYMBOL_FORMAT}")
|
||||
string(APPEND CMAKE_C_FLAGS_DEBUG " /MDd ${SYMBOL_FORMAT}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_RELEASE " /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
string(APPEND CMAKE_C_FLAGS_RELEASE " /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
string(APPEND CMAKE_C_FLAGS_MINSIZEREL " /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " /MD ${SYMBOL_FORMAT}")
|
||||
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO " /MD ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
|
||||
unset(SYMBOL_FORMAT)
|
||||
# JMC is available on msvc 15.8 (1915) and up
|
||||
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /JMC")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
|
||||
endif()
|
||||
|
||||
string(APPEND PLATFORM_LINKFLAGS " /SUBSYSTEM:CONSOLE /STACK:2097152")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152")
|
||||
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||
string(APPEND PLATFORM_LINKFLAGS_DEBUG " /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
|
||||
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
|
||||
|
||||
# Ignore meaningless for us linker warnings.
|
||||
string(APPEND PLATFORM_LINKFLAGS " /ignore:4049 /ignore:4217 /ignore:4221")
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
|
||||
set(PLATFORM_LINKFLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${PDB_INFO_OVERRIDE_LINKER_FLAGS}")
|
||||
string(APPEND CMAKE_STATIC_LINKER_FLAGS " /ignore:4221")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
|
||||
|
||||
if(CMAKE_CL_64)
|
||||
string(PREPEND PLATFORM_LINKFLAGS "/MACHINE:X64 ")
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:X64 ${PLATFORM_LINKFLAGS}")
|
||||
else()
|
||||
string(PREPEND PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ")
|
||||
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED LIBDIR)
|
||||
@@ -535,11 +535,6 @@ if(WITH_OPENVDB)
|
||||
set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES)
|
||||
endif()
|
||||
|
||||
if(WITH_NANOVDB)
|
||||
set(NANOVDB ${LIBDIR}/nanoVDB)
|
||||
set(NANOVDB_INCLUDE_DIR ${NANOVDB}/include)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
|
||||
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
|
||||
@@ -570,7 +565,7 @@ if(WITH_IMAGE_OPENJPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENSUBDIV)
|
||||
set(OPENSUBDIV_INCLUDE_DIRS ${LIBDIR}/opensubdiv/include)
|
||||
set(OPENSUBDIV_INCLUDE_DIR ${LIBDIR}/opensubdiv/include)
|
||||
set(OPENSUBDIV_LIBPATH ${LIBDIR}/opensubdiv/lib)
|
||||
set(OPENSUBDIV_LIBRARIES
|
||||
optimized ${OPENSUBDIV_LIBPATH}/osdCPU.lib
|
||||
@@ -720,24 +715,14 @@ if(WINDOWS_PYTHON_DEBUG)
|
||||
string(REPLACE "/" "\\" _group_path "${_source_path}")
|
||||
source_group("${_group_path}" FILES "${_source}")
|
||||
endforeach()
|
||||
|
||||
# If the user scripts env var is set, include scripts from there otherwise
|
||||
# include user scripts in the profile folder.
|
||||
if(DEFINED ENV{BLENDER_USER_SCRIPTS})
|
||||
message(STATUS "Including user scripts from environment BLENDER_USER_SCRIPTS=$ENV{BLENDER_USER_SCRIPTS}")
|
||||
set(USER_SCRIPTS_ROOT "$ENV{BLENDER_USER_SCRIPTS}")
|
||||
else()
|
||||
message(STATUS "Including user scripts from the profile folder")
|
||||
# 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}/scripts")
|
||||
endif()
|
||||
|
||||
# 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}/*.*" )
|
||||
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}" "" _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()
|
||||
@@ -775,9 +760,3 @@ if(WITH_GMP)
|
||||
set(GMP_ROOT_DIR ${LIBDIR}/gmp)
|
||||
set(GMP_FOUND On)
|
||||
endif()
|
||||
|
||||
if(WITH_POTRACE)
|
||||
set(POTRACE_INCLUDE_DIRS ${LIBDIR}/potrace/include)
|
||||
set(POTRACE_LIBRARIES ${LIBDIR}/potrace/lib/potrace.lib)
|
||||
set(POTRACE_FOUND On)
|
||||
endif()
|
||||
|
@@ -5,14 +5,6 @@ if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
||||
|
||||
# This sometimes can change when updates are installed and the compiler version
|
||||
# changes, so test if it exists and if not, give InstallRequiredSystemLibraries
|
||||
# another chance to figure out the path.
|
||||
if(MSVC_REDIST_DIR AND NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||
unset(MSVC_REDIST_DIR CACHE)
|
||||
endif()
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
# Install the CRT to the blender.crt Sub folder.
|
||||
@@ -31,7 +23,7 @@ if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
get_filename_component(filename ${lib} NAME)
|
||||
file(SHA1 "${lib}" sha1_file)
|
||||
string(APPEND CRTLIBS " <file name=\"${filename}\" hash=\"${sha1_file}\" hashalg=\"SHA1\" />\n")
|
||||
set(CRTLIBS "${CRTLIBS} <file name=\"${filename}\" hash=\"${sha1_file}\" hashalg=\"SHA1\" />\n")
|
||||
endforeach()
|
||||
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.crt.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.crt.manifest @ONLY)
|
||||
file(TOUCH ${manifest_trigger_file})
|
||||
|
@@ -25,8 +25,8 @@ __all__ = (
|
||||
|
||||
|
||||
import sys
|
||||
if sys.version_info.major < 3:
|
||||
print("\nPython3.x or newer needed, found %s.\nAborting!\n" %
|
||||
if not sys.version.startswith("3"):
|
||||
print("\nPython3.x needed, found %s.\nAborting!\n" %
|
||||
sys.version.partition(" ")[0])
|
||||
sys.exit(1)
|
||||
|
||||
@@ -242,6 +242,5 @@ def main():
|
||||
for s in build_info():
|
||||
print(s)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -12,7 +12,6 @@ from make_utils import call
|
||||
|
||||
# Parse arguments
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--ctest-command", default="ctest")
|
||||
@@ -23,7 +22,6 @@ def parse_arguments():
|
||||
parser.add_argument("build_directory")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
args = parse_arguments()
|
||||
git_command = args.git_command
|
||||
svn_command = args.svn_command
|
||||
|
@@ -14,15 +14,12 @@ import sys
|
||||
import make_utils
|
||||
from make_utils import call, check_output
|
||||
|
||||
|
||||
def print_stage(text):
|
||||
print("")
|
||||
print(text)
|
||||
print("")
|
||||
|
||||
# Parse arguments
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--no-libraries", action="store_true")
|
||||
@@ -34,13 +31,10 @@ def parse_arguments():
|
||||
parser.add_argument("--use-centos-libraries", action="store_true")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def get_blender_git_root():
|
||||
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
|
||||
|
||||
# Setup for precompiled libraries and tests from svn.
|
||||
|
||||
|
||||
def svn_update(args, release_version):
|
||||
svn_non_interactive = [args.svn_command, '--non-interactive']
|
||||
|
||||
@@ -92,32 +86,30 @@ def svn_update(args, release_version):
|
||||
print_stage("Updating Precompiled Libraries and Tests")
|
||||
|
||||
if os.path.isdir(lib_dirpath):
|
||||
for dirname in os.listdir(lib_dirpath):
|
||||
dirpath = os.path.join(lib_dirpath, dirname)
|
||||
for dirname in os.listdir(lib_dirpath):
|
||||
dirpath = os.path.join(lib_dirpath, dirname)
|
||||
|
||||
if dirname == ".svn":
|
||||
# Cleanup must be run from svn root directory if it exists.
|
||||
if not make_utils.command_missing(args.svn_command):
|
||||
call(svn_non_interactive + ["cleanup", lib_dirpath])
|
||||
continue
|
||||
if dirname == ".svn":
|
||||
# Cleanup must be run from svn root directory if it exists.
|
||||
if not make_utils.command_missing(args.svn_command):
|
||||
call(svn_non_interactive + ["cleanup", lib_dirpath])
|
||||
continue
|
||||
|
||||
svn_dirpath = os.path.join(dirpath, ".svn")
|
||||
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
|
||||
svn_dirpath = os.path.join(dirpath, ".svn")
|
||||
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
|
||||
|
||||
if (
|
||||
os.path.isdir(dirpath) and
|
||||
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
|
||||
):
|
||||
if make_utils.command_missing(args.svn_command):
|
||||
sys.stderr.write("svn not found, can't update libraries\n")
|
||||
sys.exit(1)
|
||||
if os.path.isdir(dirpath) and \
|
||||
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
|
||||
if make_utils.command_missing(args.svn_command):
|
||||
sys.stderr.write("svn not found, can't update libraries\n")
|
||||
sys.exit(1)
|
||||
|
||||
# Cleanup to continue with interrupted downloads.
|
||||
if os.path.exists(svn_dirpath):
|
||||
call(svn_non_interactive + ["cleanup", dirpath])
|
||||
# Switch to appropriate branch and update.
|
||||
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
|
||||
call(svn_non_interactive + ["update", dirpath])
|
||||
# Cleanup to continue with interrupted downloads.
|
||||
if os.path.exists(svn_dirpath):
|
||||
call(svn_non_interactive + ["cleanup", dirpath])
|
||||
# Switch to appropriate branch and update.
|
||||
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
|
||||
call(svn_non_interactive + ["update", dirpath])
|
||||
|
||||
# Test if git repo can be updated.
|
||||
def git_update_skip(args, check_remote_exists=True):
|
||||
@@ -129,11 +121,9 @@ def git_update_skip(args, check_remote_exists=True):
|
||||
rebase_merge = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-merge'], exit_on_error=False)
|
||||
rebase_apply = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-apply'], exit_on_error=False)
|
||||
merge_head = check_output([args.git_command, 'rev-parse', '--git-path', 'MERGE_HEAD'], exit_on_error=False)
|
||||
if (
|
||||
os.path.exists(rebase_merge) or
|
||||
os.path.exists(rebase_apply) or
|
||||
os.path.exists(merge_head)
|
||||
):
|
||||
if os.path.exists(rebase_merge) or \
|
||||
os.path.exists(rebase_apply) or \
|
||||
os.path.exists(merge_head):
|
||||
return "rebase or merge in progress, complete it first"
|
||||
|
||||
# Abort if uncommitted changes.
|
||||
@@ -143,14 +133,13 @@ def git_update_skip(args, check_remote_exists=True):
|
||||
|
||||
# Test if there is an upstream branch configured
|
||||
if check_remote_exists:
|
||||
branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
|
||||
remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
|
||||
if len(remote) == 0:
|
||||
return "no remote branch to pull from"
|
||||
branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
|
||||
remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
|
||||
if len(remote) == 0:
|
||||
return "no remote branch to pull from"
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
# Update blender repository.
|
||||
def blender_update(args):
|
||||
print_stage("Updating Blender Git Repository")
|
||||
@@ -189,7 +178,7 @@ def submodules_update(args, release_version, branch):
|
||||
os.chdir(submodule_path)
|
||||
msg = git_update_skip(args, check_remote_exists=False)
|
||||
if msg:
|
||||
skip_msg += submodule_path + " skipped: " + msg + "\n"
|
||||
skip_msg += submodule_path + " skipped: " + msg + "\n"
|
||||
else:
|
||||
if make_utils.git_branch(args.git_command) != submodule_branch:
|
||||
call([args.git_command, "fetch", "origin"])
|
||||
|
@@ -7,7 +7,6 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def call(cmd, exit_on_error=True):
|
||||
print(" ".join(cmd))
|
||||
|
||||
@@ -20,7 +19,6 @@ def call(cmd, exit_on_error=True):
|
||||
sys.exit(retcode)
|
||||
return retcode
|
||||
|
||||
|
||||
def check_output(cmd, exit_on_error=True):
|
||||
# Flush to ensure correct order output on Windows.
|
||||
sys.stdout.flush()
|
||||
@@ -37,7 +35,6 @@ def check_output(cmd, exit_on_error=True):
|
||||
|
||||
return output.strip()
|
||||
|
||||
|
||||
def git_branch(git_command):
|
||||
# Get current branch name.
|
||||
try:
|
||||
@@ -48,7 +45,6 @@ def git_branch(git_command):
|
||||
|
||||
return branch.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_tag(git_command):
|
||||
# Get current tag name.
|
||||
try:
|
||||
@@ -58,18 +54,16 @@ def git_tag(git_command):
|
||||
|
||||
return tag.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_branch_release_version(branch, tag):
|
||||
release_version = re.search("^blender-v(.*)-release$", branch)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
elif tag:
|
||||
release_version = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
|
||||
release_version = re.search("^v([0-9]*\.[0-9]*).*", tag)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
return release_version
|
||||
|
||||
|
||||
def svn_libraries_base_url(release_version):
|
||||
if release_version:
|
||||
svn_branch = "tags/blender-" + release_version + "-release"
|
||||
@@ -77,7 +71,6 @@ def svn_libraries_base_url(release_version):
|
||||
svn_branch = "trunk"
|
||||
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
|
||||
|
||||
|
||||
def command_missing(command):
|
||||
# Support running with Python 2 for macOS
|
||||
if sys.version_info >= (3, 0):
|
||||
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.92"
|
||||
PROJECT_NUMBER = "V2.91"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
Introduction
|
||||
------------
|
||||
Intro
|
||||
-----
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -9,8 +9,9 @@ Introduction
|
||||
and the :func:`register`/:func:`unregister` functions! The :func:`pgettext` family of functions
|
||||
should only be used in rare, specific cases (like e.g. complex "composited" UI strings...).
|
||||
|
||||
To add translations to your python script, you must define a dictionary formatted like that:
|
||||
``{locale: {msg_key: msg_translation, ...}, ...}`` where:
|
||||
| To add translations to your python script, you must define a dictionary formatted like that:
|
||||
| ``{locale: {msg_key: msg_translation, ...}, ...}``
|
||||
| where:
|
||||
|
||||
- locale is either a lang iso code (e.g. ``fr``), a lang+country code (e.g. ``pt_BR``),
|
||||
a lang+variant code (e.g. ``sr@latin``), or a full code (e.g. ``uz_UZ@cyrilic``).
|
||||
|
@@ -9,24 +9,15 @@ When calling an operator you may want to pass the execution context.
|
||||
This determines the context that is given for the operator to run in, and whether
|
||||
invoke() is called or only execute().
|
||||
|
||||
``EXEC_DEFAULT`` is used by default, running only the ``execute()`` method, but you may
|
||||
want the operator to take user interaction with ``INVOKE_DEFAULT`` which will also
|
||||
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
|
||||
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
|
||||
call invoke() if existing.
|
||||
|
||||
The execution context is one of:
|
||||
|
||||
- ``INVOKE_DEFAULT``
|
||||
- ``INVOKE_REGION_WIN``
|
||||
- ``INVOKE_REGION_CHANNELS``
|
||||
- ``INVOKE_REGION_PREVIEW``
|
||||
- ``INVOKE_AREA``
|
||||
- ``INVOKE_SCREEN``
|
||||
- ``EXEC_DEFAULT``
|
||||
- ``EXEC_REGION_WIN``
|
||||
- ``EXEC_REGION_CHANNELS``
|
||||
- ``EXEC_REGION_PREVIEW``
|
||||
- ``EXEC_AREA``
|
||||
- ``EXEC_SCREEN``
|
||||
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
|
||||
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
|
||||
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',
|
||||
'EXEC_SCREEN')
|
||||
"""
|
||||
|
||||
# collection add popup
|
||||
|
@@ -33,12 +33,11 @@ fragment_shader = '''
|
||||
uniform float u_Scale;
|
||||
|
||||
in float v_ArcLength;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
|
||||
FragColor = vec4(1.0);
|
||||
gl_FragColor = vec4(1.0);
|
||||
}
|
||||
'''
|
||||
|
||||
|
@@ -23,11 +23,10 @@ fragment_shader = '''
|
||||
uniform float brightness;
|
||||
|
||||
in vec3 pos;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(pos * brightness, 1.0);
|
||||
gl_FragColor = vec4(pos * brightness, 1.0);
|
||||
}
|
||||
'''
|
||||
|
||||
|
@@ -56,11 +56,10 @@ fragment_shader = '''
|
||||
uniform sampler2D image;
|
||||
|
||||
in vec2 uvInterp;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = texture(image, uvInterp);
|
||||
gl_FragColor = texture(image, uvInterp);
|
||||
}
|
||||
'''
|
||||
|
||||
|
36
doc/python_api/examples/gpu.shader.py
Normal file
36
doc/python_api/examples/gpu.shader.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""
|
||||
Built-in shaders
|
||||
++++++++++++++++
|
||||
|
||||
All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.
|
||||
The value of it can only be modified using the :class:`gpu.matrix` module.
|
||||
|
||||
2D_UNIFORM_COLOR:
|
||||
attributes: vec3 pos
|
||||
uniforms: vec4 color
|
||||
|
||||
2D_FLAT_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
2D_SMOOTH_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
2D_IMAGE:
|
||||
attributes: vec3 pos, vec2 texCoord
|
||||
uniforms: sampler2D image
|
||||
|
||||
3D_UNIFORM_COLOR:
|
||||
attributes: vec3 pos
|
||||
uniforms: vec4 color
|
||||
|
||||
3D_FLAT_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
3D_SMOOTH_COLOR:
|
||||
attributes: vec3 pos, vec4 color
|
||||
uniforms: -
|
||||
|
||||
"""
|
@@ -13,15 +13,16 @@ than enough material to teach OpenGL programming, from books to many
|
||||
collections of tutorials.
|
||||
|
||||
Here is a comprehensive `list of books <https://www.khronos.org/developers/books/>`__ (non free).
|
||||
`Learn OpenGL <https://learnopengl.com/>`__ is one of the best resources to learn modern OpenGL and
|
||||
`opengl-tutorial.org <http://www.opengl-tutorial.org/>`__ offers a set of extensive examples,
|
||||
including advanced features.
|
||||
The `arcsynthesis tutorials <https://web.archive.org/web/20150225192611/http://www.arcsynthesis.org/gltut/index.html>`__
|
||||
is one of the best resources to learn modern OpenGL and
|
||||
`g-truc <http://www.g-truc.net/post-opengl-samples.html#menu>`__
|
||||
offers a set of extensive examples, including advanced features.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
You can use the :class:`bpy.types.Image` type to load and set textures.
|
||||
See :class:`bpy.types.Image.gl_load` and :class:`bpy.types.Image.gl_free`,
|
||||
You can use the :class:`Image` type to load and set textures.
|
||||
See :class:`Image.gl_load` and :class:`Image.gl_free`,
|
||||
for example.
|
||||
|
||||
|
||||
@@ -29,7 +30,7 @@ including advanced features.
|
||||
|
||||
Bind a named texture to a texturing target
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBindTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBindTexture.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target to which the texture is bound.
|
||||
@@ -41,7 +42,7 @@ including advanced features.
|
||||
|
||||
Specify pixel arithmetic
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glBlendFunc.xml>`__
|
||||
|
||||
:type sfactor: Enumerated constant
|
||||
:arg sfactor: Specifies how the red, green, blue, and alpha source blending factors are
|
||||
@@ -55,7 +56,7 @@ including advanced features.
|
||||
|
||||
Clear buffers to preset values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClear.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml>`__
|
||||
|
||||
:type mask: Enumerated constant(s)
|
||||
:arg mask: Bitwise OR of masks that indicate the buffers to be cleared.
|
||||
@@ -65,7 +66,7 @@ including advanced features.
|
||||
|
||||
Specify clear values for the color buffers
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearColor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: float
|
||||
:arg red, green, blue, alpha: Specify the red, green, blue, and alpha values used when the
|
||||
@@ -76,7 +77,7 @@ including advanced features.
|
||||
|
||||
Specify the clear value for the depth buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearDepth.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearDepth.xml>`__
|
||||
|
||||
:type depth: int
|
||||
:arg depth: Specifies the depth value used when the depth buffer is cleared.
|
||||
@@ -87,7 +88,7 @@ including advanced features.
|
||||
|
||||
Specify the clear value for the stencil buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClearStencil.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClearStencil.xml>`__
|
||||
|
||||
:type s: int
|
||||
:arg s: Specifies the index used when the stencil buffer is cleared. The initial value is 0.
|
||||
@@ -97,7 +98,7 @@ including advanced features.
|
||||
|
||||
Specify a plane against which all geometry is clipped
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glClipPlane.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glClipPlane.xml>`__
|
||||
|
||||
:type plane: Enumerated constant
|
||||
:arg plane: Specifies which clipping plane is being positioned.
|
||||
@@ -116,7 +117,7 @@ including advanced features.
|
||||
|
||||
Set a new color.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColor.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: Depends on function prototype.
|
||||
:arg red, green, blue: Specify new red, green, and blue values for the current color.
|
||||
@@ -128,7 +129,7 @@ including advanced features.
|
||||
|
||||
Enable and disable writing of frame buffer color components
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glColorMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glColorMask.xml>`__
|
||||
|
||||
:type red, green, blue, alpha: int (boolean)
|
||||
:arg red, green, blue, alpha: Specify whether red, green, blue, and alpha can or cannot be
|
||||
@@ -140,7 +141,7 @@ including advanced features.
|
||||
|
||||
Copy pixels into a 2D texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCopyTexImage2D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCopyTexImage2D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -169,7 +170,7 @@ including advanced features.
|
||||
|
||||
Specify whether front- or back-facing facets can be culled
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCullFace.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCullFace.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies whether front- or back-facing facets are candidates for culling.
|
||||
@@ -179,7 +180,7 @@ including advanced features.
|
||||
|
||||
Delete named textures
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteTextures.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteTextures.xml>`__
|
||||
|
||||
:type n: int
|
||||
:arg n: Specifies the number of textures to be deleted
|
||||
@@ -191,7 +192,7 @@ including advanced features.
|
||||
|
||||
Specify the value used for depth buffer comparisons
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthFunc.xml>`__
|
||||
|
||||
:type func: Enumerated constant
|
||||
:arg func: Specifies the depth comparison function.
|
||||
@@ -201,7 +202,7 @@ including advanced features.
|
||||
|
||||
Enable or disable writing into the depth buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthMask.xml>`__
|
||||
|
||||
:type flag: int (boolean)
|
||||
:arg flag: Specifies whether the depth buffer is enabled for writing. If flag is GL_FALSE,
|
||||
@@ -213,7 +214,7 @@ including advanced features.
|
||||
|
||||
Specify mapping of depth values from normalized device coordinates to window coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthRange.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDepthRange.xml>`__
|
||||
|
||||
:type zNear: int
|
||||
:arg zNear: Specifies the mapping of the near clipping plane to window coordinates.
|
||||
@@ -227,7 +228,7 @@ including advanced features.
|
||||
|
||||
Disable server-side GL capabilities
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a symbolic constant indicating a GL capability.
|
||||
@@ -237,7 +238,7 @@ including advanced features.
|
||||
|
||||
Specify which color buffers are to be drawn into
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDrawBuffer.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies up to four color buffers to be drawn into.
|
||||
@@ -249,7 +250,7 @@ including advanced features.
|
||||
|
||||
Flag edges as either boundary or non-boundary
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEdgeFlag.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEdgeFlag.xml>`__
|
||||
|
||||
:type flag: Depends of function prototype
|
||||
:arg flag: Specifies the current edge flag value.The initial value is GL_TRUE.
|
||||
@@ -259,7 +260,7 @@ including advanced features.
|
||||
|
||||
Enable server-side GL capabilities
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a symbolic constant indicating a GL capability.
|
||||
@@ -272,7 +273,7 @@ including advanced features.
|
||||
|
||||
Evaluate enabled one- and two-dimensional maps
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalCoord.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalCoord.xml>`__
|
||||
|
||||
:type u: Depends on function prototype.
|
||||
:arg u: Specifies a value that is the domain coordinate u to the basis function defined
|
||||
@@ -290,7 +291,7 @@ including advanced features.
|
||||
|
||||
Compute a one- or two-dimensional grid of points or lines
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalMesh.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalMesh.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: In glEvalMesh1, specifies whether to compute a one-dimensional
|
||||
@@ -305,7 +306,7 @@ including advanced features.
|
||||
|
||||
Generate and evaluate a single point in a mesh
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glEvalPoint.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glEvalPoint.xml>`__
|
||||
|
||||
:type i: int
|
||||
:arg i: Specifies the integer value for grid domain variable i.
|
||||
@@ -317,7 +318,7 @@ including advanced features.
|
||||
|
||||
Controls feedback mode
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFeedbackBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFeedbackBuffer.xml>`__
|
||||
|
||||
:type size: int
|
||||
:arg size: Specifies the maximum number of values that can be written into buffer.
|
||||
@@ -332,14 +333,14 @@ including advanced features.
|
||||
|
||||
Block until all GL execution is complete
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFinish.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFinish.xml>`__
|
||||
|
||||
|
||||
.. function:: glFlush():
|
||||
|
||||
Force Execution of GL commands in finite time
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFlush.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFlush.xml>`__
|
||||
|
||||
|
||||
.. function:: glFog (pname, param):
|
||||
@@ -348,7 +349,7 @@ including advanced features.
|
||||
|
||||
Specify fog parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFog.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies a single-valued fog parameter. If the function prototype
|
||||
@@ -363,7 +364,7 @@ including advanced features.
|
||||
|
||||
Define front- and back-facing polygons
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glFrontFace.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies the orientation of front-facing polygons.
|
||||
@@ -373,7 +374,7 @@ including advanced features.
|
||||
|
||||
Generate texture names
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGenTextures.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGenTextures.xml>`__
|
||||
|
||||
:type n: int
|
||||
:arg n: Specifies the number of textures name to be generated.
|
||||
@@ -387,7 +388,7 @@ including advanced features.
|
||||
|
||||
Return the value or values of a selected parameter
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGet.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the parameter value to be returned.
|
||||
@@ -399,7 +400,7 @@ including advanced features.
|
||||
|
||||
Return error information
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetError.xml>`__
|
||||
|
||||
|
||||
.. function:: glGetLight (light, pname, params):
|
||||
@@ -408,7 +409,7 @@ including advanced features.
|
||||
|
||||
Return light source parameter values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetLight.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetLight.xml>`__
|
||||
|
||||
:type light: Enumerated constant
|
||||
:arg light: Specifies a light source. The number of possible lights depends on the
|
||||
@@ -426,7 +427,7 @@ including advanced features.
|
||||
|
||||
Return evaluator parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMap.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of a map.
|
||||
@@ -442,7 +443,7 @@ including advanced features.
|
||||
|
||||
Return material parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetMaterial.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMaterial.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies which of the two materials is being queried.
|
||||
@@ -459,7 +460,7 @@ including advanced features.
|
||||
|
||||
Return the specified pixel map
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetPixelMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`__
|
||||
|
||||
:type map: Enumerated constant
|
||||
:arg map: Specifies the name of the pixel map to return.
|
||||
@@ -471,7 +472,7 @@ including advanced features.
|
||||
|
||||
Return a string describing the current GL connection
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetString.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetString.xml>`__
|
||||
|
||||
:type name: Enumerated constant
|
||||
:arg name: Specifies a symbolic constant.
|
||||
@@ -484,7 +485,7 @@ including advanced features.
|
||||
|
||||
Return texture environment parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexEnv.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexEnv.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
|
||||
@@ -500,7 +501,7 @@ including advanced features.
|
||||
|
||||
Return texture coordinate generation parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexGen.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexGen.xml>`__
|
||||
|
||||
:type coord: Enumerated constant
|
||||
:arg coord: Specifies a texture coordinate.
|
||||
@@ -514,7 +515,7 @@ including advanced features.
|
||||
|
||||
Return a texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexImage.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexImage.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies which texture is to be obtained.
|
||||
@@ -536,7 +537,7 @@ including advanced features.
|
||||
|
||||
return texture parameter values for a specific level of detail
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexLevelParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexLevelParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of the target texture.
|
||||
@@ -555,7 +556,7 @@ including advanced features.
|
||||
|
||||
Return texture parameter values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetTexParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetTexParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the symbolic name of the target texture.
|
||||
@@ -569,7 +570,7 @@ including advanced features.
|
||||
|
||||
Specify implementation-specific hints
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glHint.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glHint.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a symbolic constant indicating the behavior to be
|
||||
@@ -582,7 +583,7 @@ including advanced features.
|
||||
|
||||
Test whether a capability is enabled
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsEnabled.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsEnabled.xml>`__
|
||||
|
||||
:type cap: Enumerated constant
|
||||
:arg cap: Specifies a constant representing a GL capability.
|
||||
@@ -592,7 +593,7 @@ including advanced features.
|
||||
|
||||
Determine if a name corresponds to a texture
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsTexture.xml>`__
|
||||
|
||||
:type texture: unsigned int
|
||||
:arg texture: Specifies a value that may be the name of a texture.
|
||||
@@ -604,7 +605,7 @@ including advanced features.
|
||||
|
||||
Set the light source parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLight.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml>`__
|
||||
|
||||
:type light: Enumerated constant
|
||||
:arg light: Specifies a light. The number of lights depends on the implementation,
|
||||
@@ -624,7 +625,7 @@ including advanced features.
|
||||
|
||||
Set the lighting model parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLightModel.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLightModel.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies a single-value light model parameter.
|
||||
@@ -637,7 +638,7 @@ including advanced features.
|
||||
|
||||
Specify the width of rasterized lines.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLineWidth.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLineWidth.xml>`__
|
||||
|
||||
:type width: float
|
||||
:arg width: Specifies the width of rasterized lines. The initial value is 1.
|
||||
@@ -649,7 +650,7 @@ including advanced features.
|
||||
|
||||
Replace the current matrix with the specified matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLoadMatrix.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLoadMatrix.xml>`__
|
||||
|
||||
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
|
||||
:arg m: Specifies a pointer to 16 consecutive values, which are used as the elements
|
||||
@@ -660,7 +661,7 @@ including advanced features.
|
||||
|
||||
Specify a logical pixel operation for color index rendering
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLogicOp.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLogicOp.xml>`__
|
||||
|
||||
:type opcode: Enumerated constant
|
||||
:arg opcode: Specifies a symbolic constant that selects a logical operation.
|
||||
@@ -672,7 +673,7 @@ including advanced features.
|
||||
|
||||
Define a one-dimensional evaluator
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap1.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap1.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the kind of values that are generated by the evaluator.
|
||||
@@ -697,7 +698,7 @@ including advanced features.
|
||||
|
||||
Define a two-dimensional evaluator
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMap2.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMap2.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the kind of values that are generated by the evaluator.
|
||||
@@ -738,7 +739,7 @@ including advanced features.
|
||||
|
||||
Define a one- or two-dimensional mesh
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMapGrid.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMapGrid.xml>`__
|
||||
|
||||
:type un: int
|
||||
:arg un: Specifies the number of partitions in the grid range interval
|
||||
@@ -757,7 +758,7 @@ including advanced features.
|
||||
|
||||
Specify material parameters for the lighting model.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMaterial.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMaterial.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies which face or faces are being updated. Must be one of:
|
||||
@@ -776,7 +777,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix with the specified matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glMultMatrix.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml>`__
|
||||
|
||||
:type m: :class:`bgl.Buffer` object. Depends on function prototype.
|
||||
:arg m: Points to 16 consecutive values that are used as the elements of a 4x4 column
|
||||
@@ -790,7 +791,7 @@ including advanced features.
|
||||
|
||||
Set the current normal vector
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glNormal.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glNormal.xml>`__
|
||||
|
||||
:type nx, ny, nz: Depends on function prototype. (non - 'v' prototypes only)
|
||||
:arg nx, ny, nz: Specify the x, y, and z coordinates of the new current normal.
|
||||
@@ -806,7 +807,7 @@ including advanced features.
|
||||
|
||||
Set up pixel transfer maps
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelMap.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelMap.xml>`__
|
||||
|
||||
:type map: Enumerated constant
|
||||
:arg map: Specifies a symbolic map name.
|
||||
@@ -822,7 +823,7 @@ including advanced features.
|
||||
|
||||
Set pixel storage modes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelStore.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelStore.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the symbolic name of the parameter to be set.
|
||||
@@ -838,7 +839,7 @@ including advanced features.
|
||||
|
||||
Set pixel transfer modes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelTransfer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPixelTransfer.xml>`__
|
||||
|
||||
:type pname: Enumerated constant
|
||||
:arg pname: Specifies the symbolic name of the pixel transfer parameter to be set.
|
||||
@@ -850,7 +851,7 @@ including advanced features.
|
||||
|
||||
Specify the diameter of rasterized points
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPointSize.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPointSize.xml>`__
|
||||
|
||||
:type size: float
|
||||
:arg size: Specifies the diameter of rasterized points. The initial value is 1.
|
||||
@@ -860,7 +861,7 @@ including advanced features.
|
||||
|
||||
Select a polygon rasterization mode
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonMode.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonMode.xml>`__
|
||||
|
||||
:type face: Enumerated constant
|
||||
:arg face: Specifies the polygons that mode applies to.
|
||||
@@ -875,7 +876,7 @@ including advanced features.
|
||||
|
||||
Set the scale and units used to calculate depth values
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonOffset.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glPolygonOffset.xml>`__
|
||||
|
||||
:type factor: float
|
||||
:arg factor: Specifies a scale factor that is used to create a variable depth
|
||||
@@ -895,7 +896,7 @@ including advanced features.
|
||||
|
||||
Specify the raster position for pixel operations
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRasterPos.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRasterPos.xml>`__
|
||||
|
||||
:type x, y, z, w: Depends on function prototype. (z and w for '3' and '4' prototypes only)
|
||||
:arg x, y, z, w: Specify the x,y,z, and w object coordinates (if present) for the
|
||||
@@ -927,7 +928,7 @@ including advanced features.
|
||||
|
||||
Select a color buffer source for pixels.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadBuffer.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadBuffer.xml>`__
|
||||
|
||||
:type mode: Enumerated constant
|
||||
:arg mode: Specifies a color buffer.
|
||||
@@ -937,7 +938,7 @@ including advanced features.
|
||||
|
||||
Read a block of pixels from the frame buffer
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glReadPixels.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the window coordinates of the first pixel that is read
|
||||
@@ -960,7 +961,7 @@ including advanced features.
|
||||
|
||||
Draw a rectangle
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRect.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRect.xml>`__
|
||||
|
||||
:type x1, y1: Depends on function prototype. (for non 'v' prototypes only)
|
||||
:arg x1, y1: Specify one vertex of a rectangle
|
||||
@@ -977,7 +978,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a rotation matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glRotate.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml>`__
|
||||
|
||||
:type angle: Depends on function prototype.
|
||||
:arg angle: Specifies the angle of rotation in degrees.
|
||||
@@ -991,7 +992,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a general scaling matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScale.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml>`__
|
||||
|
||||
:type x, y, z: Depends on function prototype.
|
||||
:arg x, y, z: Specify scale factors along the x, y, and z axes, respectively.
|
||||
@@ -1001,7 +1002,7 @@ including advanced features.
|
||||
|
||||
Define the scissor box
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glScissor.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glScissor.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the lower left corner of the scissor box. Initially (0, 0).
|
||||
@@ -1015,7 +1016,7 @@ including advanced features.
|
||||
|
||||
Set function and reference value for stencil testing
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glStencilFunc.xml>`__
|
||||
|
||||
:type func: Enumerated constant
|
||||
:arg func: Specifies the test function.
|
||||
@@ -1032,7 +1033,7 @@ including advanced features.
|
||||
|
||||
Control the writing of individual bits in the stencil planes
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilMask.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilMask.xml>`__
|
||||
|
||||
:type mask: unsigned int
|
||||
:arg mask: Specifies a bit mask to enable and disable writing of individual bits
|
||||
@@ -1043,7 +1044,7 @@ including advanced features.
|
||||
|
||||
Set stencil test actions
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilOp.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glStencilOp.xml>`__
|
||||
|
||||
:type fail: Enumerated constant
|
||||
:arg fail: Specifies the action to take when the stencil test fails.
|
||||
@@ -1071,7 +1072,7 @@ including advanced features.
|
||||
|
||||
Set the current texture coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexCoord.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexCoord.xml>`__
|
||||
|
||||
:type s, t, r, q: Depends on function prototype. (r and q for '3' and '4' prototypes only)
|
||||
:arg s, t, r, q: Specify s, t, r, and q texture coordinates. Not all parameters are
|
||||
@@ -1087,7 +1088,7 @@ including advanced features.
|
||||
|
||||
Set texture environment parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexEnv.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexEnv.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies a texture environment. Must be GL_TEXTURE_ENV.
|
||||
@@ -1106,7 +1107,7 @@ including advanced features.
|
||||
|
||||
Control the generation of texture coordinates
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexGen.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml>`__
|
||||
|
||||
:type coord: Enumerated constant
|
||||
:arg coord: Specifies a texture coordinate.
|
||||
@@ -1124,7 +1125,7 @@ including advanced features.
|
||||
|
||||
Specify a one-dimensional texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage1D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage1D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1151,7 +1152,7 @@ including advanced features.
|
||||
|
||||
Specify a two-dimensional texture image
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexImage2D.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1184,7 +1185,7 @@ including advanced features.
|
||||
|
||||
Set texture parameters
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTexParameter.xml>`__
|
||||
|
||||
:type target: Enumerated constant
|
||||
:arg target: Specifies the target texture.
|
||||
@@ -1201,7 +1202,7 @@ including advanced features.
|
||||
|
||||
Multiply the current matrix by a translation matrix
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glTranslate.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml>`__
|
||||
|
||||
:type x, y, z: Depends on function prototype.
|
||||
:arg x, y, z: Specify the x, y, and z coordinates of a translation vector.
|
||||
@@ -1211,7 +1212,7 @@ including advanced features.
|
||||
|
||||
Set the viewport
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glViewport.xml>`__
|
||||
|
||||
:type x, y: int
|
||||
:arg x, y: Specify the lower left corner of the viewport rectangle,
|
||||
@@ -1226,7 +1227,7 @@ including advanced features.
|
||||
|
||||
Installs a program object as part of current rendering state
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glUseProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glUseProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object whose executables are to be used as part of current rendering state.
|
||||
@@ -1236,7 +1237,7 @@ including advanced features.
|
||||
|
||||
Validates a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glValidateProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glValidateProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object to be validated.
|
||||
@@ -1246,7 +1247,7 @@ including advanced features.
|
||||
|
||||
Links a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glLinkProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glLinkProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the handle of the program object to be linked.
|
||||
@@ -1256,7 +1257,7 @@ including advanced features.
|
||||
|
||||
Select active texture unit.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glActiveTexture.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml>`__
|
||||
|
||||
:type texture: int
|
||||
:arg texture: Constant in ``GL_TEXTURE0`` 0 - 8
|
||||
@@ -1266,7 +1267,7 @@ including advanced features.
|
||||
|
||||
Attaches a shader object to a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glAttachShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glAttachShader.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to which a shader object will be attached.
|
||||
@@ -1278,7 +1279,7 @@ including advanced features.
|
||||
|
||||
Compiles a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCompileShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCompileShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be compiled.
|
||||
@@ -1288,7 +1289,7 @@ including advanced features.
|
||||
|
||||
Creates a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateProgram.xml>`__
|
||||
|
||||
:rtype: int
|
||||
:return: The new program or zero if an error occurs.
|
||||
@@ -1298,7 +1299,7 @@ including advanced features.
|
||||
|
||||
Creates a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glCreateShader.xml>`__
|
||||
|
||||
:type shaderType: Specifies the type of shader to be created.
|
||||
Must be one of ``GL_VERTEX_SHADER``,
|
||||
@@ -1315,7 +1316,7 @@ including advanced features.
|
||||
|
||||
Deletes a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be deleted.
|
||||
@@ -1325,7 +1326,7 @@ including advanced features.
|
||||
|
||||
Deletes a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDeleteShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be deleted.
|
||||
@@ -1335,7 +1336,7 @@ including advanced features.
|
||||
|
||||
Detaches a shader object from a program object to which it is attached.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glDetachShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glDetachShader.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object from which to detach the shader object.
|
||||
@@ -1347,7 +1348,7 @@ including advanced features.
|
||||
|
||||
Returns the handles of the shader objects attached to a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetAttachedShaders.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetAttachedShaders.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be queried.
|
||||
@@ -1363,7 +1364,7 @@ including advanced features.
|
||||
|
||||
Returns the information log for a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgramInfoLog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgramInfoLog.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object whose information log is to be queried.
|
||||
@@ -1379,7 +1380,7 @@ including advanced features.
|
||||
|
||||
Returns the information log for a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderInfoLog.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderInfoLog.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object whose information log is to be queried.
|
||||
@@ -1395,7 +1396,7 @@ including advanced features.
|
||||
|
||||
Returns a parameter from a program object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies the program object to be queried.
|
||||
@@ -1409,7 +1410,7 @@ including advanced features.
|
||||
|
||||
Determines if a name corresponds to a shader object.
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsShader.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsShader.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies a potential shader object.
|
||||
@@ -1419,7 +1420,7 @@ including advanced features.
|
||||
|
||||
Determines if a name corresponds to a program object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glIsProgram.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glIsProgram.xml>`__
|
||||
|
||||
:type program: int
|
||||
:arg program: Specifies a potential program object.
|
||||
@@ -1429,7 +1430,7 @@ including advanced features.
|
||||
|
||||
Returns the source code string from a shader object
|
||||
|
||||
.. seealso:: `OpenGL Docs <https://khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderSource.xhtml>`__
|
||||
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetShaderSource.xml>`__
|
||||
|
||||
:type shader: int
|
||||
:arg shader: Specifies the shader object to be queried.
|
||||
|
@@ -5,6 +5,17 @@
|
||||
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
|
||||
|
||||
|
||||
Submodules:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
bmesh.ops.rst
|
||||
bmesh.types.rst
|
||||
bmesh.utils.rst
|
||||
bmesh.geometry.rst
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
|
@@ -677,8 +677,7 @@ Here are some general hints to avoid running into these problems:
|
||||
Undo/Redo
|
||||
---------
|
||||
|
||||
For safety, you should assume that undo and redo always invalidates all :class:`bpy.types.ID`
|
||||
instances (Object, Scene, Mesh, Light, etc.), as weel obviously as all of their sub-data.
|
||||
Undo invalidates all :class:`bpy.types.ID` instances (Object, Scene, Mesh, Light, etc.).
|
||||
|
||||
This example shows how you can tell undo changes the memory locations:
|
||||
|
||||
@@ -687,7 +686,7 @@ This example shows how you can tell undo changes the memory locations:
|
||||
>>> hash(bpy.context.object)
|
||||
-9223372036849950810
|
||||
|
||||
Delete the active object, then undo:
|
||||
Move the active object, then undo:
|
||||
|
||||
>>> hash(bpy.context.object)
|
||||
-9223372036849951740
|
||||
@@ -696,16 +695,6 @@ As suggested above, simply not holding references to data when Blender is used
|
||||
interactively by the user is the only way to make sure that the script doesn't become unstable.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Modern undo/redo system does not systematically invalidate all pointers anymore.
|
||||
Some data (in fact, most data, in typical cases), which were detected as unchanged for a
|
||||
particular history step, may remain unchanged and hence their pointers may remain valid.
|
||||
|
||||
Be aware that if you want to take advantage of this behavior for some reason, there is no
|
||||
guarantee of any kind that it will be safe and consistent. Use it at your own risk.
|
||||
|
||||
|
||||
Undo & Library Data
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -723,17 +712,6 @@ So it's best to consider modifying library data an advanced usage of the API
|
||||
and only to use it when you know what you're doing.
|
||||
|
||||
|
||||
Abusing RNA property callbacks
|
||||
------------------------------
|
||||
|
||||
Python-defined RNA properties can have custom callbacks. Trying to perform complex operations
|
||||
from there, like calling an operator, may work, but is not officialy recommended nor supported.
|
||||
|
||||
Main reason is that those callback should be very fast, but additionally, it may for example
|
||||
create issues with undo/redo system (most operators store an history step, and editing an RNA
|
||||
property does so as well), trigger infinite update loops, and so on.
|
||||
|
||||
|
||||
Edit-Mode / Memory Access
|
||||
-------------------------
|
||||
|
||||
|
@@ -49,6 +49,10 @@ This module gives access to low level bmesh operations.
|
||||
Most operators take input and return output, they can be chained together
|
||||
to perform useful operations.
|
||||
|
||||
.. note::
|
||||
|
||||
This API us new in 2.65 and not yet well tested.
|
||||
|
||||
|
||||
Operator Example
|
||||
++++++++++++++++
|
||||
|
@@ -41,7 +41,8 @@ Sphinx: HTML generation
|
||||
After you have built doc/python_api/sphinx-in (see above),
|
||||
generate html docs by running:
|
||||
|
||||
sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
|
||||
cd doc/python_api
|
||||
sphinx-build sphinx-in sphinx-out
|
||||
|
||||
|
||||
Sphinx: PDF generation
|
||||
@@ -92,13 +93,12 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
# For now, ignore add-ons and internal subclasses of 'bpy.types.PropertyGroup'.
|
||||
#
|
||||
# Besides disabling this line, the main change will be to add a
|
||||
# 'toctree' to 'write_rst_index' which contains the generated rst files.
|
||||
# 'toctree' to 'write_rst_contents' which contains the generated rst files.
|
||||
# This 'toctree' can be generated automatically.
|
||||
#
|
||||
# See: D6261 for reference.
|
||||
USE_ONLY_BUILTIN_RNA_TYPES = True
|
||||
|
||||
|
||||
def handle_args():
|
||||
'''
|
||||
Parse the args passed to Blender after "--", ignored by Blender
|
||||
@@ -173,7 +173,7 @@ def handle_args():
|
||||
dest="log",
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Log the output of the API dump and sphinx|latex "
|
||||
help="Log the output of the api dump and sphinx|latex "
|
||||
"warnings and errors (default=False).\n"
|
||||
"If given, save logs in:\n"
|
||||
"* OUTPUT_DIR/.bpy.log\n"
|
||||
@@ -244,7 +244,6 @@ else:
|
||||
"bpy.types", # supports filtering
|
||||
"bpy.utils",
|
||||
"bpy.utils.previews",
|
||||
"bpy.utils.units",
|
||||
"bpy_extras",
|
||||
"gpu",
|
||||
"gpu.types",
|
||||
@@ -351,9 +350,9 @@ RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
|
||||
# stored in ./rst/info_*
|
||||
INFO_DOCS = (
|
||||
("info_quickstart.rst",
|
||||
"Quickstart: New to Blender or scripting and want to get your feet wet?"),
|
||||
"Quickstart: new to Blender or scripting and want to get your feet wet?"),
|
||||
("info_overview.rst",
|
||||
"API Overview: A more complete explanation of Python integration"),
|
||||
"API Overview: a more complete explanation of Python integration"),
|
||||
("info_api_reference.rst",
|
||||
"API Reference Usage: examples of how to use the API reference docs"),
|
||||
("info_best_practice.rst",
|
||||
@@ -361,8 +360,8 @@ INFO_DOCS = (
|
||||
("info_tips_and_tricks.rst",
|
||||
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
|
||||
("info_gotcha.rst",
|
||||
"Gotcha's: Some of the problems you may encounter when writing scripts"),
|
||||
("change_log.rst", "Change Log: List of changes since last Blender release"),
|
||||
"Gotcha's: some of the problems you may encounter when writing scripts"),
|
||||
("change_log.rst", "List of changes since last Blender release"),
|
||||
)
|
||||
|
||||
# only support for properties atm.
|
||||
@@ -496,13 +495,6 @@ else:
|
||||
bpy_struct = None
|
||||
|
||||
|
||||
def import_value_from_module(module_name, import_name):
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as value" % (module_name, import_name)
|
||||
exec(exec_str, ns, ns)
|
||||
return ns["value"]
|
||||
|
||||
|
||||
def escape_rst(text):
|
||||
""" Escape plain text which may contain characters used by RST.
|
||||
"""
|
||||
@@ -752,12 +744,13 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
|
||||
else:
|
||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, py_prop.__doc__)
|
||||
fw("\n")
|
||||
if py_prop.fset is None:
|
||||
fw(ident + " (readonly)\n\n")
|
||||
else:
|
||||
fw("\n")
|
||||
|
||||
|
||||
def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
def pymodule2sphinx(basepath, module_name, module, title):
|
||||
import types
|
||||
attribute_set = set()
|
||||
filepath = os.path.join(basepath, module_name + ".rst")
|
||||
@@ -804,51 +797,42 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
fw(module.__doc__.strip())
|
||||
fw("\n\n")
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write submodules
|
||||
# we could also scan files but this ensures __all__ is used correctly
|
||||
if module_all or module_all_extra:
|
||||
if module_all is not None:
|
||||
submod_name = None
|
||||
submod = None
|
||||
submod_ls = []
|
||||
for submod_name in (module_all or ()):
|
||||
submod = import_value_from_module(module_name, submod_name)
|
||||
for submod_name in module_all:
|
||||
ns = {}
|
||||
exec_str = "from %s import %s as submod" % (module.__name__, submod_name)
|
||||
exec(exec_str, ns, ns)
|
||||
submod = ns["submod"]
|
||||
if type(submod) == types.ModuleType:
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
for submod_name in module_all_extra:
|
||||
if submod_name in attribute_set:
|
||||
continue
|
||||
submod = import_value_from_module(module_name, submod_name)
|
||||
# No type checks, since there are non-module types we treat as modules
|
||||
# such as `bpy.app.translations` & `bpy.app.handlers`.
|
||||
submod_ls.append((submod_name, submod))
|
||||
|
||||
del submod_name
|
||||
del submod
|
||||
|
||||
if submod_ls:
|
||||
fw(".. toctree::\n")
|
||||
fw(" :maxdepth: 1\n")
|
||||
fw(" :caption: Submodules\n\n")
|
||||
fw(" :maxdepth: 1\n\n")
|
||||
|
||||
for submod_name, submod in submod_ls:
|
||||
submod_name_full = "%s.%s" % (module_name, submod_name)
|
||||
fw(" %s.rst\n" % submod_name_full)
|
||||
fw(" %s.rst\n\n" % submod_name_full)
|
||||
|
||||
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name, ())
|
||||
fw("\n")
|
||||
pymodule2sphinx(basepath, submod_name_full, submod, "%s submodule" % module_name)
|
||||
del submod_ls
|
||||
# done writing submodules!
|
||||
|
||||
write_example_ref("", fw, module_name)
|
||||
|
||||
# write members of the module
|
||||
# only tested with PyStructs which are not exactly modules
|
||||
for key, descr in sorted(type(module).__dict__.items()):
|
||||
if key.startswith("__"):
|
||||
continue
|
||||
if key in module_all_extra:
|
||||
continue
|
||||
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
|
||||
|
||||
# type_name is only used for examples and messages
|
||||
@@ -871,8 +855,6 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
# sort by the valye type
|
||||
descr_sorted.sort(key=lambda descr_data: str(descr_data[3]))
|
||||
for key, descr, value, value_type in descr_sorted:
|
||||
if key in module_all_extra:
|
||||
continue
|
||||
|
||||
# must be documented as a submodule
|
||||
if is_struct_seq(value):
|
||||
@@ -914,9 +896,6 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
|
||||
|
||||
for attribute, value, value_type in module_dir_value_type:
|
||||
if attribute in module_all_extra:
|
||||
continue
|
||||
|
||||
if value_type == FunctionType:
|
||||
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
||||
# both the same at the moment but to be future proof
|
||||
@@ -1075,7 +1054,6 @@ context_type_map = {
|
||||
"selected_bones": ("EditBone", True),
|
||||
"selected_editable_bones": ("EditBone", True),
|
||||
"selected_editable_fcurves": ("FCurve", True),
|
||||
"selected_editable_keyframes": ("Keyframe", True),
|
||||
"selected_editable_objects": ("Object", True),
|
||||
"selected_editable_sequences": ("Sequence", True),
|
||||
"selected_nla_strips": ("NlaStrip", True),
|
||||
@@ -1117,7 +1095,7 @@ def pycontext2sphinx(basepath):
|
||||
fw("The context members available depend on the area of Blender which is currently being accessed.\n")
|
||||
fw("\n")
|
||||
fw("Note that all context values are readonly,\n")
|
||||
fw("but may be modified through the data API or by running operators\n\n")
|
||||
fw("but may be modified through the data api or by running operators\n\n")
|
||||
|
||||
def write_contex_cls():
|
||||
|
||||
@@ -1226,7 +1204,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
|
||||
identifier,
|
||||
# Account for multi-line enum descriptions, allowing this to be a block of text.
|
||||
indent(", ".join(escape_rst(val) for val in (name, description) if val) or "Undocumented", " "),
|
||||
)
|
||||
)
|
||||
for identifier, name, description in prop.enum_items
|
||||
])
|
||||
else:
|
||||
@@ -1334,7 +1312,7 @@ def pyrna2sphinx(basepath):
|
||||
|
||||
fw(title_string(title, "="))
|
||||
|
||||
fw(".. currentmodule:: %s\n\n" % struct_module_name)
|
||||
fw(".. module:: %s.%s\n\n" % (struct_module_name, struct_id))
|
||||
|
||||
# docs first?, ok
|
||||
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
|
||||
@@ -1565,7 +1543,8 @@ def pyrna2sphinx(basepath):
|
||||
|
||||
fw(title_string(class_name, "="))
|
||||
|
||||
fw(".. currentmodule:: %s\n\n" % class_module_name)
|
||||
fw(".. module:: %s.%s\n" % (class_module_name, class_name))
|
||||
fw("\n")
|
||||
|
||||
if use_subclasses:
|
||||
subclass_ids = [
|
||||
@@ -1579,7 +1558,7 @@ def pyrna2sphinx(basepath):
|
||||
fw(".. class:: %s\n\n" % class_name)
|
||||
fw(" %s\n\n" % descr_str)
|
||||
fw(" .. note::\n\n")
|
||||
fw(" Note that :class:`%s.%s` is not actually available from within Blender,\n"
|
||||
fw(" Note that %s.%s is not actually available from within Blender,\n"
|
||||
" it only exists for the purpose of documentation.\n\n" % (class_module_name, class_name))
|
||||
|
||||
descr_items = [
|
||||
@@ -1694,26 +1673,15 @@ def write_sphinx_conf_py(basepath):
|
||||
fw("]\n\n")
|
||||
|
||||
fw("html_title = 'Blender Python API'\n")
|
||||
|
||||
fw("html_theme = 'default'\n")
|
||||
# The theme 'sphinx_rtd_theme' is no longer distributed with sphinx by default, only use when available.
|
||||
fw(r"""
|
||||
try:
|
||||
__import__('sphinx_rtd_theme')
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
""")
|
||||
|
||||
fw("if html_theme == 'sphinx_rtd_theme':\n")
|
||||
fw(" html_theme_options = {\n")
|
||||
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
|
||||
# fw(" 'analytics_id': '',\n")
|
||||
# fw(" 'collapse_navigation': True,\n")
|
||||
fw(" 'sticky_navigation': False,\n")
|
||||
fw(" 'navigation_depth': 1,\n")
|
||||
# fw(" 'includehidden': True,\n")
|
||||
# fw(" 'titles_only': False\n")
|
||||
fw("html_theme = 'sphinx_rtd_theme'\n")
|
||||
fw("html_theme_options = {\n")
|
||||
fw(" 'canonical_url': 'https://docs.blender.org/api/current/',\n")
|
||||
# fw(" 'analytics_id': '',\n")
|
||||
# fw(" 'collapse_navigation': True,\n")
|
||||
fw(" 'sticky_navigation': False,\n")
|
||||
fw(" 'navigation_depth': 1,\n")
|
||||
# fw(" 'includehidden': True,\n")
|
||||
# fw(" 'titles_only': False\n")
|
||||
fw(" }\n\n")
|
||||
|
||||
# not helpful since the source is generated, adds to upload size.
|
||||
@@ -1762,7 +1730,7 @@ def execfile(filepath):
|
||||
file_handle.close()
|
||||
|
||||
|
||||
def write_rst_index(basepath):
|
||||
def write_rst_contents(basepath):
|
||||
'''
|
||||
Write the rst file of the main page, needed for sphinx (index.html)
|
||||
'''
|
||||
@@ -1802,6 +1770,7 @@ def write_rst_index(basepath):
|
||||
|
||||
# py modules
|
||||
"bpy.utils",
|
||||
"bpy.utils.previews",
|
||||
"bpy.path",
|
||||
"bpy.app",
|
||||
|
||||
@@ -1839,10 +1808,6 @@ def write_rst_index(basepath):
|
||||
fw(" %s\n" % mod)
|
||||
fw("\n")
|
||||
|
||||
fw(title_string("Indices", "="))
|
||||
fw("* :ref:`genindex`\n")
|
||||
fw("* :ref:`modindex`\n\n")
|
||||
|
||||
# special case, this 'bmesh.ops.rst' is extracted from C source
|
||||
if "bmesh.ops" not in EXCLUDE_MODULES:
|
||||
execfile(os.path.join(SCRIPT_DIR, "rst_from_bmesh_opdefines.py"))
|
||||
@@ -1878,7 +1843,6 @@ def write_rst_types_index(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Types (bpy.types)", "="))
|
||||
fw(".. module:: bpy.types\n\n")
|
||||
fw(".. toctree::\n")
|
||||
fw(" :glob:\n\n")
|
||||
fw(" bpy.types.*\n\n")
|
||||
@@ -1894,10 +1858,8 @@ def write_rst_ops_index(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Operators (bpy.ops)", "="))
|
||||
fw(".. module:: bpy.ops\n\n")
|
||||
write_example_ref("", fw, "bpy.ops")
|
||||
fw(".. toctree::\n")
|
||||
fw(" :caption: Submodules\n")
|
||||
fw(" :glob:\n\n")
|
||||
fw(" bpy.ops.*\n\n")
|
||||
file.close()
|
||||
@@ -1922,7 +1884,7 @@ def write_rst_msgbus(basepath):
|
||||
file.close()
|
||||
|
||||
# Write the contents.
|
||||
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus', ())
|
||||
pymodule2sphinx(basepath, 'bpy.msgbus', bpy.msgbus, 'Message Bus')
|
||||
EXAMPLE_SET_USED.add("bpy.msgbus")
|
||||
|
||||
|
||||
@@ -1937,7 +1899,7 @@ def write_rst_data(basepath):
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
fw(title_string("Data Access (bpy.data)", "="))
|
||||
fw(".. module:: bpy.data\n")
|
||||
fw(".. module:: bpy\n")
|
||||
fw("\n")
|
||||
fw("This module is used for all Blender/Python access.\n")
|
||||
fw("\n")
|
||||
@@ -1974,7 +1936,6 @@ def write_rst_importable_modules(basepath):
|
||||
"gpu.select": "GPU Select",
|
||||
"gpu.shader": "GPU Shader",
|
||||
"bmesh": "BMesh Module",
|
||||
"bmesh.ops": "BMesh Operators",
|
||||
"bmesh.types": "BMesh Types",
|
||||
"bmesh.utils": "BMesh Utilities",
|
||||
"bmesh.geometry": "BMesh Geometry Utilities",
|
||||
@@ -2000,32 +1961,11 @@ def write_rst_importable_modules(basepath):
|
||||
"freestyle.shaders": "Freestyle Shaders",
|
||||
"freestyle.utils": "Freestyle Utilities",
|
||||
}
|
||||
|
||||
# This is needed since some of the sub-modules listed above are not actual modules.
|
||||
# Examples include `bpy.app.translations` & `bpy.app.handlers`.
|
||||
#
|
||||
# Most of these are `PyStructSequence` internally,
|
||||
# however we don't want to document all of these as modules since some only contain
|
||||
# a few values (version number for e.g).
|
||||
#
|
||||
# If we remove this logic and document all `PyStructSequence` as sub-modules it means
|
||||
# `bpy.app.timers` for example would be presented on the same level as library information
|
||||
# access such as `bpy.app.sdl` which doesn't seem useful since it hides more useful
|
||||
# module-like objects among library data access.
|
||||
importable_modules_parent_map = {}
|
||||
for mod_name in importable_modules.keys():
|
||||
if mod_name in EXCLUDE_MODULES:
|
||||
continue
|
||||
if "." in mod_name:
|
||||
mod_name, submod_name = mod_name.rsplit(".", 1)
|
||||
importable_modules_parent_map.setdefault(mod_name, []).append(submod_name)
|
||||
|
||||
for mod_name, mod_descr in importable_modules.items():
|
||||
if mod_name in EXCLUDE_MODULES:
|
||||
continue
|
||||
module_all_extra = importable_modules_parent_map.get(mod_name, ())
|
||||
module = __import__(mod_name, fromlist=[mod_name.rsplit(".", 1)[-1]])
|
||||
pymodule2sphinx(basepath, mod_name, module, mod_descr, module_all_extra)
|
||||
if mod_name not in EXCLUDE_MODULES:
|
||||
module = __import__(mod_name,
|
||||
fromlist=[mod_name.rsplit(".", 1)[-1]])
|
||||
pymodule2sphinx(basepath, mod_name, module, mod_descr)
|
||||
|
||||
|
||||
def copy_handwritten_rsts(basepath):
|
||||
@@ -2090,7 +2030,7 @@ def rna2sphinx(basepath):
|
||||
write_sphinx_conf_py(basepath)
|
||||
|
||||
# main page
|
||||
write_rst_index(basepath)
|
||||
write_rst_contents(basepath)
|
||||
|
||||
# context
|
||||
if "bpy.context" not in EXCLUDE_MODULES:
|
||||
@@ -2287,7 +2227,7 @@ def main():
|
||||
shutil.rmtree(REFERENCE_PATH, True)
|
||||
|
||||
# copy SPHINX_OUT to the REFERENCE_PATH
|
||||
ignores = ('.doctrees', '.buildinfo')
|
||||
ignores = ('.doctrees', 'objects.inv', '.buildinfo')
|
||||
shutil.copytree(SPHINX_OUT,
|
||||
REFERENCE_PATH,
|
||||
ignore=shutil.ignore_patterns(*ignores))
|
||||
|
@@ -76,7 +76,11 @@ fi
|
||||
# Generate HTML (sphinx)
|
||||
|
||||
if $DO_OUT_HTML ; then
|
||||
sphinx-build -b html -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
# sphinx-build -n -b html $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
|
||||
# annoying bug in sphinx makes it very slow unless we do this. should report.
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -b html sphinx-in sphinx-out
|
||||
|
||||
# XXX, saves space on upload and zip, should move HTML outside
|
||||
# and zip up there, for now this is OK
|
||||
@@ -103,7 +107,8 @@ fi
|
||||
# Generate PDF (sphinx/laytex)
|
||||
|
||||
if $DO_OUT_PDF ; then
|
||||
sphinx-build -n -b latex -j auto $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
cd $SPHINX_WORKDIR
|
||||
sphinx-build -n -b latex $SPHINX_WORKDIR/sphinx-in $SPHINX_WORKDIR/sphinx-out
|
||||
make -C $SPHINX_WORKDIR/sphinx-out
|
||||
mv $SPHINX_WORKDIR/sphinx-out/contents.pdf \
|
||||
$SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf
|
||||
|
@@ -9,7 +9,3 @@
|
||||
/* Hide home icon in search area */
|
||||
.wy-side-nav-search > a:hover {background: none; opacity: 0.9}
|
||||
.wy-side-nav-search > a.icon::before {content: none}
|
||||
|
||||
.wy-nav-content {
|
||||
max-width: 1000px !important;
|
||||
}
|
||||
|
8
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
8
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
@@ -270,7 +270,7 @@ AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int sampl
|
||||
return length;
|
||||
}
|
||||
|
||||
AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
|
||||
AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -280,7 +280,7 @@ AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned i
|
||||
std::shared_ptr<IReader> reader = f->createQualityReader();
|
||||
reader->seek(start);
|
||||
std::shared_ptr<IWriter> writer = FileWriter::createWriter(filename, convCToDSpec(specs), static_cast<Container>(format), static_cast<Codec>(codec), bitrate);
|
||||
FileWriter::writeReader(reader, writer, length, buffersize, callback, data);
|
||||
FileWriter::writeReader(reader, writer, length, buffersize);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -290,7 +290,7 @@ AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned i
|
||||
}
|
||||
}
|
||||
|
||||
AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
|
||||
AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -326,7 +326,7 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start
|
||||
|
||||
std::shared_ptr<IReader> reader = f->createQualityReader();
|
||||
reader->seek(start);
|
||||
FileWriter::writeReader(reader, writers, length, buffersize, callback, data);
|
||||
FileWriter::writeReader(reader, writers, length, buffersize);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
10
extern/audaspace/bindings/C/AUD_Special.h
vendored
10
extern/audaspace/bindings/C/AUD_Special.h
vendored
@@ -68,15 +68,12 @@ extern AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, in
|
||||
* \param format The file's container format.
|
||||
* \param codec The codec used for encoding the audio data.
|
||||
* \param bitrate The bitrate for encoding.
|
||||
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
|
||||
* \param data Pass through parameter that is passed to the callback.
|
||||
* \return An error message or NULL in case of success.
|
||||
*/
|
||||
extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
unsigned int buffersize, const char* filename,
|
||||
AUD_DeviceSpecs specs, AUD_Container format,
|
||||
AUD_Codec codec, unsigned int bitrate,
|
||||
void(*callback)(float, void*), void* data);
|
||||
AUD_Codec codec, unsigned int bitrate);
|
||||
|
||||
/**
|
||||
* Mixes a sound down into multiple files.
|
||||
@@ -89,15 +86,12 @@ extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, uns
|
||||
* \param format The file's container format.
|
||||
* \param codec The codec used for encoding the audio data.
|
||||
* \param bitrate The bitrate for encoding.
|
||||
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
|
||||
* \param data Pass through parameter that is passed to the callback.
|
||||
* \return An error message or NULL in case of success.
|
||||
*/
|
||||
extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
unsigned int buffersize, const char* filename,
|
||||
AUD_DeviceSpecs specs, AUD_Container format,
|
||||
AUD_Codec codec, unsigned int bitrate,
|
||||
void(*callback)(float, void*), void* data);
|
||||
AUD_Codec codec, unsigned int bitrate);
|
||||
|
||||
/**
|
||||
* Opens a read device and prepares it for mixdown of the sound scene.
|
||||
|
@@ -60,7 +60,7 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
|
||||
".. classmethod:: play(sound, catKey)\n\n"
|
||||
".. classmethod:: setVolume(sound, catKey)\n\n"
|
||||
" Plays a sound through the playback manager and assigns it to a category.\n\n"
|
||||
" :arg sound: The sound to play.\n"
|
||||
" :type sound: :class:`Sound`\n"
|
||||
|
4
extern/audaspace/include/file/FileWriter.h
vendored
4
extern/audaspace/include/file/FileWriter.h
vendored
@@ -63,7 +63,7 @@ public:
|
||||
* \param length How many samples should be transferred.
|
||||
* \param buffersize How many samples should be transferred at once.
|
||||
*/
|
||||
static void writeReader(std::shared_ptr<IReader> reader, std::shared_ptr<IWriter> writer, unsigned int length, unsigned int buffersize, void(*callback)(float, void*) = nullptr, void* data = nullptr);
|
||||
static void writeReader(std::shared_ptr<IReader> reader, std::shared_ptr<IWriter> writer, unsigned int length, unsigned int buffersize);
|
||||
|
||||
/**
|
||||
* Writes a reader to several writers.
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
* \param length How many samples should be transferred.
|
||||
* \param buffersize How many samples should be transferred at once.
|
||||
*/
|
||||
static void writeReader(std::shared_ptr<IReader> reader, std::vector<std::shared_ptr<IWriter> >& writers, unsigned int length, unsigned int buffersize, void(*callback)(float, void*) = nullptr, void* data = nullptr);
|
||||
static void writeReader(std::shared_ptr<IReader> reader, std::vector<std::shared_ptr<IWriter> >& writers, unsigned int length, unsigned int buffersize);
|
||||
};
|
||||
|
||||
AUD_NAMESPACE_END
|
||||
|
20
extern/audaspace/src/file/FileWriter.cpp
vendored
20
extern/audaspace/src/file/FileWriter.cpp
vendored
@@ -27,7 +27,7 @@ std::shared_ptr<IWriter> FileWriter::createWriter(std::string filename,DeviceSpe
|
||||
return FileManager::createWriter(filename, specs, format, codec, bitrate);
|
||||
}
|
||||
|
||||
void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::shared_ptr<IWriter> writer, unsigned int length, unsigned int buffersize, void(*callback)(float, void*), void* data)
|
||||
void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::shared_ptr<IWriter> writer, unsigned int length, unsigned int buffersize)
|
||||
{
|
||||
Buffer buffer(buffersize * AUD_SAMPLE_SIZE(writer->getSpecs()));
|
||||
sample_t* buf = buffer.getBuffer();
|
||||
@@ -53,18 +53,10 @@ void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::shared_ptr<IW
|
||||
}
|
||||
|
||||
writer->write(len, buf);
|
||||
|
||||
if(callback)
|
||||
{
|
||||
float progress = -1;
|
||||
if(length > 0)
|
||||
progress = pos / float(length);
|
||||
callback(progress, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::vector<std::shared_ptr<IWriter> >& writers, unsigned int length, unsigned int buffersize, void(*callback)(float, void*), void* data)
|
||||
void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::vector<std::shared_ptr<IWriter> >& writers, unsigned int length, unsigned int buffersize)
|
||||
{
|
||||
Buffer buffer(buffersize * AUD_SAMPLE_SIZE(reader->getSpecs()));
|
||||
Buffer buffer2(buffersize * sizeof(sample_t));
|
||||
@@ -97,14 +89,6 @@ void FileWriter::writeReader(std::shared_ptr<IReader> reader, std::vector<std::s
|
||||
|
||||
writers[channel]->write(len, buf2);
|
||||
}
|
||||
|
||||
if(callback)
|
||||
{
|
||||
float progress = -1;
|
||||
if(length > 0)
|
||||
progress = pos / float(length);
|
||||
callback(progress, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user