File 0001-Avoid-creation-of-empty-build-directories-in-install.patch of Package python3-pyside2

From 08afddcf38ec96f2faf59c8ab548970fdc14a0b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 21 Dec 2018 16:15:26 +0100
Subject: [PATCH] Avoid creation of empty build directories in install tree

---
 sources/pyside2/cmake/Macros/PySideModules.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 98efd8c7..62af767d 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -170,9 +170,9 @@ macro(create_pyside_module)
     # install
     install(TARGETS ${module_NAME} LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
 
-    install(DIRECTORY "${CMAKE_BINARY_DIR}/" DESTINATION "${PYTHON_SITE_PACKAGES}"
-            OPTIONAL
-            FILES_MATCHING PATTERN "*.pyi")
+    file(GLOB hinting_stub_files RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/PySide2" "${CMAKE_CURRENT_BINARY_DIR}/PySide2/*.pyi")
+    install(FILES ${hinting_stub_files}
+            DESTINATION "${PYTHON_SITE_PACKAGES}/PySide2")
 
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module_NAME}/pyside2_${lower_module_name}_python.h
             DESTINATION include/PySide2${pyside2_SUFFIX}/${module_NAME}/)
-- 
2.19.2