From 479933e095168d07a54913f88642cfed4828c167 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 25 Mar 2019 11:37:38 +0100 Subject: [PATCH] PyFalkon: Fix build with Qt 5.12.2 BUG: 405833 FIXED-IN: 3.1.1 --- CMakeLists.txt | 10 +++++----- src/plugins/PyFalkon/CMakeLists.txt | 18 ++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5977df007..f2983cf64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,11 +121,11 @@ endif() # Optional: PySide2 find_package(PySide2 "2.0.0") find_package(Shiboken2 "2.0.0") -find_package(PythonLibs "3.0") -set_package_properties(PySide2 PROPERTIES DESCRIPTION "Python plugins (experimental)" TYPE OPTIONAL) -set_package_properties(Shiboken2 PROPERTIES DESCRIPTION "Python plugins (experimental)" TYPE OPTIONAL) -set_package_properties(PythonLibs PROPERTIES DESCRIPTION "Python plugins (experimental)" TYPE OPTIONAL) -if (PySide2_FOUND AND Shiboken2_FOUND AND PythonLibs_FOUND) +find_package(Python3 COMPONENTS Development) +set_package_properties(PySide2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) +set_package_properties(Shiboken2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) +set_package_properties(Python3 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) +if (PySide2_FOUND AND Shiboken2_FOUND AND Python3_FOUND) set(ENABLE_PYTHON_PLUGINS TRUE) endif() diff --git a/src/plugins/PyFalkon/CMakeLists.txt b/src/plugins/PyFalkon/CMakeLists.txt index 55893e5c6..7251d8086 100644 --- a/src/plugins/PyFalkon/CMakeLists.txt +++ b/src/plugins/PyFalkon/CMakeLists.txt @@ -136,7 +136,7 @@ set(GENERATED_SOURCES_DEPENDENCIES # Add custom target to run shiboken. add_custom_command(OUTPUT ${GENERATED_SOURCES} - COMMAND ${SHIBOKEN_BINARY} + COMMAND Shiboken2::shiboken2 ${SHIBOKEN_OPTIONS} ${GLOBAL_HEADER} ${TYPESYSTEM_FILE} DEPENDS ${GENERATED_SOURCES_DEPENDENCIES} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -144,17 +144,19 @@ add_custom_command(OUTPUT ${GENERATED_SOURCES} # We need to include the headers for the module bindings that we use. set(PYSIDE_ADDITIONAL_INCLUDES "") -foreach(INCLUDE_DIR ${PYSIDE_INCLUDE_DIR}) +get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES) +foreach(INCLUDE_DIR ${PYSIDE_INCLUDE_DIRS}) list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtCore") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtGui") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtNetwork") + list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtPrintSupport") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWidgets") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebChannel") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebEngineCore") list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtWebEngineWidgets") endforeach() -set( PyFalkon_SRCS +set(PyFalkon_SRCS pythonplugin.cpp ${GENERATED_SOURCES} ) @@ -164,9 +166,6 @@ install(TARGETS PyFalkon DESTINATION ${FALKON_INSTALL_PLUGINDIR}) target_include_directories(PyFalkon PRIVATE - ${SHIBOKEN_INCLUDE_DIR} - ${SHIBOKEN_PYTHON_INCLUDE_DIR} - ${PYSIDE_INCLUDE_DIR} ${PYSIDE_ADDITIONAL_INCLUDES} ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon @@ -175,10 +174,9 @@ target_include_directories(PyFalkon target_link_libraries(PyFalkon PRIVATE FalkonPrivate - ${PYTHON_LIBRARIES} - ${SHIBOKEN_LIBRARY} - ${SHIBOKEN_PYTHON_LIBRARIES} - ${PYSIDE_LIBRARY} + Shiboken2::libshiboken + PySide2::pyside2 + Python3::Python ) # Same as CONFIG += no_keywords to avoid syntax errors in object.h due to the usage of the word Slot