Skip to content

Commit 1b7fda3

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into AppleProRes_SDK_Support
2 parents c3b7ad7 + 4c487b1 commit 1b7fda3

15 files changed

Lines changed: 174 additions & 133 deletions

File tree

cmake/defaults/CYCOMMON.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ SET(RV_DEPS_JPEGTURBO_VERSION_LIB
176176

177177
# oiio https://github.com/AcademySoftwareFoundation/OpenImageIO
178178
SET(RV_DEPS_OIIO_VERSION
179-
"2.5.19.1"
179+
"3.1.11.0"
180180
)
181181
SET(RV_DEPS_OIIO_DOWNLOAD_HASH
182-
"5af6de5a73c6d234eed8e2874a5aed62"
182+
"29665fc3ef38a4ddb07f5c2833c9c9f8"
183183
)
184184

185185
# openjpeg https://github.com/uclouvain/openjpeg

cmake/defaults/cxx_msvc_defaults.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ADD_COMPILE_OPTIONS(
5454
-Gy
5555
-nologo
5656
-Qfast_transcendentals
57+
-utf-8
5758
-Zc:forScope
5859
-Zc:sizedDealloc-
5960
-Zi

cmake/dependencies/atomic_ops.cmake

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,17 @@ SET(_lib_dir
2929
${_install_dir}/lib
3030
)
3131

32-
IF(RV_TARGET_WINDOWS)
33-
SET(_atomic_ops_lib_name
34-
libatomic_ops.a
35-
)
36-
ELSE()
37-
SET(_atomic_ops_lib_name
38-
${CMAKE_STATIC_LIBRARY_PREFIX}atomic_ops${CMAKE_STATIC_LIBRARY_SUFFIX}
39-
)
40-
ENDIF()
32+
SET(_atomic_ops_lib_name
33+
${CMAKE_STATIC_LIBRARY_PREFIX}atomic_ops${CMAKE_STATIC_LIBRARY_SUFFIX}
34+
)
4135

4236
SET(_atomic_ops_lib
4337
${_lib_dir}/${_atomic_ops_lib_name}
4438
)
4539

46-
SET(_make_command
47-
make
48-
)
49-
SET(_configure_command
50-
sh ./configure
51-
)
52-
SET(_autogen_command
53-
sh ./autogen.sh
54-
)
55-
56-
# Make sure NOT to enable GPL
57-
SET(_configure_args
58-
"--disable-gpl"
40+
SET(_build_dir
41+
${RV_DEPS_BASE_DIR}/${_target}/build
5942
)
60-
LIST(APPEND _configure_args "--prefix=${_install_dir}")
6143

6244
EXTERNALPROJECT_ADD(
6345
${_target}
@@ -67,10 +49,11 @@ EXTERNALPROJECT_ADD(
6749
URL_MD5 ${_download_hash}
6850
DOWNLOAD_NAME ${_target}_${_version}.zip
6951
DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR}
70-
CONFIGURE_COMMAND ${_autogen_command} && ${_configure_command} ${_configure_args}
71-
BUILD_COMMAND ${_make_command} -j${_cpu_count}
72-
INSTALL_COMMAND ${_make_command} install
73-
BUILD_IN_SOURCE TRUE
52+
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S ${RV_DEPS_BASE_DIR}/${_target}/src -B ${_build_dir} -DCMAKE_INSTALL_PREFIX=${_install_dir}
53+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -Denable_gpl=OFF
54+
BUILD_COMMAND ${CMAKE_COMMAND} --build ${_build_dir} --config ${CMAKE_BUILD_TYPE} -j${_cpu_count}
55+
INSTALL_COMMAND ${CMAKE_COMMAND} --install ${_build_dir} --prefix ${_install_dir} --config ${CMAKE_BUILD_TYPE}
56+
BUILD_IN_SOURCE FALSE
7457
BUILD_ALWAYS FALSE
7558
BUILD_BYPRODUCTS ${_atomic_ops_lib}
7659
USES_TERMINAL_BUILD TRUE

cmake/dependencies/ocio.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ LIST(APPEND _configure_options "-DZLIB_ROOT=${RV_DEPS_ZLIB_ROOT_DIR}")
145145

146146
# OCIO apps are not needed.
147147
LIST(APPEND _configure_options "-DOCIO_BUILD_APPS=OFF")
148+
# Use MISSING so OCIO vendors its own third-party deps when not already provided by RV_DEPS (vs NONE/default), pinning versions and avoiding ABI/licensing drift
149+
# with system libs; typical CI pulls in Imath/OpenEXR components, yaml-cpp, pystring, expat, lcms2, zlib, and related OCIO external packages.
150+
LIST(APPEND _configure_options "-DOCIO_INSTALL_EXT_PACKAGES=MISSING")
148151

149152
IF(NOT RV_TARGET_WINDOWS)
150153
EXTERNALPROJECT_ADD(
@@ -203,7 +206,11 @@ ELSE() # Windows
203206
"-DZLIB_INCLUDE_DIR=${_zlib_include_dir}"
204207
"-Dexpat_ROOT=${RV_DEPS_EXPAT_ROOT_DIR}"
205208
"-DImath_DIR=${RV_DEPS_IMATH_ROOT_DIR}/lib/cmake/Imath"
206-
"-DPython_ROOT=${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install"
209+
"-DPython_ROOT_DIR=${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install"
210+
# Force CMake to use our custom Python, not the system/registry Python. Python_FIND_REGISTRY=NEVER prevents Windows registry lookups that find the system
211+
# Python from actions/setup-python. Python_FIND_STRATEGY=LOCATION ensures Python_ROOT_DIR is checked before the default search paths.
212+
"-DPython_FIND_REGISTRY=NEVER"
213+
"-DPython_FIND_STRATEGY=LOCATION"
207214
# Mandatory param: OCIO CMake code finds Python.
208215
"-DPython_LIBRARY=${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install/bin/python${PYTHON_VERSION_SHORT_NO_DOT}.lib" # with this param
209216
# DRV_Python_LIBRARIES: A Patch RV created for PyOpenColorIO inside OCIO: Hardcode to Release since FindPython.cmake will find the Debug lib, which we don't

cmake/dependencies/oiio.cmake

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ LIST(APPEND _byproducts ${_byprojects_copy})
4848
# The '_configure_options' list gets reset and initialized in 'RV_CREATE_STANDARD_DEPS_VARIABLES'
4949
LIST(APPEND _configure_options "-DBUILD_TESTING=OFF")
5050
LIST(APPEND _configure_options "-DUSE_PYTHON=0") # this on would requireextra pybind11 package
51-
LIST(APPEND _configure_options "-DUSE_OCIO=0")
51+
# OIIO 3.x still calls find_package(Python3) even with USE_PYTHON=0. Point it to our custom Python to prevent finding the system Python (e.g. 3.14 from GitHub
52+
# runner toolcache).
53+
LIST(APPEND _configure_options "-DPython3_ROOT_DIR=${RV_DEPS_BASE_DIR}/RV_DEPS_PYTHON3/install")
54+
LIST(APPEND _configure_options "-DPython3_FIND_STRATEGY=LOCATION")
55+
LIST(APPEND _configure_options "-DPython3_FIND_REGISTRY=NEVER")
56+
LIST(APPEND _configure_options "-DUSE_OCIO=ON")
57+
LIST(APPEND _configure_options "-DOpenColorIO_ROOT=${RV_DEPS_OCIO_ROOT_DIR}")
58+
IF(RHEL_VERBOSE)
59+
LIST(APPEND _configure_options "-DOpenColorIO_DIR=${RV_DEPS_OCIO_ROOT_DIR}/lib64/cmake/OpenColorIO")
60+
ELSE()
61+
LIST(APPEND _configure_options "-DOpenColorIO_DIR=${RV_DEPS_OCIO_ROOT_DIR}/lib/cmake/OpenColorIO")
62+
ENDIF()
5263
LIST(APPEND _configure_options "-DUSE_FREETYPE=0")
5364
LIST(APPEND _configure_options "-DUSE_GIF=OFF")
5465

@@ -87,14 +98,15 @@ LIST(APPEND _configure_options "-DJPEGTURBO_LIBRARY=${_jpegturbo_library}")
8798
LIST(APPEND _configure_options "-DJPEGTURBO_INCLUDE_DIR=${_jpegturbo_include_dir}")
8899

89100
LIST(APPEND _configure_options "-DOpenJPEG_ROOT=${RV_DEPS_OPENJPEG_ROOT_DIR}")
101+
LIST(APPEND _configure_options "-DOPENJPEG_VERSION=${RV_DEPS_OPENJPEG_VERSION}")
90102
GET_TARGET_PROPERTY(_openjpeg_library OpenJpeg::OpenJpeg IMPORTED_LOCATION)
91103
GET_TARGET_PROPERTY(_openjpeg_include_dir OpenJpeg::OpenJpeg INTERFACE_INCLUDE_DIRECTORIES)
92104
LIST(APPEND _configure_options "-DOPENJPEG_OPENJP2_LIBRARY=${_openjpeg_library}")
93105
LIST(APPEND _configure_options "-DOPENJPEG_INCLUDE_DIR=${_openjpeg_include_dir}")
94106

95107
LIST(APPEND _configure_options "-DTIFF_ROOT=${RV_DEPS_TIFF_ROOT_DIR}")
96108

97-
LIST(APPEND _configure_options "-USE_FFMPEG=0")
109+
LIST(APPEND _configure_options "-DUSE_FFMPEG=0")
98110

99111
IF(RV_TARGET_LINUX)
100112
MESSAGE(STATUS "Building OpenImageIO using system's freetype library.")
@@ -126,6 +138,7 @@ LIST(APPEND _configure_options "-DOIIO_BUILD_TOOLS=OFF" "-DOIIO_BUILD_TESTS=OFF"
126138

127139
IF(RV_TARGET_WINDOWS)
128140
LIST(PREPEND _configure_options "-G ${CMAKE_GENERATOR}")
141+
LIST(APPEND _configure_options "-DCMAKE_CXX_FLAGS=/utf-8")
129142
ENDIF()
130143

131144
IF(NOT RV_TARGET_WINDOWS)
@@ -153,6 +166,7 @@ IF(NOT RV_TARGET_WINDOWS)
153166
WebP::webp
154167
LibRaw::raw
155168
ZLIB::ZLIB
169+
OpenColorIO::OpenColorIO
156170
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${_configure_options}
157171
BUILD_COMMAND ${_cmake_build_command}
158172
INSTALL_COMMAND ${_cmake_install_command}
@@ -207,6 +221,7 @@ ELSE()
207221
WebP::webp
208222
LibRaw::raw
209223
ZLIB::ZLIB
224+
OpenColorIO::OpenColorIO
210225
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${_configure_options}
211226
BUILD_COMMAND ${CMAKE_COMMAND} ${_oiio_build_options}
212227
INSTALL_COMMAND ${CMAKE_COMMAND} ${_oiio_install_options}

cmake/dependencies/pcre2.cmake

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,30 @@ SET(_download_hash
1717

1818
# PCRE is not used for Linux and MacOS (Boost regex is used) in the current code.
1919
IF(RV_TARGET_WINDOWS)
20+
# PCRE2's CMakeLists.txt sets CMAKE_DEBUG_POSTFIX to "d" internally, which cannot be overridden via cache variable. Account for it here.
21+
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
22+
SET(_pcre2_debug_postfix
23+
"d"
24+
)
25+
ELSE()
26+
SET(_pcre2_debug_postfix
27+
""
28+
)
29+
ENDIF()
30+
31+
# MSVC library naming (CMake build)
2032
SET(_pcre2_libname
21-
libpcre2-8-0${CMAKE_SHARED_LIBRARY_SUFFIX}
33+
${CMAKE_SHARED_LIBRARY_PREFIX}pcre2-8${_pcre2_debug_postfix}${CMAKE_SHARED_LIBRARY_SUFFIX}
2234
)
2335
SET(_pcre2_libname_posix
24-
libpcre2-posix-3${CMAKE_SHARED_LIBRARY_SUFFIX}
36+
${CMAKE_SHARED_LIBRARY_PREFIX}pcre2-posix${_pcre2_debug_postfix}${CMAKE_SHARED_LIBRARY_SUFFIX}
2537
)
2638

2739
SET(_pcre2_implibname
28-
libpcre2-8.dll.a
40+
${CMAKE_IMPORT_LIBRARY_PREFIX}pcre2-8${_pcre2_debug_postfix}${CMAKE_IMPORT_LIBRARY_SUFFIX}
2941
)
3042
SET(_pcre2_implibname_posix
31-
libpcre2-posix.dll.a
43+
${CMAKE_IMPORT_LIBRARY_PREFIX}pcre2-posix${_pcre2_debug_postfix}${CMAKE_IMPORT_LIBRARY_SUFFIX}
3244
)
3345

3446
SET(_pcre2_libpath
@@ -50,22 +62,17 @@ SET(_pcre2_include_dir
5062
${_install_dir}/include
5163
)
5264

53-
SET(_pcre2_configure_command
54-
sh ./configure
55-
)
56-
57-
SET(_pcre2_autogen_command
58-
sh ./autogen.sh
59-
)
60-
61-
LIST(APPEND _pcre2_configure_args "--prefix=${_install_dir}")
62-
# Build as shared library
63-
LIST(APPEND _pcre2_configure_args "--disable-static")
64-
LIST(APPEND _pcre2_configure_args "--disable-pcre2grep-libbz2")
65-
LIST(APPEND _pcre2_configure_args "--disable-pcre2grep-libz")
65+
# PCRE2-specific CMake options (replaces autotools configure args)
66+
LIST(APPEND _configure_options "-DBUILD_SHARED_LIBS=ON")
67+
LIST(APPEND _configure_options "-DBUILD_STATIC_LIBS=OFF")
68+
LIST(APPEND _configure_options "-DPCRE2_BUILD_PCRE2GREP=OFF")
69+
LIST(APPEND _configure_options "-DPCRE2_BUILD_TESTS=OFF")
70+
LIST(APPEND _configure_options "-DPCRE2_SUPPORT_LIBBZ2=OFF")
71+
LIST(APPEND _configure_options "-DPCRE2_SUPPORT_LIBZ=OFF")
72+
LIST(APPEND _configure_options "-DINSTALL_MSVC_PDB=OFF")
6673

6774
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
68-
LIST(APPEND _pcre2_configure_args "--enable-debug")
75+
LIST(APPEND _configure_options "-DPCRE2_DEBUG=ON")
6976
ENDIF()
7077

7178
EXTERNALPROJECT_ADD(
@@ -78,66 +85,61 @@ EXTERNALPROJECT_ADD(
7885
SOURCE_DIR ${_source_dir}
7986
INSTALL_DIR ${_install_dir}
8087
DEPENDS ZLIB::ZLIB
81-
CONFIGURE_COMMAND ${_pcre2_autogen_command} && ${_pcre2_configure_command} ${_pcre2_configure_args}
82-
BUILD_COMMAND make -j${_cpu_count}
88+
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${_configure_options}
89+
BUILD_COMMAND ${_cmake_build_command}
90+
INSTALL_COMMAND ${_cmake_install_command}
8391
BUILD_IN_SOURCE TRUE
8492
BUILD_ALWAYS FALSE
85-
BUILD_BYPRODUCTS ${_pcre2_libname} ${_pcre2_libname_posix} ${_pcre2_implibname} ${_pcre2_implibname_posix}
93+
BUILD_BYPRODUCTS ${_pcre2_libpath} ${_pcre2_libpath_posix} ${_pcre2_implibpath} ${_pcre2_implibpath_posix}
8694
USES_TERMINAL_BUILD TRUE
8795
)
8896

89-
# PCRE is not used for Linux and MacOS (Boost regex is used) in the current code. Copy library files manually since there are tools that are not needed in the
90-
# bin folder.
91-
ADD_CUSTOM_COMMAND(
92-
COMMENT "Staging ${_target}'s shared library into ${RV_STAGE_BIN_DIR}"
93-
OUTPUT ${RV_STAGE_BIN_DIR}/${_pcre2_libname} ${RV_STAGE_BIN_DIR}/${_pcre2_libname_posix}
94-
COMMAND ${CMAKE_COMMAND} -E copy ${_pcre2_libpath} ${_pcre2_libpath_posix} -t ${RV_STAGE_BIN_DIR}
95-
DEPENDS ${_target}
96-
)
97-
98-
ADD_CUSTOM_TARGET(
99-
${_target}-stage-target ALL
100-
DEPENDS ${RV_STAGE_BIN_DIR}/${_pcre2_libname} ${RV_STAGE_BIN_DIR}/${_pcre2_libname_posix}
101-
)
102-
103-
ADD_DEPENDENCIES(dependencies ${_target}-stage-target)
104-
105-
ADD_LIBRARY(pcre2-8 SHARED IMPORTED GLOBAL)
106-
ADD_LIBRARY(pcre2-posix SHARED IMPORTED GLOBAL)
107-
108-
ADD_DEPENDENCIES(pcre2-8 ${_target})
109-
ADD_DEPENDENCIES(pcre2-posix ${_target})
110-
111-
# Setup includes
112-
SET(_pcre2_include_dir
113-
${_install_dir}/include
97+
RV_STAGE_DEPENDENCY_LIBS(
98+
TARGET
99+
${_target}
100+
BIN_DIR
101+
${_bin_dir}
102+
OUTPUTS
103+
${RV_STAGE_BIN_DIR}/${_pcre2_libname}
104+
${RV_STAGE_BIN_DIR}/${_pcre2_libname_posix}
114105
)
115-
FILE(MAKE_DIRECTORY ${_pcre2_include_dir})
116106

117-
# Setup pcre2 8-bits target
118-
SET_TARGET_PROPERTIES(
119-
pcre2-8
120-
PROPERTIES IMPORTED_LOCATION ${_pcre2_libpath}
121-
IMPORTED_IMPLIB ${_pcre2_implibpath}
122-
)
123-
TARGET_INCLUDE_DIRECTORIES(
107+
RV_ADD_IMPORTED_LIBRARY(
108+
NAME
124109
pcre2-8
125-
INTERFACE ${_pcre2_include_dir}
110+
TYPE
111+
SHARED
112+
LOCATION
113+
${_pcre2_libpath}
114+
SONAME
115+
${_pcre2_libname}
116+
IMPLIB
117+
${_pcre2_implibpath}
118+
INCLUDE_DIRS
119+
${_pcre2_include_dir}
120+
DEPENDS
121+
${_target}
122+
ADD_TO_DEPS_LIST
126123
)
127124
TARGET_COMPILE_DEFINITIONS(
128125
pcre2-8
129126
INTERFACE PCRE2_CODE_UNIT_WIDTH=8
130127
)
131128

132-
# Setup pcre2-posix target
133-
SET_TARGET_PROPERTIES(
134-
pcre2-posix
135-
PROPERTIES IMPORTED_LOCATION ${_pcre2_libpath_posix}
136-
IMPORTED_IMPLIB ${_pcre2_implibpath_posix}
137-
)
138-
TARGET_INCLUDE_DIRECTORIES(
129+
RV_ADD_IMPORTED_LIBRARY(
130+
NAME
139131
pcre2-posix
140-
INTERFACE ${_pcre2_include_dir}
132+
TYPE
133+
SHARED
134+
LOCATION
135+
${_pcre2_libpath_posix}
136+
SONAME
137+
${_pcre2_libname_posix}
138+
IMPLIB
139+
${_pcre2_implibpath_posix}
140+
INCLUDE_DIRS
141+
${_pcre2_include_dir}
142+
DEPENDS
143+
${_target}
144+
ADD_TO_DEPS_LIST
141145
)
142-
143-
LIST(APPEND RV_DEPS_LIST pcre2-8 pcre2-posix)

cmake/dependencies/pyimgui.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,16 @@ RV_STAGE_DEPENDENCY_LIBS(
108108
OUTPUTS
109109
${_pybindings_location}/${_libname}
110110
)
111+
112+
# Windows only. Debug Python on Windows searches for modules with *_d suffix, but pyimgui does not create a pyimgui_d.pyd.
113+
IF(RV_TARGET_WINDOWS
114+
AND CMAKE_BUILD_TYPE MATCHES "^Debug$"
115+
)
116+
ADD_CUSTOM_COMMAND(
117+
TARGET ${_target}
118+
POST_BUILD
119+
COMMENT "Copying pyimgui.pyd to pyimgui_d.pyd in '${_pybindings_location}' for Python debug compatibility."
120+
COMMAND ${CMAKE_COMMAND} -E make_directory ${_pybindings_location}
121+
COMMAND ${CMAKE_COMMAND} -E copy ${_libpath} ${_pybindings_location}/pyimgui_d.pyd
122+
)
123+
ENDIF()

cmake/dependencies/pyimplot.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,16 @@ RV_STAGE_DEPENDENCY_LIBS(
104104
OUTPUTS
105105
${_pybindings_location}/${_libname}
106106
)
107+
108+
# Windows only. Debug Python on Windows searches for modules with *_d suffix, but pyimplot does not create a pyimplot_d.pyd.
109+
IF(RV_TARGET_WINDOWS
110+
AND CMAKE_BUILD_TYPE MATCHES "^Debug$"
111+
)
112+
ADD_CUSTOM_COMMAND(
113+
TARGET ${_target}
114+
POST_BUILD
115+
COMMENT "Copying pyimplot.pyd to pyimplot_d.pyd in '${_pybindings_location}' for Python debug compatibility."
116+
COMMAND ${CMAKE_COMMAND} -E make_directory ${_pybindings_location}
117+
COMMAND ${CMAKE_COMMAND} -E copy ${_libpath} ${_pybindings_location}/pyimplot_d.pyd
118+
)
119+
ENDIF()

0 commit comments

Comments
 (0)