aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-11-24 18:47:33 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-11-28 11:44:22 +0000
commitb067f541b46e0544a336629f7c4e2688e9465b67 (patch)
treeaa7ea609c687acfd74229b869907241cb3b4aa0c
parenta5d4a71d32d1b2a095119351a0935c49f3ac0a50 (diff)
Install snippets glue code
The module-specific glue files as well as the standalone glue files are now installed into the PySide2 package. The glue files are now also listed as dependencies for the shiboken generator run, which means that modifying those files will now correctly force a shiboken re-run for the relevant modules. Change-Id: I545c7ada379fafb7f225d0b0f5ce495bf6d4795d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--build_scripts/platforms/unix.py7
-rw-r--r--build_scripts/platforms/windows_desktop.py7
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt2
-rw-r--r--sources/pyside2/PySide2/QtCore/CMakeLists.txt16
-rw-r--r--sources/pyside2/PySide2/QtGui/CMakeLists.txt9
-rw-r--r--sources/pyside2/PySide2/QtScript/CMakeLists.txt9
-rw-r--r--sources/pyside2/PySide2/QtUiTools/CMakeLists.txt10
-rw-r--r--sources/pyside2/PySide2/QtWidgets/CMakeLists.txt12
-rw-r--r--sources/pyside2/cmake/Macros/PySideModules.cmake29
-rw-r--r--sources/pyside2/libpyside/PySide2Config-spec.cmake.in1
-rw-r--r--sources/pyside2/libpyside/pyside2.pc.in1
11 files changed, 92 insertions, 11 deletions
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py
index 7dce11612..fc56992f4 100644
--- a/build_scripts/platforms/unix.py
+++ b/build_scripts/platforms/unix.py
@@ -170,6 +170,13 @@ def prepare_packages_posix(self, vars):
"{st_build_dir}/{st_package_name}/typesystems",
vars=vars)
+ # <install>/share/{st_package_name}/glue/* ->
+ # <setup>/{st_package_name}/glue
+ copydir(
+ "{install_dir}/share/{st_package_name}/glue",
+ "{st_build_dir}/{st_package_name}/glue",
+ vars=vars)
+
# <source>/pyside2/{st_package_name}/support/* ->
# <setup>/{st_package_name}/support/*
copydir(
diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py
index 6307238a1..c61bbbc99 100644
--- a/build_scripts/platforms/windows_desktop.py
+++ b/build_scripts/platforms/windows_desktop.py
@@ -193,6 +193,13 @@ def prepare_packages_win32(self, vars):
"{st_build_dir}/{st_package_name}/typesystems",
vars=vars)
+ # <install>/share/{st_package_name}/glue/* ->
+ # <setup>/{st_package_name}/glue
+ copydir(
+ "{install_dir}/share/{st_package_name}/glue",
+ "{st_build_dir}/{st_package_name}/glue",
+ vars=vars)
+
# <source>/pyside2/{st_package_name}/support/* ->
# <setup>/{st_package_name}/support/*
copydir(
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index bceaa3bfa..f4c2ae9d4 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -22,7 +22,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/signature/lib/__init__.py"
"${CMAKE_CURRENT_BINARY_DIR}/support/signature/lib/__init__.py" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/signature/lib/enum_sig.py"
"${CMAKE_CURRENT_BINARY_DIR}/support/signature/lib/enum_sig.py" COPYONLY)
-
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_config.py.in"
"${CMAKE_CURRENT_BINARY_DIR}/_config.py" @ONLY)
@@ -98,4 +97,3 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
DESTINATION share/PySide2${pyside_SUFFIX}/typesystems)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h
DESTINATION include/${BINDING_NAME}${pyside2_SUFFIX})
-
diff --git a/sources/pyside2/PySide2/QtCore/CMakeLists.txt b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
index e583bd0f4..745d50083 100644
--- a/sources/pyside2/PySide2/QtCore/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtCore/CMakeLists.txt
@@ -180,6 +180,17 @@ ${SPECIFIC_OS_FILES}
${QtCore_GEN_DIR}/qtcore_module_wrapper.cpp
)
+set(QtCore_glue_sources
+ "${QtCore_SOURCE_DIR}/glue/qbytearray_bufferprotocol.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qbytearray_mgetitem.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qbytearray_msetitem.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qcoreapplication_init.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qeasingcurve_glue.h"
+ "${QtCore_SOURCE_DIR}/glue/qobject_connect.cpp"
+ "${QtCore_SOURCE_DIR}/glue/qobject_findchild.cpp"
+)
+
configure_file("${QtCore_SOURCE_DIR}/typesystem_core.xml.in"
"${QtCore_BINARY_DIR}/typesystem_core.xml" @ONLY)
@@ -202,5 +213,8 @@ create_pyside_module(QtCore
QtCore_SOURCE_DIR
QtCore_SRC
QtCore_gluecode
- ${QtCore_BINARY_DIR}/typesystem_core.xml)
+ ${QtCore_BINARY_DIR}/typesystem_core.xml
+ ""
+ QtCore_glue_sources
+ )
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
index b330a63bf..1e5366733 100644
--- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
@@ -222,6 +222,10 @@ else()
message(STATUS "Qt5Gui: Adding Desktop OpenGL classes")
endif()
+set(QtGui_glue_sources
+ "${QtGui_SOURCE_DIR}/glue/qguiapplication_init.cpp"
+)
+
configure_file("${QtGui_SOURCE_DIR}/typesystem_gui.xml.in"
"${QtGui_BINARY_DIR}/typesystem_gui.xml" @ONLY)
@@ -252,9 +256,8 @@ create_pyside_module(QtGui
QtGui_SRC
QPYTEXTOBJECT_MOC
${QtGui_BINARY_DIR}/typesystem_gui.xml
- ""
- ""
- QtGui_DROPPED_ENTRIES)
+ QtGui_DROPPED_ENTRIES
+ QtGui_glue_sources)
install(FILES ${pyside2_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide2/QtGui/)
diff --git a/sources/pyside2/PySide2/QtScript/CMakeLists.txt b/sources/pyside2/PySide2/QtScript/CMakeLists.txt
index 1e06c4644..08f5847b6 100644
--- a/sources/pyside2/PySide2/QtScript/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtScript/CMakeLists.txt
@@ -18,6 +18,10 @@ ${QtScript_GEN_DIR}/qscriptvalueiterator_wrapper.cpp
${QtScript_GEN_DIR}/qtscript_module_wrapper.cpp
)
+set(QtScript_glue_sources
+ "${QtScript_SOURCE_DIR}/qscript_value_iterator_glue.cpp"
+)
+
set(QtScript_include_dirs ${QtScript_SOURCE_DIR}
${QtScript_BINARY_DIR}
${Qt5Core_INCLUDE_DIRS}
@@ -39,4 +43,7 @@ create_pyside_module(QtScript
QtScript_deps
QtScript_SOURCE_DIR
QtScript_SRC
- "")
+ ""
+ ""
+ ""
+ QtScript_glue_sources)
diff --git a/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt b/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt
index e4de03f49..bedbf74af 100644
--- a/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtUiTools/CMakeLists.txt
@@ -6,6 +6,11 @@ ${QtUiTools_GEN_DIR}/quiloader_wrapper.cpp
${QtUiTools_GEN_DIR}/qtuitools_module_wrapper.cpp
)
+set(QtUiTools_glue_sources
+ "${QtUiTools_SOURCE_DIR}/glue/plugins.h"
+ "${QtUiTools_SOURCE_DIR}/glue/uitools_loadui.cpp"
+)
+
set(QtUiTools_include_dirs ${QtUiTools_SOURCE_DIR}
${QtUiTools_BINARY_DIR}
${Qt5Core_INCLUDE_DIRS}
@@ -38,4 +43,7 @@ create_pyside_module(QtUiTools
QtUiTools_deps
QtUiTools_SOURCE_DIR
QtUiTools_SRC
- "")
+ ""
+ ""
+ ""
+ QtUiTools_glue_sources)
diff --git a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
index 6b8830a41..78db04ded 100644
--- a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt
@@ -207,6 +207,14 @@ ${SPECIFIC_OS_FILES}
${QtWidgets_GEN_DIR}/qtwidgets_module_wrapper.cpp
)
+set(QtWidgets_glue_sources
+ "${QtWidgets_SOURCE_DIR}/glue/qapplication_init.cpp"
+ "${QtWidgets_SOURCE_DIR}/glue/qlayout_help_functions.cpp"
+ "${QtWidgets_SOURCE_DIR}/glue/qmenu_glue.cpp"
+ "${QtWidgets_SOURCE_DIR}/glue/qmenubar_glue.cpp"
+ "${QtWidgets_SOURCE_DIR}/glue/qwidget_glue.cpp"
+)
+
configure_file("${QtWidgets_SOURCE_DIR}/typesystem_widgets.xml.in"
"${QtWidgets_BINARY_DIR}/typesystem_widgets.xml" @ONLY)
@@ -238,4 +246,6 @@ create_pyside_module(QtWidgets
QtWidgets_SOURCE_DIR
QtWidgets_SRC
""
- ${QtWidgets_BINARY_DIR}/typesystem_widgets.xml)
+ ${QtWidgets_BINARY_DIR}/typesystem_widgets.xml
+ ""
+ QtWidgets_glue_sources)
diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake
index 0f8b500ac..cd2786b13 100644
--- a/sources/pyside2/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside2/cmake/Macros/PySideModules.cmake
@@ -14,7 +14,11 @@ macro(create_pyside_module
module_deps
module_typesystem_path
module_sources
- module_static_sources)
+ module_static_sources
+ #module_typesystem_name
+ #module_dropped_entries
+ #module_glue_sources
+ )
string(TOLOWER ${module_name} _module)
string(REGEX REPLACE ^qt "" _module ${_module})
if(${ARGC} GREATER 7)
@@ -27,6 +31,11 @@ macro(create_pyside_module
else()
set (dropped_entries "")
endif()
+ if(${ARGC} GREATER 9)
+ set (glue_sources "${${ARGV9}}")
+ else()
+ set (glue_sources "")
+ endif()
if (NOT EXISTS ${typesystem_name})
set(typesystem_path ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module}.xml)
@@ -80,6 +89,21 @@ macro(create_pyside_module
get_filename_component(pyside_binary_dir ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY)
+ # Install module glue files.
+ string(TOLOWER ${module_name} lower_module_name)
+ set(${module_name}_glue "${CMAKE_CURRENT_SOURCE_DIR}/../glue/${lower_module_name}.cpp")
+ set(${module_name}_glue_dependency "")
+ if(EXISTS ${${module_name}_glue})
+ install(FILES ${${module_name}_glue} DESTINATION share/PySide2${pyside2_SUFFIX}/glue)
+ set(${module_name}_glue_dependency ${${module_name}_glue})
+ endif()
+
+ # Install standalone glue files into typesystems subfolder, so that the resolved relative
+ # paths remain correct.
+ if (glue_sources)
+ install(FILES ${glue_sources} DESTINATION share/PySide2${pyside2_SUFFIX}/typesystems/glue)
+ endif()
+
add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mjb_rejected_classes.log"
BYPRODUCTS ${${module_sources}}
COMMAND "${SHIBOKEN_BINARY}" ${GENERATOR_EXTRA_FLAGS}
@@ -94,6 +118,8 @@ macro(create_pyside_module
--drop-type-entries="${dropped_entries}"
COMMAND ${_python_postprocessor}
DEPENDS ${total_type_system_files}
+ ${glue_sources}
+ ${${module_name}_glue_dependency}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${module_name}...")
@@ -117,7 +143,6 @@ macro(create_pyside_module
# install
install(TARGETS ${module_name} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}/PySide2)
- string(TOLOWER ${module_name} lower_module_name)
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})
diff --git a/sources/pyside2/libpyside/PySide2Config-spec.cmake.in b/sources/pyside2/libpyside/PySide2Config-spec.cmake.in
index 4281ade5b..afb81f5a6 100644
--- a/sources/pyside2/libpyside/PySide2Config-spec.cmake.in
+++ b/sources/pyside2/libpyside/PySide2Config-spec.cmake.in
@@ -16,3 +16,4 @@ else()
endif()
SET(PYSIDE_PYTHONPATH "@PYTHON_SITE_PACKAGES@")
SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide2@pyside2_SUFFIX@/typesystems")
+SET(PYSIDE_GLUE "@CMAKE_INSTALL_PREFIX@/share/PySide2@pyside2_SUFFIX@/glue")
diff --git a/sources/pyside2/libpyside/pyside2.pc.in b/sources/pyside2/libpyside/pyside2.pc.in
index 37a115989..ecbe0bbc8 100644
--- a/sources/pyside2/libpyside/pyside2.pc.in
+++ b/sources/pyside2/libpyside/pyside2.pc.in
@@ -3,6 +3,7 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
includedir=@CMAKE_INSTALL_PREFIX@/include/PySide2@pyside2_SUFFIX@
typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide2@pyside2_SUFFIX@/typesystems
+gluedir=@CMAKE_INSTALL_PREFIX@/share/PySide2@pyside2_SUFFIX@/glue
pythonpath=@PYTHON_SITE_PACKAGES@
Name: PySide2@pyside2_SUFFIX@