44# SPDX-License-Identifier: Apache-2.0
55#
66
7+
78SET (_python3_target
89 "RV_DEPS_PYTHON3"
910)
@@ -12,8 +13,10 @@ SET(_opentimelineio_target
1213 "RV_DEPS_OPENTIMELINEIO"
1314)
1415
15- SET (_pyside2_target
16- "RV_DEPS_PYSIDE2"
16+ RV_VFX_SET_VARIABLE(
17+ _pyside_target
18+ CY2023 "RV_DEPS_PYSIDE2"
19+ CY2024 "RV_DEPS_PYSIDE6"
1720)
1821
1922SET (PYTHON_VERSION_MAJOR
@@ -48,10 +51,9 @@ SET(_opentimelineio_version
4851)
4952
5053RV_VFX_SET_VARIABLE(
51- _pyside2_version
54+ _pyside_version
5255 CY2023 "5.15.10"
53- # Need 5.15.11+ to support Python 3.11.
54- CY2024 "5.15.11"
56+ CY2024 "6.5.3"
5557)
5658
5759SET (_python3_download_url
@@ -70,13 +72,16 @@ SET(_opentimelineio_git_tag
7072 "v${_opentimelineio_version} "
7173)
7274
73- SET (_pyside2_archive_url
74- "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside2_version} -src/pyside-setup-opensource-src-${_pyside2_version} .zip"
75+ RV_VFX_SET_VARIABLE(
76+ _pyside_archive_url
77+ CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version} -src/pyside-setup-opensource-src-${_pyside_version} .zip"
78+ CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version} -src/pyside-setup-everywhere-src-${_pyside_version} .zip"
7579)
80+
7681RV_VFX_SET_VARIABLE(
77- _pyside2_download_hash
82+ _pyside_download_hash
7883 CY2023 "87841aaced763b6b52e9b549e31a493f"
79- CY2024 "8f652b08c1c74f9a80a2c0f16ff2a4ca "
84+ CY2024 "515d3249c6e743219ff0d7dd25b8c8d8 "
8085)
8186
8287SET (_install_dir
@@ -103,13 +108,13 @@ IF(RV_TARGET_WINDOWS)
103108ENDIF ()
104109
105110FETCHCONTENT_DECLARE(
106- ${_pyside2_target }
107- URL ${_pyside2_archive_url }
108- URL_HASH MD5=${_pyside2_download_hash }
111+ ${_pyside_target }
112+ URL ${_pyside_archive_url }
113+ URL_HASH MD5=${_pyside_download_hash }
109114 SOURCE_SUBDIR "sources" # Avoids the top level CMakeLists.txt
110115)
111116
112- FETCHCONTENT_MAKEAVAILABLE(${_pyside2_target } )
117+ FETCHCONTENT_MAKEAVAILABLE(${_pyside_target } )
113118
114119SET (_python3_make_command_script
115120 "${PROJECT_SOURCE_DIR} /src/build/make_python.py"
@@ -136,30 +141,67 @@ IF(RV_TARGET_WINDOWS)
136141 LIST (APPEND _python3_make_command "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} " )
137142ENDIF ()
138143
139- SET (_pyside2_make_command_script
140- "${PROJECT_SOURCE_DIR} /src/build/make_pyside.py"
141- )
142- SET (_pyside2_make_command
143- python3 "${_pyside2_make_command_script} "
144- )
145- LIST (APPEND _pyside2_make_command "--variant" )
146- LIST (APPEND _pyside2_make_command ${CMAKE_BUILD_TYPE} )
147- LIST (APPEND _pyside2_make_command "--source-dir" )
148- LIST (APPEND _pyside2_make_command ${rv_deps_pyside2_SOURCE_DIR} )
149- LIST (APPEND _pyside2_make_command "--output-dir" )
150- LIST (APPEND _pyside2_make_command ${_install_dir} )
151- LIST (APPEND _pyside2_make_command "--temp-dir" )
152- LIST (APPEND _pyside2_make_command ${_build_dir} )
153- IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
154- LIST (APPEND _pyside2_make_command "--openssl-dir" )
155- LIST (APPEND _pyside2_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
144+
145+ # TODO_QT: Maybe we could use something like NOT CY2023
146+ # since after 2023, it is Qt6
147+ # TODO_QT: Below code could be simplified, but for now it is faster to test.
148+ IF (RV_VFX_PLATFORM STREQUAL CY2023)
149+ SET (_pyside_make_command_script
150+ "${PROJECT_SOURCE_DIR} /src/build/make_pyside.py"
151+ )
152+ SET (_pyside_make_command
153+ python3 "${_pyside_make_command_script} "
154+ )
155+
156+ LIST (APPEND _pyside_make_command "--variant" )
157+ LIST (APPEND _pyside_make_command ${CMAKE_BUILD_TYPE} )
158+ LIST (APPEND _pyside_make_command "--source-dir" )
159+ LIST (APPEND _pyside_make_command ${rv_deps_pyside2_SOURCE_DIR} )
160+ LIST (APPEND _pyside_make_command "--output-dir" )
161+ LIST (APPEND _pyside_make_command ${_install_dir} )
162+ LIST (APPEND _pyside_make_command "--temp-dir" )
163+ LIST (APPEND _pyside_make_command ${_build_dir} )
164+
165+ IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
166+ LIST (APPEND _pyside_make_command "--openssl-dir" )
167+ LIST (APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
168+ ENDIF ()
169+
170+ LIST (APPEND _pyside_make_command "--python-dir" )
171+ LIST (APPEND _pyside_make_command ${_install_dir} )
172+ LIST (APPEND _pyside_make_command "--qt-dir" )
173+ LIST (APPEND _pyside_make_command ${RV_DEPS_QT5_LOCATION} )
174+ LIST (APPEND _pyside_make_command "--python-version" )
175+ LIST (APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
176+ ELSEIF (RV_VFX_PLATFORM STREQUAL CY2024)
177+ SET (_pyside_make_command_script
178+ "${PROJECT_SOURCE_DIR} /src/build/make_pyside6.py"
179+ )
180+ SET (_pyside_make_command
181+ python3 "${_pyside_make_command_script} "
182+ )
183+
184+ LIST (APPEND _pyside_make_command "--variant" )
185+ LIST (APPEND _pyside_make_command ${CMAKE_BUILD_TYPE} )
186+ LIST (APPEND _pyside_make_command "--source-dir" )
187+ LIST (APPEND _pyside_make_command ${rv_deps_pyside6_SOURCE_DIR} )
188+ LIST (APPEND _pyside_make_command "--output-dir" )
189+ LIST (APPEND _pyside_make_command ${_install_dir} )
190+ LIST (APPEND _pyside_make_command "--temp-dir" )
191+ LIST (APPEND _pyside_make_command ${_build_dir} )
192+
193+ IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
194+ LIST (APPEND _pyside_make_command "--openssl-dir" )
195+ LIST (APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
196+ ENDIF ()
197+
198+ LIST (APPEND _pyside_make_command "--python-dir" )
199+ LIST (APPEND _pyside_make_command ${_install_dir} )
200+ LIST (APPEND _pyside_make_command "--qt-dir" )
201+ LIST (APPEND _pyside_make_command ${RV_DEPS_QT6_LOCATION} )
202+ LIST (APPEND _pyside_make_command "--python-version" )
203+ LIST (APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
156204ENDIF ()
157- LIST (APPEND _pyside2_make_command "--python-dir" )
158- LIST (APPEND _pyside2_make_command ${_install_dir} )
159- LIST (APPEND _pyside2_make_command "--qt-dir" )
160- LIST (APPEND _pyside2_make_command ${RV_DEPS_QT5_LOCATION} )
161- LIST (APPEND _pyside2_make_command "--python-version" )
162- LIST (APPEND _pyside2_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
163205
164206IF (RV_TARGET_WINDOWS)
165207 IF (CMAKE_BUILD_TYPE MATCHES "^Debug$" )
@@ -297,21 +339,40 @@ IF(RV_TARGET_WINDOWS
297339 )
298340ENDIF ()
299341
300- SET (${_pyside2_target } -build -flag
301- ${_install_dir} /${_pyside2_target } -build -flag
342+ SET (${_pyside_target } -build -flag
343+ ${_install_dir} /${_pyside_target } -build -flag
302344)
303345
304- ADD_CUSTOM_COMMAND (
305- COMMENT "Building PySide2 using ${_pyside2_make_command_script} "
306- OUTPUT ${${_pyside2_target} -build -flag}
307- # First PySide build script on Windows which doesn't respect '--debug' option
308- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR} /src/build /patch_PySide2/windows_desktop.py
309- ${rv_deps_pyside2_SOURCE_DIR} /build_scripts/platforms/windows_desktop.py
310- COMMAND ${_pyside2_make_command} --prepare --build
311- COMMAND cmake -E touch ${${_pyside2_target} -build -flag}
312- DEPENDS ${_python3_target} ${_pyside2_make_command_script} ${${_python3_target} -requirements-flag}
313- USES_TERMINAL
314- )
346+
347+ # TODO_QT: Maybe we could use something like NOT CY2023
348+ # since after 2023, it is Qt6
349+ # TODO_QT: Below code could be simplified, but for now it is faster to test.
350+ IF (RV_VFX_PLATFORM STREQUAL CY2023)
351+ ADD_CUSTOM_COMMAND (
352+ COMMENT "Building PySide2 using ${_pyside_make_command_script} "
353+ OUTPUT ${${_pyside_target} -build -flag}
354+ # First PySide build script on Windows which doesn't respect '--debug' option
355+ COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR} /src/build /patch_PySide2/windows_desktop.py
356+ ${rv_deps_pyside2_SOURCE_DIR} /build_scripts/platforms/windows_desktop.py
357+ COMMAND ${_pyside_make_command} --prepare --build
358+ COMMAND cmake -E touch ${${_pyside_target} -build -flag}
359+ DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target} -requirements-flag}
360+ USES_TERMINAL
361+ )
362+
363+ SET (_build_flag_depends ${${_pyside_target} -build -flag})
364+ ELSEIF (RV_VFX_PLATFORM STREQUAL CY2024)
365+ ADD_CUSTOM_COMMAND (
366+ COMMENT "Building PySide6 using ${_pyside_make_command_script} "
367+ OUTPUT ${${_pyside_target} -build -flag}
368+ COMMAND ${_pyside_make_command} --prepare --build
369+ COMMAND cmake -E touch ${${_pyside_target} -build -flag}
370+ DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target} -requirements-flag}
371+ USES_TERMINAL
372+ )
373+
374+ SET (_build_flag_depends ${${_pyside_target} -build -flag})
375+ ENDIF ()
315376
316377IF (RV_TARGET_WINDOWS)
317378 ADD_CUSTOM_COMMAND (
@@ -320,7 +381,7 @@ IF(RV_TARGET_WINDOWS)
320381 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /lib ${RV_STAGE_LIB_DIR}
321382 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /include ${RV_STAGE_INCLUDE_DIR}
322383 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /bin ${RV_STAGE_BIN_DIR}
323- DEPENDS ${_python3_target} ${${_pyside2_target} - build -flag} ${${_python3_target} -requirements-flag }
384+ DEPENDS ${_python3_target} ${${_python3_target} -requirements -flag} ${_build_flag_depends }
324385 )
325386 ADD_CUSTOM_TARGET (
326387 ${_python3_target} -stage-target ALL
@@ -333,7 +394,7 @@ ELSE()
333394 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /lib ${RV_STAGE_LIB_DIR}
334395 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /include ${RV_STAGE_INCLUDE_DIR}
335396 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /bin ${RV_STAGE_BIN_DIR}
336- DEPENDS ${_python3_target} ${${_pyside2_target} - build -flag} ${${_python3_target} -requirements-flag }
397+ DEPENDS ${_python3_target} ${${_python3_target} -requirements -flag} ${_build_flag_depends }
337398 )
338399 ADD_CUSTOM_TARGET (
339400 ${_python3_target} -stage-target ALL
@@ -370,8 +431,8 @@ SET(RV_DEPS_PYTHON3_VERSION
370431 ${_python3_version}
371432 CACHE INTERNAL "" FORCE
372433)
373- SET (RV_DEPS_PYSIDE2_VERSION
374- ${_pyside2_version }
434+ SET (RV_DEPS_PYSIDE_VERSION
435+ ${_pyside_version }
375436 CACHE INTERNAL "" FORCE
376437)
377438
0 commit comments