aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-19 13:39:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-19 13:41:17 +0200
commit154c712e3176a0a7dfa79cb9452a5a46f48578bc (patch)
tree4d95f7fddb6a356c895654454e84939a5e3ea521
parent0baf9dbbbfe140eb2db17d1aa8c894ca641cceea (diff)
parent8465adf2f908f8ef2630e78d840e07a13660253b (diff)
Merge remote-tracking branch 'origin/5.6' into 5.9
-rw-r--r--CMakeLists.txt86
-rw-r--r--PySide2/CMakeLists.txt94
-rw-r--r--libpyside/CMakeLists.txt41
-rw-r--r--libpyside/signalmanager.cpp.in4
4 files changed, 113 insertions, 112 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c5ec97c..d895497b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -200,6 +200,92 @@ else()
CACHE STRING "PySide version [full]" FORCE)
endif()
+include(PySideModules)
+
+macro(COLLECT_MODULE_IF_FOUND shortname)
+ set(name "Qt5${shortname}")
+ find_package(${name})
+ set(_name_found "${name}_FOUND")
+ if(${_name_found})
+ message(STATUS "module ${name} found (${ARGN})")
+
+ # Put the module at the end of pyside2_global.h
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PySide2/pyside2_global.h.add"
+ "#include \"Qt${shortname}/Qt${shortname}\"\n")
+ # record the shortnames for the tests
+ list(APPEND all_module_shortnames ${shortname})
+ else()
+ if("${ARGN}" STREQUAL "opt")
+ message(STATUS "optional module ${name} skipped")
+ elseif("${ARGN}" STREQUAL "essential")
+ message(STATUS "skipped module ${name} is essential!\n"
+ " We do not guarantee that all tests are working.")
+ else()
+ message(FATAL_ERROR "module ${name} MISSING")
+ endif()
+ endif()
+endmacro()
+
+# note: the order of this list is relevant for dependencies.
+# For instance: Qt5Printsupport must come before Qt5WebKitWidgets.
+COLLECT_MODULE_IF_FOUND(Core)
+COLLECT_MODULE_IF_FOUND(Gui essential)
+COLLECT_MODULE_IF_FOUND(Widgets essential)
+COLLECT_MODULE_IF_FOUND(PrintSupport essential)
+COLLECT_MODULE_IF_FOUND(Sql essential)
+COLLECT_MODULE_IF_FOUND(Network essential)
+COLLECT_MODULE_IF_FOUND(Test essential)
+if(NOT MSVC)
+ # right now this does not build on windows
+ COLLECT_MODULE_IF_FOUND(Concurrent essential)
+else()
+ set(DISABLE_QtConcurrent 1)
+ENDIF()
+if(UNIX AND NOT APPLE)
+ COLLECT_MODULE_IF_FOUND(X11Extras essential)
+endif()
+if(WIN32)
+ COLLECT_MODULE_IF_FOUND(WinExtras essential)
+endif()
+if(APPLE)
+ COLLECT_MODULE_IF_FOUND(MacExtras essential)
+endif()
+COLLECT_MODULE_IF_FOUND(Xml)
+COLLECT_MODULE_IF_FOUND(XmlPatterns opt)
+COLLECT_MODULE_IF_FOUND(Help opt)
+COLLECT_MODULE_IF_FOUND(Multimedia opt)
+COLLECT_MODULE_IF_FOUND(MultimediaWidgets opt)
+COLLECT_MODULE_IF_FOUND(OpenGL opt)
+COLLECT_MODULE_IF_FOUND(Qml opt)
+COLLECT_MODULE_IF_FOUND(Quick opt)
+COLLECT_MODULE_IF_FOUND(QuickWidgets opt)
+COLLECT_MODULE_IF_FOUND(Script opt)
+if(NOT MSVC)
+ # right now this does not build on windows
+ COLLECT_MODULE_IF_FOUND(ScriptTools opt)
+else()
+ set(DISABLE_QtScriptTools 1)
+ENDIF()
+COLLECT_MODULE_IF_FOUND(Svg opt)
+if(Qt5Designer_FOUND)
+ COLLECT_MODULE_IF_FOUND(UiTools opt)
+else()
+ set(DISABLE_QtUiTools 1)
+endif()
+COLLECT_MODULE_IF_FOUND(WebChannel opt)
+# still forgotten:
+#COLLECT_MODULE_IF_FOUND(WebEngineCore opt)
+#COLLECT_MODULE_IF_FOUND(WebEngine opt)
+COLLECT_MODULE_IF_FOUND(WebEngineWidgets opt)
+COLLECT_MODULE_IF_FOUND(WebKit opt)
+if(NOT MSVC)
+ # right now this does not build on windows
+ COLLECT_MODULE_IF_FOUND(WebKitWidgets opt)
+else()
+ set(DISABLE_QtWebKitWidgets 1)
+ENDIF()
+COLLECT_MODULE_IF_FOUND(WebSockets opt)
+
string(REGEX MATCHALL "[0-9]+" qt_version_helper "${Qt5Core_VERSION}")
list(GET qt_version_helper 0 QT_VERSION_MAJOR)
diff --git a/PySide2/CMakeLists.txt b/PySide2/CMakeLists.txt
index d016bc3a..01d9f64c 100644
--- a/PySide2/CMakeLists.txt
+++ b/PySide2/CMakeLists.txt
@@ -1,99 +1,5 @@
project(pyside2)
-include(PySideModules)
-
-macro(COLLECT_MODULE_IF_FOUND shortname)
- set(name "Qt5${shortname}")
- find_package(${name})
- set(_name_found "${name}_FOUND")
- if(${_name_found})
- message(STATUS "module ${name} found (${ARGN})")
-
- # Hoist this to the parent scope to make sure all tests get built
- set("${name}_FOUND" 1 PARENT_SCOPE)
- # also put the module at the end of pyside2_global.h
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add"
- "#include \"Qt${shortname}/Qt${shortname}\"\n")
- # record the shortnames for the tests
- list(APPEND all_module_shortnames ${shortname})
- set(all_module_shortnames ${all_module_shortnames} PARENT_SCOPE)
- else()
- if("${ARGN}" STREQUAL "opt")
- message(STATUS "optional module ${name} skipped")
- elseif("${ARGN}" STREQUAL "essential")
- message(STATUS "skipped optional module ${name} is essential!\n"
- " We do not guarantee that all tests are working.")
- else()
- message(FATAL_ERROR "module ${name} MISSING")
- endif()
- endif()
-endmacro()
-
-# note: the order of this list is relevant for dependencies.
-# For instance: Qt5Printsupport must come before Qt5WebKitWidgets.
-COLLECT_MODULE_IF_FOUND(Core)
-COLLECT_MODULE_IF_FOUND(Gui essential)
-COLLECT_MODULE_IF_FOUND(Widgets essential)
-COLLECT_MODULE_IF_FOUND(PrintSupport essential)
-COLLECT_MODULE_IF_FOUND(Sql essential)
-COLLECT_MODULE_IF_FOUND(Network essential)
-COLLECT_MODULE_IF_FOUND(Test essential)
-if(NOT MSVC)
- # right now this does not build on windows
- COLLECT_MODULE_IF_FOUND(Concurrent essential)
-else()
- # Note: in order to use this variable in a sibling project (tests),
- # we need to either make the value persistent like so:
- # set(DISABLE_QtConcurrent 1 CACHE INTERNAL "")
- # or export it to the caller's scope by the PARENT_SCOPE specifier.
- # This is preferable, because there are no sticky side effects.
- set(DISABLE_QtConcurrent 1 PARENT_SCOPE)
-ENDIF()
-if(UNIX AND NOT APPLE)
- COLLECT_MODULE_IF_FOUND(X11Extras essential)
-endif()
-if(WIN32)
- COLLECT_MODULE_IF_FOUND(WinExtras essential)
-endif()
-if(APPLE)
- COLLECT_MODULE_IF_FOUND(MacExtras essential)
-endif()
-COLLECT_MODULE_IF_FOUND(Xml)
-COLLECT_MODULE_IF_FOUND(XmlPatterns opt)
-COLLECT_MODULE_IF_FOUND(Help opt)
-COLLECT_MODULE_IF_FOUND(Multimedia opt)
-COLLECT_MODULE_IF_FOUND(MultimediaWidgets opt)
-COLLECT_MODULE_IF_FOUND(OpenGL opt)
-COLLECT_MODULE_IF_FOUND(Qml opt)
-COLLECT_MODULE_IF_FOUND(Quick opt)
-COLLECT_MODULE_IF_FOUND(QuickWidgets opt)
-COLLECT_MODULE_IF_FOUND(Script opt)
-if(NOT MSVC)
- # right now this does not build on windows
- COLLECT_MODULE_IF_FOUND(ScriptTools opt)
-else()
- set(DISABLE_QtScriptTools 1 PARENT_SCOPE)
-ENDIF()
-COLLECT_MODULE_IF_FOUND(Svg opt)
-if(Qt5Designer_FOUND)
- COLLECT_MODULE_IF_FOUND(UiTools opt)
-else()
- set(DISABLE_QtUiTools 1 PARENT_SCOPE)
-endif()
-COLLECT_MODULE_IF_FOUND(WebChannel opt)
-# still forgotten:
-#COLLECT_MODULE_IF_FOUND(WebEngineCore opt)
-#COLLECT_MODULE_IF_FOUND(WebEngine opt)
-COLLECT_MODULE_IF_FOUND(WebEngineWidgets opt)
-COLLECT_MODULE_IF_FOUND(WebKit opt)
-if(NOT MSVC)
- # right now this does not build on windows
- COLLECT_MODULE_IF_FOUND(WebKitWidgets opt)
-else()
- set(DISABLE_QtWebKitWidgets 1 PARENT_SCOPE)
-ENDIF()
-COLLECT_MODULE_IF_FOUND(WebSockets opt)
-
# Configure include based on platform
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" @ONLY)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index faf15fb3..b740e403 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -1,31 +1,40 @@
project(libpyside)
if(${Qt5Qml_FOUND})
-if(NOT "${Qt5Qml_PRIVATE_INCLUDE_DIRS}" MATCHES "/QtQml/")
- string(REPLACE "/QtCore" "/QtQml" replaceme "${Qt5Core_PRIVATE_INCLUDE_DIRS}")
- list(APPEND Qt5Qml_PRIVATE_INCLUDE_DIRS ${replaceme})
- list(REMOVE_DUPLICATES Qt5Qml_PRIVATE_INCLUDE_DIRS)
-endif()
+ if(NOT "${Qt5Qml_PRIVATE_INCLUDE_DIRS}" MATCHES "/QtQml/")
+ string(REPLACE "/QtCore" "/QtQml" replaceme "${Qt5Core_PRIVATE_INCLUDE_DIRS}")
+ list(APPEND Qt5Qml_PRIVATE_INCLUDE_DIRS ${replaceme})
+ list(REMOVE_DUPLICATES Qt5Qml_PRIVATE_INCLUDE_DIRS)
+ endif()
endif()
+
if(${Qt5Quick_FOUND})
-if(NOT "${Qt5Quick_PRIVATE_INCLUDE_DIRS}" MATCHES "/QtQuick/")
- string(REPLACE "/QtCore" "/QtQuick" replaceme "${Qt5Core_PRIVATE_INCLUDE_DIRS}")
- list(APPEND Qt5Quick_PRIVATE_INCLUDE_DIRS ${Qt5Qml_PRIVATE_INCLUDE_DIRS})
- list(APPEND Qt5Quick_PRIVATE_INCLUDE_DIRS ${replaceme})
- list(REMOVE_DUPLICATES Qt5Quick_PRIVATE_INCLUDE_DIRS)
-endif()
+ if(NOT "${Qt5Quick_PRIVATE_INCLUDE_DIRS}" MATCHES "/QtQuick/")
+ string(REPLACE "/QtCore" "/QtQuick" replaceme "${Qt5Core_PRIVATE_INCLUDE_DIRS}")
+ list(APPEND Qt5Quick_PRIVATE_INCLUDE_DIRS ${Qt5Qml_PRIVATE_INCLUDE_DIRS})
+ list(APPEND Qt5Quick_PRIVATE_INCLUDE_DIRS ${replaceme})
+ list(REMOVE_DUPLICATES Qt5Quick_PRIVATE_INCLUDE_DIRS)
+ endif()
endif()
-if(Qt5Qml_FOUND AND Qt5Qml_PRIVATE_INCLUDE_DIRS)
- set(QML_INCLUDES ${Qt5Qml_INCLUDE_DIRS} ${Qt5Qml_PRIVATE_INCLUDE_DIRS})
+if(Qt5Qml_FOUND)
+ # Used for registering custom QQuickItem classes defined in Python code.
+ set(QML_SUPPORT 1)
+ set(QML_INCLUDES ${Qt5Qml_INCLUDE_DIRS})
set(QML_LIBRARIES ${Qt5Qml_LIBRARIES})
- set(QML_SUPPORT 1)
+ if(Qt5Qml_PRIVATE_INCLUDE_DIRS)
+ # Used for transforming QML exceptions into Python exceptions.
+ set(QML_PRIVATE_API_SUPPORT 1)
+ set(QML_INCLUDES ${QML_INCLUDES} ${Qt5Qml_PRIVATE_INCLUDE_DIRS})
+ else()
+ set(QML_PRIVATE_API_SUPPORT 0)
+ message(WARNING "QML private API include files could not be found, support for catching QML exceptions inside Python code will not work.")
+ endif()
else()
+ set(QML_SUPPORT 0)
set(QML_INCLUDES "")
set(QML_LIBRARIES "")
-
- set(QML_SUPPORT 0)
endif()
qt5_wrap_cpp(DESTROYLISTENER_MOC "destroylistener.h")
diff --git a/libpyside/signalmanager.cpp.in b/libpyside/signalmanager.cpp.in
index d6757efb..473057cb 100644
--- a/libpyside/signalmanager.cpp.in
+++ b/libpyside/signalmanager.cpp.in
@@ -61,7 +61,7 @@
#include <conversions.h>
// These private headers are needed to throw JavaScript exceptions
-#if @QML_SUPPORT@
+#if @QML_PRIVATE_API_SUPPORT@
#include <private/qv4engine_p.h>
#include <private/qv4context_p.h>
#include <private/qqmldata_p.h>
@@ -489,7 +489,7 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
if (PyErr_Occurred()) {
-#if @QML_SUPPORT@
+#if @QML_PRIVATE_API_SUPPORT@
// This JS engine grabber based off of Qt 5.5's `qjsEngine` function
QQmlData *data = QQmlData::get(object, false);