python/cmake: Fix 3d pyi file generation with SIP 4.X

the pyi names start with a '_'.

Trying to install a QGIS with the python support generated from SIP 4 fails with this error:

```
-- Set non-toolchain portion of runtime path of "/usr/local/share/qgis/python/qgis/_gui.so" to ""
CMake Error at python/cmake_install.cmake:142 (file):
  file INSTALL cannot find
  "/home/XXXX/build/output/python/qgis/_3d_p.pyi": No such file or
  directory.
Call Stack (most recent call first):
  cmake_install.cmake:72 (include)
```

This is because, the generated pyi file is named `3d_p.pyi` and not  `_3d_p.pyi`
This is fixed by adding the missing underscore.

Related: https://github.com/qgis/QGIS/pull/58562
Related: https://github.com/qgis/QGIS/pull/58534
This commit is contained in:
Jean Felder 2025-04-08 18:12:36 +02:00
parent c67cf40580
commit 22380d2d1e
No known key found for this signature in database
GPG Key ID: 12722DC64D3F429E

View File

@ -213,7 +213,7 @@ if (WITH_3D)
if(SIP_BUILD_EXECUTABLE)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/3d/build/_3d_p/_3d_p.pyi DESTINATION ${QGIS_PYTHON_DIR})
elseif((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
set(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/3d_p.pyi)
set(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_3d_p.pyi)
install(FILES ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_3d_p.pyi DESTINATION ${QGIS_PYTHON_DIR})
endif()