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
@@ -40,9 +43,9 @@ SET(_opentimelineio_version
4043)
4144
4245RV_VFX_SET_VARIABLE(
43- _pyside2_version CY2023 "5.15.10"
44- # Need 5.15.11+ to support Python 3.11.
45- CY2024 "5.15.11 "
46+ _pyside_version
47+ CY2023 " 5.15.10"
48+ CY2024 "6.5.3 "
4649)
4750
4851SET (_python3_download_url
@@ -57,10 +60,17 @@ SET(_opentimelineio_git_tag
5760 "v${_opentimelineio_version} "
5861)
5962
60- SET (_pyside2_archive_url
61- "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside2_version} -src/pyside-setup-opensource-src-${_pyside2_version} .zip"
63+ RV_VFX_SET_VARIABLE(
64+ _pyside_archive_url
65+ CY2023 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside2/PySide2-${_pyside_version} -src/pyside-setup-opensource-src-${_pyside_version} .zip"
66+ CY2024 "https://mirrors.ocf.berkeley.edu/qt/official_releases/QtForPython/pyside6/PySide6-${_pyside_version} -src/pyside-setup-everywhere-src-${_pyside_version} .zip"
67+ )
68+
69+ RV_VFX_SET_VARIABLE(
70+ _pyside_download_hash
71+ CY2023 "87841aaced763b6b52e9b549e31a493f"
72+ CY2024 "515d3249c6e743219ff0d7dd25b8c8d8"
6273)
63- RV_VFX_SET_VARIABLE(_pyside2_download_hash CY2023 "87841aaced763b6b52e9b549e31a493f" CY2024 "8f652b08c1c74f9a80a2c0f16ff2a4ca" )
6474
6575SET (_install_dir
6676 ${RV_DEPS_BASE_DIR} /${_python3_target} /install
@@ -86,13 +96,13 @@ IF(RV_TARGET_WINDOWS)
8696ENDIF ()
8797
8898FETCHCONTENT_DECLARE(
89- ${_pyside2_target }
90- URL ${_pyside2_archive_url }
91- URL_HASH MD5=${_pyside2_download_hash }
99+ ${_pyside_target }
100+ URL ${_pyside_archive_url }
101+ URL_HASH MD5=${_pyside_download_hash }
92102 SOURCE_SUBDIR "sources" # Avoids the top level CMakeLists.txt
93103)
94104
95- FETCHCONTENT_MAKEAVAILABLE(${_pyside2_target } )
105+ FETCHCONTENT_MAKEAVAILABLE(${_pyside_target } )
96106
97107SET (_python3_make_command_script
98108 "${PROJECT_SOURCE_DIR} /src/build/make_python.py"
@@ -119,30 +129,67 @@ IF(RV_TARGET_WINDOWS)
119129 LIST (APPEND _python3_make_command "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} " )
120130ENDIF ()
121131
122- SET (_pyside2_make_command_script
123- "${PROJECT_SOURCE_DIR} /src/build/make_pyside.py"
124- )
125- SET (_pyside2_make_command
126- python3 "${_pyside2_make_command_script} "
127- )
128- LIST (APPEND _pyside2_make_command "--variant" )
129- LIST (APPEND _pyside2_make_command ${CMAKE_BUILD_TYPE} )
130- LIST (APPEND _pyside2_make_command "--source-dir" )
131- LIST (APPEND _pyside2_make_command ${rv_deps_pyside2_SOURCE_DIR} )
132- LIST (APPEND _pyside2_make_command "--output-dir" )
133- LIST (APPEND _pyside2_make_command ${_install_dir} )
134- LIST (APPEND _pyside2_make_command "--temp-dir" )
135- LIST (APPEND _pyside2_make_command ${_build_dir} )
136- IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
137- LIST (APPEND _pyside2_make_command "--openssl-dir" )
138- LIST (APPEND _pyside2_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
132+
133+ # TODO_QT: Maybe we could use something like NOT CY2023
134+ # since after 2023, it is Qt6
135+ # TODO_QT: Below code could be simplified, but for now it is faster to test.
136+ IF (RV_VFX_PLATFORM STREQUAL CY2023)
137+ SET (_pyside_make_command_script
138+ "${PROJECT_SOURCE_DIR} /src/build/make_pyside.py"
139+ )
140+ SET (_pyside_make_command
141+ python3 "${_pyside_make_command_script} "
142+ )
143+
144+ LIST (APPEND _pyside_make_command "--variant" )
145+ LIST (APPEND _pyside_make_command ${CMAKE_BUILD_TYPE} )
146+ LIST (APPEND _pyside_make_command "--source-dir" )
147+ LIST (APPEND _pyside_make_command ${rv_deps_pyside2_SOURCE_DIR} )
148+ LIST (APPEND _pyside_make_command "--output-dir" )
149+ LIST (APPEND _pyside_make_command ${_install_dir} )
150+ LIST (APPEND _pyside_make_command "--temp-dir" )
151+ LIST (APPEND _pyside_make_command ${_build_dir} )
152+
153+ IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
154+ LIST (APPEND _pyside_make_command "--openssl-dir" )
155+ LIST (APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
156+ ENDIF ()
157+
158+ LIST (APPEND _pyside_make_command "--python-dir" )
159+ LIST (APPEND _pyside_make_command ${_install_dir} )
160+ LIST (APPEND _pyside_make_command "--qt-dir" )
161+ LIST (APPEND _pyside_make_command ${RV_DEPS_QT5_LOCATION} )
162+ LIST (APPEND _pyside_make_command "--python-version" )
163+ LIST (APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
164+ ELSEIF (RV_VFX_PLATFORM STREQUAL CY2024)
165+ SET (_pyside_make_command_script
166+ "${PROJECT_SOURCE_DIR} /src/build/make_pyside6.py"
167+ )
168+ SET (_pyside_make_command
169+ python3 "${_pyside_make_command_script} "
170+ )
171+
172+ LIST (APPEND _pyside_make_command "--variant" )
173+ LIST (APPEND _pyside_make_command ${CMAKE_BUILD_TYPE} )
174+ LIST (APPEND _pyside_make_command "--source-dir" )
175+ LIST (APPEND _pyside_make_command ${rv_deps_pyside6_SOURCE_DIR} )
176+ LIST (APPEND _pyside_make_command "--output-dir" )
177+ LIST (APPEND _pyside_make_command ${_install_dir} )
178+ LIST (APPEND _pyside_make_command "--temp-dir" )
179+ LIST (APPEND _pyside_make_command ${_build_dir} )
180+
181+ IF (DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
182+ LIST (APPEND _pyside_make_command "--openssl-dir" )
183+ LIST (APPEND _pyside_make_command ${RV_DEPS_OPENSSL_INSTALL_DIR} )
184+ ENDIF ()
185+
186+ LIST (APPEND _pyside_make_command "--python-dir" )
187+ LIST (APPEND _pyside_make_command ${_install_dir} )
188+ LIST (APPEND _pyside_make_command "--qt-dir" )
189+ LIST (APPEND _pyside_make_command ${RV_DEPS_QT6_LOCATION} )
190+ LIST (APPEND _pyside_make_command "--python-version" )
191+ LIST (APPEND _pyside_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
139192ENDIF ()
140- LIST (APPEND _pyside2_make_command "--python-dir" )
141- LIST (APPEND _pyside2_make_command ${_install_dir} )
142- LIST (APPEND _pyside2_make_command "--qt-dir" )
143- LIST (APPEND _pyside2_make_command ${RV_DEPS_QT5_LOCATION} )
144- LIST (APPEND _pyside2_make_command "--python-version" )
145- LIST (APPEND _pyside2_make_command "${RV_DEPS_PYTHON_VERSION_SHORT} " )
146193
147194IF (RV_TARGET_WINDOWS)
148195 IF (CMAKE_BUILD_TYPE MATCHES "^Debug$" )
@@ -279,21 +326,40 @@ IF(RV_TARGET_WINDOWS
279326 )
280327ENDIF ()
281328
282- SET (${_pyside2_target } -build -flag
283- ${_install_dir} /${_pyside2_target } -build -flag
329+ SET (${_pyside_target } -build -flag
330+ ${_install_dir} /${_pyside_target } -build -flag
284331)
285332
286- ADD_CUSTOM_COMMAND (
287- COMMENT "Building PySide2 using ${_pyside2_make_command_script} "
288- OUTPUT ${${_pyside2_target} -build -flag}
289- # First PySide build script on Windows which doesn't respect '--debug' option
290- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR} /src/build /patch_PySide2/windows_desktop.py
291- ${rv_deps_pyside2_SOURCE_DIR} /build_scripts/platforms/windows_desktop.py
292- COMMAND ${_pyside2_make_command} --prepare --build
293- COMMAND cmake -E touch ${${_pyside2_target} -build -flag}
294- DEPENDS ${_python3_target} ${_pyside2_make_command_script} ${${_python3_target} -requirements-flag}
295- USES_TERMINAL
296- )
333+
334+ # TODO_QT: Maybe we could use something like NOT CY2023
335+ # since after 2023, it is Qt6
336+ # TODO_QT: Below code could be simplified, but for now it is faster to test.
337+ IF (RV_VFX_PLATFORM STREQUAL CY2023)
338+ ADD_CUSTOM_COMMAND (
339+ COMMENT "Building PySide2 using ${_pyside_make_command_script} "
340+ OUTPUT ${${_pyside_target} -build -flag}
341+ # First PySide build script on Windows which doesn't respect '--debug' option
342+ COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR} /src/build /patch_PySide2/windows_desktop.py
343+ ${rv_deps_pyside2_SOURCE_DIR} /build_scripts/platforms/windows_desktop.py
344+ COMMAND ${_pyside_make_command} --prepare --build
345+ COMMAND cmake -E touch ${${_pyside_target} -build -flag}
346+ DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target} -requirements-flag}
347+ USES_TERMINAL
348+ )
349+
350+ SET (_build_flag_depends ${${_pyside_target} -build -flag})
351+ ELSEIF (RV_VFX_PLATFORM STREQUAL CY2024)
352+ ADD_CUSTOM_COMMAND (
353+ COMMENT "Building PySide6 using ${_pyside_make_command_script} "
354+ OUTPUT ${${_pyside_target} -build -flag}
355+ COMMAND ${_pyside_make_command} --prepare --build
356+ COMMAND cmake -E touch ${${_pyside_target} -build -flag}
357+ DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target} -requirements-flag}
358+ USES_TERMINAL
359+ )
360+
361+ SET (_build_flag_depends ${${_pyside_target} -build -flag})
362+ ENDIF ()
297363
298364IF (RV_TARGET_WINDOWS)
299365 ADD_CUSTOM_COMMAND (
@@ -302,7 +368,7 @@ IF(RV_TARGET_WINDOWS)
302368 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /lib ${RV_STAGE_LIB_DIR}
303369 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /include ${RV_STAGE_INCLUDE_DIR}
304370 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /bin ${RV_STAGE_BIN_DIR}
305- DEPENDS ${_python3_target} ${${_pyside2_target} - build -flag} ${${_python3_target} -requirements-flag }
371+ DEPENDS ${_python3_target} ${${_python3_target} -requirements -flag} ${_build_flag_depends }
306372 )
307373 ADD_CUSTOM_TARGET (
308374 ${_python3_target} -stage-target ALL
@@ -315,7 +381,7 @@ ELSE()
315381 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /lib ${RV_STAGE_LIB_DIR}
316382 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /include ${RV_STAGE_INCLUDE_DIR}
317383 COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir} /bin ${RV_STAGE_BIN_DIR}
318- DEPENDS ${_python3_target} ${${_pyside2_target} - build -flag} ${${_python3_target} -requirements-flag }
384+ DEPENDS ${_python3_target} ${${_python3_target} -requirements -flag} ${_build_flag_depends }
319385 )
320386 ADD_CUSTOM_TARGET (
321387 ${_python3_target} -stage-target ALL
@@ -352,8 +418,8 @@ SET(RV_DEPS_PYTHON3_VERSION
352418 ${_python3_version}
353419 CACHE INTERNAL "" FORCE
354420)
355- SET (RV_DEPS_PYSIDE2_VERSION
356- ${_pyside2_version }
421+ SET (RV_DEPS_PYSIDE_VERSION
422+ ${_pyside_version }
357423 CACHE INTERNAL "" FORCE
358424)
359425
0 commit comments