From 22380d2d1e6f342ecdf8b19e0054ee95b553ef36 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Tue, 8 Apr 2025 18:12:36 +0200 Subject: [PATCH] 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 --- python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index cf04c20710c..a1b1fb7ec5c 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -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()