Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r--build_files/cmake/Modules/FindBrotli.cmake83
-rw-r--r--build_files/cmake/Modules/FindFFmpeg.cmake6
-rw-r--r--build_files/cmake/Modules/FindHIP.cmake81
-rw-r--r--build_files/cmake/Modules/FindOptiX.cmake2
4 files changed, 169 insertions, 3 deletions
diff --git a/build_files/cmake/Modules/FindBrotli.cmake b/build_files/cmake/Modules/FindBrotli.cmake
new file mode 100644
index 00000000000..d1e40b1966a
--- /dev/null
+++ b/build_files/cmake/Modules/FindBrotli.cmake
@@ -0,0 +1,83 @@
+# - Find Brotli library (compression for freetype/woff2).
+# This module defines
+# BROTLI_INCLUDE_DIRS, where to find Brotli headers, Set when
+# BROTLI_INCLUDE_DIR is found.
+# BROTLI_LIBRARIES, libraries to link against to use Brotli.
+# BROTLI_ROOT_DIR, The base directory to search for Brotli.
+# This can also be an environment variable.
+# BROTLI_FOUND, If false, do not try to use Brotli.
+#
+
+#=============================================================================
+# Copyright 2022 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD 3-Clause License,
+# see accompanying file BSD-3-Clause-license.txt for details.
+#=============================================================================
+
+# If BROTLI_ROOT_DIR was defined in the environment, use it.
+IF(NOT BROTLI_ROOT_DIR AND NOT $ENV{BROTLI_ROOT_DIR} STREQUAL "")
+ SET(BROTLI_ROOT_DIR $ENV{BROTLI_ROOT_DIR})
+ENDIF()
+
+SET(_BROTLI_SEARCH_DIRS
+ ${BROTLI_ROOT_DIR}
+)
+
+FIND_PATH(BROTLI_INCLUDE_DIR
+ NAMES
+ brotli/decode.h
+ HINTS
+ ${_BROTLI_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include
+ DOC "Brotli header files"
+)
+
+FIND_LIBRARY(BROTLI_LIBRARY_COMMON
+ NAMES
+ # Some builds use a special `-static` postfix in their static libraries names.
+ brotlicommon-static
+ brotlicommon
+ HINTS
+ ${_BROTLI_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib lib/static
+ DOC "Brotli static common library"
+)
+FIND_LIBRARY(BROTLI_LIBRARY_DEC
+ NAMES
+ # Some builds use a special `-static` postfix in their static libraries names.
+ brotlidec-static
+ brotlidec
+ HINTS
+ ${_BROTLI_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib lib/static
+ DOC "Brotli static decode library"
+)
+
+
+IF(${BROTLI_LIBRARY_COMMON_NOTFOUND} or ${BROTLI_LIBRARY_DEC_NOTFOUND})
+ set(BROTLI_FOUND FALSE)
+ELSE()
+ # handle the QUIETLY and REQUIRED arguments and set BROTLI_FOUND to TRUE if
+ # all listed variables are TRUE
+ INCLUDE(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Brotli DEFAULT_MSG BROTLI_LIBRARY_COMMON BROTLI_LIBRARY_DEC BROTLI_INCLUDE_DIR)
+
+ IF(BROTLI_FOUND)
+ get_filename_component(BROTLI_LIBRARY_DIR ${BROTLI_LIBRARY_COMMON} DIRECTORY)
+ SET(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
+ SET(BROTLI_LIBRARIES ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_COMMON})
+ ENDIF()
+ENDIF()
+
+MARK_AS_ADVANCED(
+ BROTLI_INCLUDE_DIR
+ BROTLI_LIBRARY_COMMON
+ BROTLI_LIBRARY_DEC
+ BROTLI_LIBRARY_DIR
+)
+
+UNSET(_BROTLI_SEARCH_DIRS)
diff --git a/build_files/cmake/Modules/FindFFmpeg.cmake b/build_files/cmake/Modules/FindFFmpeg.cmake
index 0765c1dc901..5f506a33e13 100644
--- a/build_files/cmake/Modules/FindFFmpeg.cmake
+++ b/build_files/cmake/Modules/FindFFmpeg.cmake
@@ -33,6 +33,8 @@ if(NOT FFMPEG_FIND_COMPONENTS)
avfilter
avformat
avutil
+ swscale
+ swresample
)
endif()
@@ -50,9 +52,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper_COMPONENT)
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
NAMES
- ${_upper_COMPONENT}
+ ${_component}
HINTS
- ${LIBDIR}/ffmpeg
+ ${_ffmpeg_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
diff --git a/build_files/cmake/Modules/FindHIP.cmake b/build_files/cmake/Modules/FindHIP.cmake
new file mode 100644
index 00000000000..c331a19eb33
--- /dev/null
+++ b/build_files/cmake/Modules/FindHIP.cmake
@@ -0,0 +1,81 @@
+# - Find HIP compiler
+#
+# This module defines
+# HIP_HIPCC_EXECUTABLE, the full path to the hipcc executable
+# HIP_VERSION, the HIP compiler version
+#
+# HIP_FOUND, if the HIP toolkit is found.
+
+#=============================================================================
+# Copyright 2021 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD 3-Clause License,
+# see accompanying file BSD-3-Clause-license.txt for details.
+#=============================================================================
+
+# If HIP_ROOT_DIR was defined in the environment, use it.
+if(NOT HIP_ROOT_DIR AND NOT $ENV{HIP_ROOT_DIR} STREQUAL "")
+ set(HIP_ROOT_DIR $ENV{HIP_ROOT_DIR})
+endif()
+
+set(_hip_SEARCH_DIRS
+ ${HIP_ROOT_DIR}
+)
+
+find_program(HIP_HIPCC_EXECUTABLE
+ NAMES
+ hipcc
+ HINTS
+ ${_hip_SEARCH_DIRS}
+ PATH_SUFFIXES
+ bin
+)
+
+if(HIP_HIPCC_EXECUTABLE AND NOT EXISTS ${HIP_HIPCC_EXECUTABLE})
+ message(WARNING "Cached or directly specified hipcc executable does not exist.")
+ set(HIP_FOUND FALSE)
+elseif(HIP_HIPCC_EXECUTABLE)
+ set(HIP_FOUND TRUE)
+
+ set(HIP_VERSION_MAJOR 0)
+ set(HIP_VERSION_MINOR 0)
+ set(HIP_VERSION_PATCH 0)
+
+ # Get version from the output.
+ execute_process(COMMAND ${HIP_HIPCC_EXECUTABLE} --version
+ OUTPUT_VARIABLE HIP_VERSION_RAW
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ # Parse parts.
+ if(HIP_VERSION_RAW MATCHES "HIP version: .*")
+ # Strip the HIP prefix and get list of individual version components.
+ string(REGEX REPLACE
+ ".*HIP version: ([.0-9]+).*" "\\1"
+ HIP_SEMANTIC_VERSION "${HIP_VERSION_RAW}")
+ string(REPLACE "." ";" HIP_VERSION_PARTS "${HIP_SEMANTIC_VERSION}")
+ list(LENGTH HIP_VERSION_PARTS NUM_HIP_VERSION_PARTS)
+
+ # Extract components into corresponding variables.
+ if(NUM_HIP_VERSION_PARTS GREATER 0)
+ list(GET HIP_VERSION_PARTS 0 HIP_VERSION_MAJOR)
+ endif()
+ if(NUM_HIP_VERSION_PARTS GREATER 1)
+ list(GET HIP_VERSION_PARTS 1 HIP_VERSION_MINOR)
+ endif()
+ if(NUM_HIP_VERSION_PARTS GREATER 2)
+ list(GET HIP_VERSION_PARTS 2 HIP_VERSION_PATCH)
+ endif()
+
+ # Unset temp variables.
+ unset(NUM_HIP_VERSION_PARTS)
+ unset(HIP_SEMANTIC_VERSION)
+ unset(HIP_VERSION_PARTS)
+ endif()
+
+ # Construct full semantic version.
+ set(HIP_VERSION "${HIP_VERSION_MAJOR}.${HIP_VERSION_MINOR}.${HIP_VERSION_PATCH}")
+ unset(HIP_VERSION_RAW)
+else()
+ set(HIP_FOUND FALSE)
+endif()
diff --git a/build_files/cmake/Modules/FindOptiX.cmake b/build_files/cmake/Modules/FindOptiX.cmake
index 67106740f57..c4a9e9f0181 100644
--- a/build_files/cmake/Modules/FindOptiX.cmake
+++ b/build_files/cmake/Modules/FindOptiX.cmake
@@ -21,7 +21,7 @@ ENDIF()
SET(_optix_SEARCH_DIRS
${OPTIX_ROOT_DIR}
- "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.0.0"
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
)
FIND_PATH(OPTIX_INCLUDE_DIR