aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/cmake
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-09 11:23:27 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-12 15:00:07 +0000
commit5d5eed53e49f4aaea85ce1638dd6fa3774a960e0 (patch)
tree4a5ec16c5097582e2708d5e584fb6e3672798033 /sources/pyside2/cmake
parent9f2a9aba3aff73e31ea15eb4a7a04b0e50f4ee4e (diff)
Remove modules from typesystem files when installing
The typesystem files end up in a flat directory after installing, so, the include by module name introduced by f2063ee4737f90c5d412a9a328672fde32b033eb no longer works. Remove the module in the install step. Task-number: PYSIDE-584 Change-Id: I6d0acdc26ee865c7e452bb702b7383579eef060d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/cmake')
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 9c39980cb..5ba705b13 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -121,7 +121,18 @@ macro(create_pyside_module
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module_name}/pyside2_${lower_module_name}_python.h
DESTINATION include/PySide2${pyside2_SUFFIX}/${module_name}/)
file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path})
- install(FILES ${typesystem_files} DESTINATION share/PySide2${pyside2_SUFFIX}/typesystems)
+
+# Copy typesystem files and remove module names from the <load-typesystem> element
+# so that it works in a flat directory:
+# <load-typesystem name="QtWidgets/typesystem_widgets.xml" ... ->
+# <load-typesystem name="typesystem_widgets.xml"
+ foreach(typesystem_file ${typesystem_files})
+ get_filename_component(typesystem_file_name "${typesystem_file}" NAME)
+ file(READ "${typesystem_file}" typesystemXml)
+ string(REGEX REPLACE "<load-typesystem name=\"[^/\"]+/" "<load-typesystem name=\"" typesystemXml "${typesystemXml}")
+ set(typesystem_target_file "${CMAKE_INSTALL_PREFIX}/share/PySide2${pyside2_SUFFIX}/typesystems/${typesystem_file_name}")
+ file(WRITE "${typesystem_target_file}" "${typesystemXml}")
+ endforeach()
endmacro()
#macro(check_qt_class_with_namespace module namespace class optional_source_files dropped_entries [namespace] [module])