Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ session_manager.mu
# See maya_tools.mu.in
maya_tools.mu
# See rvnuke_mode.mu.in
rvnuke_mode.mu
rvnuke_mode.mu
# see generate_about_rv.py
about_rv.cpp
17 changes: 5 additions & 12 deletions cmake/dependencies/glew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ EXTERNALPROJECT_ADD(
URL_MD5 ${_download_hash}
DOWNLOAD_NAME ${_target}_${_version}.zip
DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR}
# Patch to fix the build issue with OpenGL-Registry
# Pinning the OpenGL-Registry version to a specific commit
# https://github.com/nigels-com/glew/issues/449
# Patch to fix the build issue with OpenGL-Registry Pinning the OpenGL-Registry version to a specific commit https://github.com/nigels-com/glew/issues/449
# Also clone the required glfixes repository
PATCH_COMMAND
cd auto &&
git clone https://github.com/KhronosGroup/OpenGL-Registry.git || true &&
cd OpenGL-Registry &&
git checkout a77f5b6ffd0b0b74904f755ae977fa278eac4e95 &&
cd .. &&
git clone --depth=1 --branch glew https://github.com/nigels-com/glfixes glfixes || true &&
touch OpenGL-Registry/.dummy &&
cd ..
PATCH_COMMAND
cd auto && git clone https://github.com/KhronosGroup/OpenGL-Registry.git || true && cd OpenGL-Registry && git checkout
a77f5b6ffd0b0b74904f755ae977fa278eac4e95 && cd .. && git clone --depth=1 --branch glew https://github.com/nigels-com/glfixes glfixes || true && touch
OpenGL-Registry/.dummy && cd ..
CONFIGURE_COMMAND cd auto && ${_make_command} && cd .. && ${_make_command}
BUILD_COMMAND ${_make_command} -j${_cpu_count} GLEW_DEST=${_install_dir}
INSTALL_COMMAND ${_make_command} install LIBDIR=${_lib_dir} GLEW_DEST=${_install_dir}
Expand Down
25 changes: 15 additions & 10 deletions cmake/dependencies/imgui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ENDIF()

