Init Repo

This commit is contained in:
2026-03-19 09:34:11 +08:00
commit 6fcf135d6a
263 changed files with 304424 additions and 0 deletions
+105
View File
@@ -0,0 +1,105 @@
# FindFFmpeg.cmake
# CMake module to find FFmpeg installation
#
# This module defines:
# FFMPEG_FOUND - True if FFmpeg was found
# FFMPEG_VERSION - FFmpeg version
# FFMPEG_INCLUDE_DIR - FFmpeg include directory
# FFMPEG_LIBRARIES - List of FFmpeg libraries to link
# FFMPEG_DLL_DIR - Directory containing FFmpeg DLLs
# Use environment variable or default path
if(NOT DEFINED FFMPEG_ROOT)
if(DEFINED ENV{FFMPEG_ROOT})
set(FFMPEG_ROOT $ENV{FFMPEG_ROOT})
else()
# Default: look in third_party/ffmpeg relative to project root
set(FFMPEG_ROOT "${CMAKE_SOURCE_DIR}/third_party/ffmpeg")
endif()
endif()
# Find FFmpeg include directory
find_path(FFMPEG_INCLUDE_DIR
NAMES libavcodec/avcodec.h
PATHS ${FFMPEG_ROOT}/include
NO_DEFAULT_PATH
DOC "FFmpeg include directory"
)
# Find FFmpeg libraries
find_library(AVCODEC_LIBRARY
NAMES avcodec
PATHS ${FFMPEG_ROOT}/lib
NO_DEFAULT_PATH
DOC "FFmpeg avcodec library"
)
find_library(AVFORMAT_LIBRARY
NAMES avformat
PATHS ${FFMPEG_ROOT}/lib
NO_DEFAULT_PATH
DOC "FFmpeg avformat library"
)
find_library(AVUTIL_LIBRARY
NAMES avutil
PATHS ${FFMPEG_ROOT}/lib
NO_DEFAULT_PATH
DOC "FFmpeg avutil library"
)
find_library(SWSCALE_LIBRARY
NAMES swscale
PATHS ${FFMPEG_ROOT}/lib
NO_DEFAULT_PATH
DOC "FFmpeg swscale library"
)
find_library(SWRESAMPLE_LIBRARY
NAMES swresample
PATHS ${FFMPEG_ROOT}/lib
NO_DEFAULT_PATH
DOC "FFmpeg swresample library"
)
# Collect libraries
set(FFMPEG_LIBRARIES)
foreach(LIB AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE)
if(${LIB}_LIBRARY)
list(APPEND FFMPEG_LIBRARIES "${${LIB}_LIBRARY}")
endif()
endforeach()
# Set DLL directory
set(FFMPEG_DLL_DIR "${FFMPEG_ROOT}/bin" CACHE PATH "FFmpeg DLL directory")
# Handle QUIET and REQUIRED arguments
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg
REQUIRED_VARS
FFMPEG_INCLUDE_DIR
AVCODEC_LIBRARY
AVFORMAT_LIBRARY
AVUTIL_LIBRARY
SWSCALE_LIBRARY
)
# Mark as advanced
mark_as_advanced(
FFMPEG_INCLUDE_DIR
AVCODEC_LIBRARY
AVFORMAT_LIBRARY
AVUTIL_LIBRARY
SWSCALE_LIBRARY
SWRESAMPLE_LIBRARY
FFMPEG_DLL_DIR
)
# Print status message
if(NOT FFmpeg_FIND_QUIETLY)
if(FFMPEG_FOUND)
message(STATUS "Found FFmpeg: ${FFMPEG_ROOT}")
else()
message(STATUS "FFmpeg not found. Set FFMPEG_ROOT environment variable.")
endif()
endif()
+134
View File
@@ -0,0 +1,134 @@
# FindMaya.cmake
# CMake module to find Maya installation
#
# This module defines:
# MAYA_FOUND - True if Maya was found
# MAYA_VERSION - Maya version (e.g., Maya2023)
# MAYA_LOCATION - Maya installation directory
# MAYA_INCLUDE_DIR - Maya include directory
# MAYA_LIBRARY - Maya library directory
# MAYA_LIBRARIES - List of Maya libraries to link
# Use environment variable if set
if(NOT DEFINED MAYA_LOCATION)
if(DEFINED ENV{MAYA_LOCATION})
set(MAYA_LOCATION $ENV{MAYA_LOCATION})
endif()
endif()
# Default Maya version
set(MAYA_VERSION "Maya2023")
if(MAYA_LOCATION)
# Extract Maya version from path
string(REGEX MATCH "Maya[0-9]{4}" MAYA_VERSION_FOUND "${MAYA_LOCATION}")
if(MAYA_VERSION_FOUND)
set(MAYA_VERSION "${MAYA_VERSION_FOUND}")
endif()
else()
# Try to find Maya in common locations
find_path(MAYA_INCLUDE_DIR
NAMES maya/MApiVersion.h
PATHS
"C:/Program Files/Autodesk/Maya2023/include"
"C:/Program Files/Autodesk/Maya2024/include"
"C:/Program Files/Autodesk/Maya2025/include"
"C:/Program Files/Autodesk/Maya2026/include"
"C:/Program Files/Autodesk/Maya2022/include"
DOC "Maya include directory"
)
# If found, extract version from path
if(MAYA_INCLUDE_DIR)
string(REGEX MATCH "Maya[0-9]{4}" MAYA_VERSION_FOUND "${MAYA_INCLUDE_DIR}")
if(MAYA_VERSION_FOUND)
set(MAYA_VERSION "${MAYA_VERSION_FOUND}")
string(REPLACE "/include" "" MAYA_LOCATION "${MAYA_INCLUDE_DIR}")
string(REPLACE "/include" "" MAYA_LOCATION "${MAYA_LOCATION}")
endif()
endif()
endif()
# Find Maya libraries if location is known
if(MAYA_LOCATION)
# Construct library paths
set(MAYA_LIB_DIR "${MAYA_LOCATION}/lib")
# Find Foundation library
find_library(FOUNDATION_LIBRARY
NAMES Foundation
PATHS "${MAYA_LIB_DIR}"
DOC "Maya Foundation library"
)
# Find OpenMaya library
find_library(OPENMAYA_LIBRARY
NAMES OpenMaya
PATHS "${MAYA_LIB_DIR}"
DOC "Maya OpenMaya library"
)
# Find OpenMayaUI library
find_library(OPENMAYAUI_LIBRARY
NAMES OpenMayaUI
PATHS "${MAYA_LIB_DIR}"
DOC "Maya OpenMayaUI library"
)
# Find OpenMayaAnim library
find_library(OPENMAYAANIM_LIBRARY
NAMES OpenMayaAnim
PATHS "${MAYA_LIB_DIR}"
DOC "Maya OpenMayaAnim library"
)
# Find OpenMayaRender library
find_library(OPENMAYARENDER_LIBRARY
NAMES OpenMayaRender
PATHS "${MAYA_LIB_DIR}"
DOC "Maya OpenMayaRender library"
)
# Collect libraries
set(MAYA_LIBRARIES)
if(FOUNDATION_LIBRARY)
list(APPEND MAYA_LIBRARIES "${FOUNDATION_LIBRARY}")
endif()
if(OPENMAYA_LIBRARY)
list(APPEND MAYA_LIBRARIES "${OPENMAYA_LIBRARY}")
endif()
if(OPENMAYAUI_LIBRARY)
list(APPEND MAYA_LIBRARIES "${OPENMAYAUI_LIBRARY}")
endif()
if(OPENMAYAANIM_LIBRARY)
list(APPEND MAYA_LIBRARIES "${OPENMAYAANIM_LIBRARY}")
endif()
if(OPENMAYARENDER_LIBRARY)
list(APPEND MAYA_LIBRARIES "${OPENMAYARENDER_LIBRARY}")
endif()
# Set include directory
set(MAYA_INCLUDE_DIR "${MAYA_LOCATION}/include" CACHE PATH "Maya include directory")
endif()
# Handle QUIET and REQUIRED arguments
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Maya
REQUIRED_VARS
MAYA_LOCATION
MAYA_INCLUDE_DIR
MAYA_LIBRARIES
VERSION_VAR MAYA_VERSION
)
# Mark as advanced
mark_as_advanced(MAYA_INCLUDE_DIR MAYA_LIBRARY MAYA_LOCATION)
# Print status message
if(NOT Maya_FIND_QUIETLY)
if(MAYA_FOUND)
message(STATUS "Found Maya ${MAYA_VERSION}: ${MAYA_LOCATION}")
else()
message(STATUS "Maya not found. Set MAYA_LOCATION environment variable.")
endif()
endif()