IF(RV_TARGET_WINDOWS)
SET(_libpath
${_bin_dir}/${_libname}
${_bin_dir}/${_libname}
)
ELSE()
SET(_libpath
Expand Down Expand Up @@ -103,20 +103,19 @@ EXTERNALPROJECT_ADD(
USES_TERMINAL_DOWNLOAD TRUE
)

SET(_qt_location
${RV_DEPS_QT_LOCATION}
SET(_qt_location
${RV_DEPS_QT_LOCATION}
)
SET(_find_qt_version
"Qt${RV_DEPS_QT_MAJOR}"
SET(_find_qt_version
"Qt${RV_DEPS_QT_MAJOR}"
)
IF(NOT _qt_location)
SET(_qt_major
${RV_DEPS_QT_MAJOR}
SET(_qt_major
${RV_DEPS_QT_MAJOR}
)
MESSAGE(FATAL_ERROR "Qt is not found in path \"${_qt_location}\". Please provide -DRV_DEPS_QT_LOCATION=<path> to CMake.")
ENDIF()


SET(_patch_command_for_imgui
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/imgui_cpp_h.patch
)
Expand All @@ -133,8 +132,8 @@ EXTERNALPROJECT_ADD(
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/imgui/CMakeLists.txt ${CMAKE_BINARY_DIR}/${_target}/src/CMakeLists.txt && ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_BINARY_DIR}/${_target}/deps/implot ${CMAKE_BINARY_DIR}/${_target}/src/implot && ${CMAKE_COMMAND} -E copy_directory
${CMAKE_BINARY_DIR}/${_target}/deps/imgui-backend-qt/backends ${CMAKE_BINARY_DIR}/${_target}/src/backends && ${CMAKE_COMMAND} -E copy_directory
${CMAKE_BINARY_DIR}/${_target}/deps/imgui-node-editor ${CMAKE_BINARY_DIR}/${_target}/src/imgui-node-editor
&& ${_patch_command_for_imgui_backend_qt} && ${_patch_command_for_imgui}
${CMAKE_BINARY_DIR}/${_target}/deps/imgui-node-editor ${CMAKE_BINARY_DIR}/${_target}/src/imgui-node-editor && ${_patch_command_for_imgui_backend_qt} &&
${_patch_command_for_imgui}
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${_configure_options} -DFIND_QT_VERSION=${_find_qt_version} -DCMAKE_PREFIX_PATH=${_qt_location}/lib/cmake
BUILD_COMMAND ${_cmake_build_command}
INSTALL_COMMAND ${_cmake_install_command}
Expand Down Expand Up @@ -174,3 +173,9 @@ TARGET_INCLUDE_DIRECTORIES(
)

LIST(APPEND RV_DEPS_LIST imgui::imgui)

# Set version for about dialog
SET(RV_DEPS_IMGUI_VERSION
${_version}
CACHE INTERNAL "" FORCE
)
62 changes: 32 additions & 30 deletions cmake/dependencies/python3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,32 @@ SET(_opentimelineio_target
)

SET(_pyside_target
"${RV_DEPS_PYSIDE_TARGET}"
"${RV_DEPS_PYSIDE_TARGET}"
)

SET(_python3_version
"${RV_DEPS_PYTHON_VERSION}"
)
string(REPLACE "." ";" _python_version_list "${_python3_version}")

list(GET _python_version_list 0 PYTHON_VERSION_MAJOR)
list(GET _python_version_list 1 PYTHON_VERSION_MINOR)
list(GET _python_version_list 2 PYTHON_VERSION_PATCH)
STRING(REPLACE "." ";" _python_version_list "${_python3_version}")

LIST(GET _python_version_list 0 PYTHON_VERSION_MAJOR)
LIST(GET _python_version_list 1 PYTHON_VERSION_MINOR)
LIST(GET _python_version_list 2 PYTHON_VERSION_PATCH)

SET(RV_DEPS_PYTHON_VERSION_SHORT
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
)

# This version is used for generating src/build/requirements.txt from requirements.txt.in template
# All platforms install OpenTimelineIO from git to ensure consistent source builds.
# This version is used for generating src/build/requirements.txt from requirements.txt.in template All platforms install OpenTimelineIO from git to ensure
# consistent source builds.
SET(_opentimelineio_version
"${RV_DEPS_OTIO_VERSION}"
)

SET(_pyside_version
SET(_pyside_version
"${RV_DEPS_PYSIDE_VERSION}"
)
# Construct the full git URL for pip to use in requirements.txt
# Using this avoids @ symbol conflicts in CONFIGURE_FILE
# Construct the full git URL for pip to use in requirements.txt Using this avoids @ symbol conflicts in CONFIGURE_FILE
SET(_opentimelineio_pip_url
"git+https://github.com/AcademySoftwareFoundation/OpenTimelineIO@v${_opentimelineio_version}#egg=OpenTimelineIO"
)
Expand All @@ -49,7 +47,7 @@ SET(_python3_download_url
"https://github.com/python/cpython/archive/refs/tags/v${_python3_version}.zip"
)

SET(_python3_download_hash
SET(_python3_download_hash
"${RV_DEPS_PYTHON_DOWNLOAD_HASH}"
)

Expand All @@ -62,11 +60,11 @@ SET(_opentimelineio_git_tag
)

SET(_pyside_archive_url
"${RV_DEPS_PYSIDE_ARCHIVE_URL}"
"${RV_DEPS_PYSIDE_ARCHIVE_URL}"
)

SET(_pyside_download_hash
"${RV_DEPS_PYSIDE_DOWNLOAD_HASH}"
SET(_pyside_download_hash
"${RV_DEPS_PYSIDE_DOWNLOAD_HASH}"
)

SET(_install_dir
Expand All @@ -79,8 +77,8 @@ SET(_build_dir
${RV_DEPS_BASE_DIR}/${_python3_target}/build
)

# Note: OpenTimelineIO is now installed via requirements.txt from git URL for all platforms.
# This ensures consistent source builds across Windows, Mac, and Linux.
# Note: OpenTimelineIO is now installed via requirements.txt from git URL for all platforms. This ensures consistent source builds across Windows, Mac, and
# Linux.

FETCHCONTENT_DECLARE(
${_pyside_target}
Expand Down Expand Up @@ -109,7 +107,6 @@ LIST(APPEND _python3_make_command ${_build_dir})
LIST(APPEND _python3_make_command "--vfx_platform")
LIST(APPEND _python3_make_command ${RV_VFX_CY_YEAR})


IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
LIST(APPEND _python3_make_command "--openssl-dir")
LIST(APPEND _python3_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})
Expand Down Expand Up @@ -260,11 +257,7 @@ SET(_requirements_output_file
"${CMAKE_BINARY_DIR}/requirements.txt"
)

CONFIGURE_FILE(
${_requirements_input_file}
${_requirements_output_file}
@ONLY
)
CONFIGURE_FILE(${_requirements_input_file} ${_requirements_output_file} @ONLY)

# OpenTimelineIO needs to be built from source with CMAKE_ARGS to ensure it uses
# the correct custom-built Python libraries. This is required for both old and new
Expand Down Expand Up @@ -298,8 +291,18 @@ IF(RV_TARGET_WINDOWS)
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python-${RV_DEPS_PYTHON_VERSION}/python.${RV_DEPS_PYTHON_VERSION}.get_externals.bat.patch"
)

#TODO: Above patches are for Python 3.11.9, need to add other versions.
RV_VFX_SET_VARIABLE(_patch_command CY2023 "" CY2024 "${_patch_python_command}" CY2025 "${_patch_python_command}" CY2026 "")
# TODO: Above patches are for Python 3.11.9, need to add other versions.
RV_VFX_SET_VARIABLE(
_patch_command
CY2023
""
CY2024
"${_patch_python_command}"
CY2025
"${_patch_python_command}"
CY2026
""
)
# Split the command into a semi-colon separated list.
SEPARATE_ARGUMENTS(_patch_command)
STRING(
Expand Down Expand Up @@ -339,10 +342,8 @@ IF(APPLE
patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/pyopengl-accelerate.patch
)

# TODO: pyopengl is now at 3.1.10.
# Need to check if this is an improvement
# Still need the patch https://github.com/mcfletch/pyopengl/blob/master/accelerate/src/vbo.pyx
# https://github.com/mcfletch/pyopengl/compare/release-3.1.8...3.1.10
# TODO: pyopengl is now at 3.1.10. Need to check if this is an improvement Still need the patch
# https://github.com/mcfletch/pyopengl/blob/master/accelerate/src/vbo.pyx https://github.com/mcfletch/pyopengl/compare/release-3.1.8...3.1.10
EXTERNALPROJECT_ADD(
pyopengl_accelerate
URL "https://github.com/mcfletch/pyopengl/archive/refs/tags/release-3.1.8.tar.gz"
Expand Down Expand Up @@ -387,7 +388,8 @@ IF(RV_TARGET_WINDOWS
POST_BUILD
COMMENT "Copying Debug Python lib as a unversionned file for Debug"
COMMAND cmake -E copy_if_different ${_python3_implib} ${_python_release_libpath}
COMMAND cmake -E copy_if_different ${_python3_implib} ${_python_release_in_bin_libpath} DEPENDS ${_python3_target} ${_requirements_output_file} ${_requirements_input_file}
COMMAND cmake -E copy_if_different ${_python3_implib} ${_python_release_in_bin_libpath} DEPENDS ${_python3_target} ${_requirements_output_file}
${_requirements_input_file}
)
ENDIF()

Expand Down
150 changes: 150 additions & 0 deletions src/lib/app/RvCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,161 @@ FOREACH(
LIST(APPEND _sources ${outfile})
ENDFOREACH()

#
# Generate about_rv.cpp with build information
#
SET(_about_rv_cpp
${CMAKE_CURRENT_SOURCE_DIR}/${_target}/generated/about_rv.cpp
)

# Get compiler name
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
SET(_compiler_name
"GCC ${CMAKE_CXX_COMPILER_VERSION}"
)
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
IF(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
SET(_compiler_name
"Clang-cl ${CMAKE_CXX_COMPILER_VERSION}"
)
ELSE()
SET(_compiler_name
"Clang ${CMAKE_CXX_COMPILER_VERSION}"
)
ENDIF()
ELSEIF(MSVC)
SET(_compiler_name
"MSVC ${CMAKE_CXX_COMPILER_VERSION}"
)
ELSE()
SET(_compiler_name
"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}"
)
ENDIF()

# Get CXX flags
STRING(REPLACE ";" " " _cxx_flags_str "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}")

# Get VFX platform
IF(RV_VFX_PLATFORM)
SET(_vfx_platform_str
${RV_VFX_PLATFORM}
)
ELSE()
SET(_vfx_platform_str
"N/A"
)
ENDIF()

# Get build root
GET_FILENAME_COMPONENT(_build_root ${CMAKE_BINARY_DIR} NAME)

# Get platform and arch
IF(RV_TARGET_DARWIN)
SET(_platform_name
"macOS"
)
ELSEIF(RV_TARGET_LINUX)
SET(_platform_name
"Linux"
)
ELSEIF(RV_TARGET_WINDOWS)
SET(_platform_name
"Windows"
)
ELSE()
SET(_platform_name
${CMAKE_SYSTEM_NAME}
)
ENDIF()

SET(_arch_name
${CMAKE_SYSTEM_PROCESSOR}
)

# Create a JSON-like string with versions (using semicolon as separator for CMake list)
SET(_versions_list
"Qt:${RV_DEPS_QT_VERSION}"
"CMake:${CMAKE_VERSION}"
"Python:${RV_DEPS_PYTHON3_VERSION}"
"PySide:${RV_DEPS_PYSIDE_VERSION}"
"Boost:${RV_DEPS_BOOST_VERSION}"
"Imath:${RV_DEPS_IMATH_VERSION}"
"OpenEXR:${RV_DEPS_OPENEXR_VERSION}"
"OpenImageIO:${RV_DEPS_OIIO_VERSION}"
"OpenColorIO:${RV_DEPS_OCIO_VERSION}"
"FFmpeg:${RV_DEPS_FFMPEG_VERSION}"
"OpenSSL:${RV_DEPS_OPENSSL_VERSION}"
"GLEW:${RV_DEPS_GLEW_VERSION_LIB}"
"spdlog:${RV_DEPS_SPDLOG_VERSION}"
"yaml-cpp:${RV_DEPS_YAML_CPP_VERSION}"
"zlib:${RV_DEPS_ZLIB_VERSION}"
"dav1d:${RV_DEPS_DAV1D_VERSION}"
"jpegturbo:${RV_DEPS_JPEGTURBO_VERSION}"
"png:${RV_DEPS_PNG_VERSION}"
"tiff:${RV_DEPS_TIFF_VERSION}"
"webp:${RV_DEPS_WEBP_VERSION}"
"openjpeg:${RV_DEPS_OPENJPEG_VERSION}"
"openjph:${RV_DEPS_OPENJPH_VERSION}"
"raw:${RV_DEPS_RAW_VERSION}"
"gc:${RV_DEPS_GC_VERSION}"
"aja:${RV_DEPS_AJA_VERSION}"
"bmd:${RV_DEPS_BMD_VERSION}"
"imgui:${RV_DEPS_IMGUI_VERSION}"
"numpy:$ENV{RV_DEPS_NUMPY_VERSION}"
"otio:${RV_DEPS_OTIO_VERSION}"
)

# Add commercial RV-specific SDK versions if they exist
IF(DEFINED RV_DEPS_PRORES_VERSION
AND RV_DEPS_PRORES_VERSION
)
LIST(APPEND _versions_list "prores:${RV_DEPS_PRORES_VERSION}")
ENDIF()
IF(DEFINED RV_DEPS_R3DSDK_VERSION
AND RV_DEPS_R3DSDK_VERSION
)
LIST(APPEND _versions_list "r3dsdk:${RV_DEPS_R3DSDK_VERSION}")
ENDIF()
IF(DEFINED RV_DEPS_ARRIRAW_VERSION
AND RV_DEPS_ARRIRAW_VERSION
)
LIST(APPEND _versions_list "arriraw:${RV_DEPS_ARRIRAW_VERSION}")
ENDIF()
IF(DEFINED RV_DEPS_X264_VERSION
AND RV_DEPS_X264_VERSION
)
LIST(APPEND _versions_list "x264:${RV_DEPS_X264_VERSION}")
ENDIF()

STRING(REPLACE ";" "," _versions_str "${_versions_list}")

ADD_CUSTOM_COMMAND(
OUTPUT ${_about_rv_cpp}
COMMAND
python3 ${CMAKE_CURRENT_SOURCE_DIR}/generate_about_rv.py ${_about_rv_cpp} "${_compiler_name}" "${CMAKE_BUILD_TYPE}" "${_cxx_flags_str}"
"${_vfx_platform_str}" "${_build_root}" "${_platform_name}" "${_arch_name}" "${RV_UI_APPLICATION_NAME}" "${_versions_str}" "${RV_GIT_COMMIT_SHORT_HASH}"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generate_about_rv.py
COMMENT "Generating about_rv.cpp with build information"
VERBATIM
)

# Create explicit target to ensure about_rv.cpp is generated before RvCommon builds
ADD_CUSTOM_TARGET(
generate_about_rv_cpp
DEPENDS ${_about_rv_cpp}
)

LIST(APPEND _sources ${_about_rv_cpp})

ADD_LIBRARY(
${_target} STATIC
${_sources} qrc/RvCommon.qrc
)

# Ensure about_rv.cpp is generated before building RvCommon
ADD_DEPENDENCIES(${_target} generate_about_rv_cpp)

# Need that with Qt6 since the code for this target does not support unicode correctly.
IF(RV_TARGET_WINDOWS
AND RV_VFX_PLATFORM STRGREATER_EQUAL CY2024
Expand Down
Loading