aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-210/+0
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-281-1/+1
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* feature-select: implement class propertiesChristian Tismer2020-10-271-0/+2
| | | | | | | | | | | | | | | | | | | After implementing property objects for PySide, the static properties (properties for static functions) were quite missing, for instance from QtCore.QCoreApplication and QtWidgets.QApplication . This implementation uses the normal Python properties and derives a PySide.ClassProperty class which works almost the same on classes. The static methods had to be mutated to class methods explicitly. That would be automated by PyType_Ready, but here we are doing this after class initialization. Task-number: PYSIDE-1019 Change-Id: Iabe00be18e25881cc7a97507b6fdae3e2d57ff7a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Consolidate export/import macrosFriedemann Kleint2020-10-011-1/+1
| | | | | | | | | | | | | | | | | | | For the 3 libraries that need to export symbols, (libshiboken, libpyside, pysidetest), fix up the export/import macros to follow the Qt convention: - Define generic export/import macros LIBSHIBOKEN_EX/IMPORT equivalent to Q_DECL_EX/IMPORT. Remove definitions for the ancient g++ 4.X. - Reuse those in libpyside, pysidetest as PYSIDE_EX/IMPORT and PYSIDETEST_EX/IMPORT. - While building, define some BUILD_ macro indicating export. - Define the _API macros depending on the BUILD_ macro to be export or import, respectively as is done in Qt. Remove the ugly hack in pysidetest that tried to re-use the PYSIDE_API macro. - Brush up the headers a bit. Change-Id: I635891b7eec5a52a1dcf45022f7bfb6a9cfee83f Reviewed-by: Christian Tismer <tismer@stackless.com>
* feature-select: Implement a selectable feature frameworkChristian Tismer2020-07-101-0/+2
| | | | | | | | | | | | | | | | | | | | | This is the framework for selectable features. There are no real features implemented. Planned is a maximum of 8 features. They are all implemented as a dummy for now. The decision depends of the following setting at the beginning of a module after PySide2 import: from __feature__ import <feature name> For more info, see the Jira issue, section The Principle Of Selectable Features In PySide Task-number: PYSIDE-1019 Change-Id: If355e9294b5c16090b39d30422a90ea9c8523390 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Implement the QEnum/QFlag decorator, V2Christian Tismer2020-06-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation allows module-level and scoped QEnums which are Python enum types. Scoped types are registered in Qt's meta object system. Usage of QEnum/QFlag with decorator or function call: from enum import Enum, Flag, auto from PySide2.QtCore import QEnum, QFlag, QObject class Compass(QObject): @QEnum class Orientation(Enum): North, East, South, West = range(4) class Color(Flag): RED = auto() BLUE = auto() GREEN = auto() WHITE = RED | BLUE | GREEN QFlag(Color) Fixes: PYSIDE-957 Change-Id: Ie15f45cbd932c816b50724a96eee0c14ae1fdee8 Task-number: PYSIDE-487 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* pyside2: Prepare build system for Qt 6Friedemann Kleint2020-05-181-20/+22
| | | | | | | | | | | - Introduce a version variable to the CMakeLists. - Emulate the Qt5Core_INCLUDE_DIRS, Qt5Core_LIBRARIES variables by retrieving them from the INTERFACE - Raise the language level Task-number: PYSIDE-904 Change-Id: Ie4e43e7e6a9a2631d666038b80f306e2d9af47b1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Remove deprecated APIFriedemann Kleint2020-05-131-5/+0
| | | | | | | | | Remove deprecated functions and class DestroyListener, which had hard-coded Qt 5 specific meta object data. Task-number: PYSIDE-904 Change-Id: Idce86cd5df12dc918335f043c8d7a5f0a95db990 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Use new static stringsFriedemann Kleint2019-10-041-0/+2
| | | | | | | Initial-patch-by: Christian Tismer <tismer@stackless.com> Task-number: PYSIDE-1087 Change-Id: I5b4f0e70bc9b79dd4a4a545e97722ceba778ee53 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Modernize cmake buildAlexandru Croitor2019-02-071-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a CMake super project that includes the shiboken2, PySide2 and pyside2-tools subprojects, so that it's possible to build everything from Qt Creator (or any other IDE that supports CMake) with minimal set up effort, and thus inform the IDE CMake integration of all relevant files, for easier code editing, navigation and refactoring. This also lays the foundation for allowing 3rd parties to use the shiboken2 generator to generate custom modules. This is achieved by eliminating various hardcoded paths for libraries and include directories. Start using CMake targets throughout the build code to correctly propagate link flags and include dirs for libshiboken and shiboken2 executable targets. Same for the libpyside target. Generate two separate cmake config files (build-tree / install-tree) that can be used with find_package(Shiboken2), to make sure that the PySide2 project can be built as part of the super project build. This is currently the only way I've found to allow the super build to work. Note that for the build-tree find_package() to work, the CMAKE_MODULE_PATH has to be adjusted in the super project file. The generated config files contain variables and logic that allow usage of the installed shiboken package in downstream projects (PySide2). This involves things like getting the includes and libraries for the currently found python interpreter, the shiboken build type (release or debug), was shiboken built with limited api support, etc. Generate 2 separate (build-tree and install-tree) config files for PySide2, similar to how it's done for the shiboken case, for pyside2-tools to build correctly. Install shiboken2 target files using install(EXPORT) to allow building PySide2 with an installed Shiboken2 package (as opposed to one that is built as part of the super project). Same with PySide2 targets for pyside2-tools subproject. Make sure not to redefine uninstall targets if they are already defined. Add a --shorter-paths setup.py option, which would be used by the Windows CI, to circumvent creating paths that are too long, and thus avoiding build issues. Output the build characteristics / classifiers into the generated build_history/YYYY-MM-DD_AAAAAA/build_dir.txt file, so it can be used by the test runner to properly filter out blacklisted tests. This was necessary due to the shorter paths options. Fix various issues regarding target includes and library dependencies. Remove certain duplicated cmake code (like limited api check and build type checks) in PySide2, given that that information will now be present in the exported shiboken2 config file. Include a short README.cmake.md file that describes how to build the super project. References used https://rix0r.nl/blog/2015/08/13/cmake-guide/ https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/ https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 https://cliutils.gitlab.io/modern-cmake/chapters/basics/functions.html https://cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html https://github.com/ComicSansMS/libstratcom/blob/master/CMakeLists.txt Abandoned approach using ExternalProject references: https://cmake.org/cmake/help/latest/module/ExternalProject.html https://stackoverflow.com/questions/44990964/how-to-perform-cmakefind-package-at-build-stage-only Fixes: PYSIDE-919 Change-Id: Iaa15d20b279a04c5e16ce2795d03f912bc44a389 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libpyside: Port DynamicQMetaObject to QMetaObjectBuilderFriedemann Kleint2018-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | Qt 5 introduces a new class QMetaObjectBuilder for generating dynamic meta objects for use cases like QML. It provides an API to add methods, properties and info and a factory method toMetaObject() to obtain a QMetaObject snapshot reflecting the changes. Replace the DynamicQMetaObject aggregated by TypeUserData by a class MetaObjectBuilder wrapping a QMetaObjectBuilder with dirty-handling. The code to create the binary data of the QMetaObject can then be removed. For plain Qt objects, the wrapped base meta object will be returned (which fixes the bug). Task-number: PYSIDE-784 Change-Id: Id8a54570aff36c75fe0f3bf2d297a12d02cd773a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* libpyside: Remove deprecated GlobalReceiverFriedemann Kleint2018-10-011-2/+0
| | | | | Change-Id: Ied37d22fbd8277811aaea15af0018cec545814c7 Reviewed-by: Christian Tismer <tismer@stackless.com>
* libpyside: Replace configuration of signalmanager.cpp by definesFriedemann Kleint2018-09-271-5/+3
| | | | | | | | | This makes the development process easier. Task-number: PYSIDE-784 Change-Id: I07ced4b25b65c90e5a17d85be9b8f15a26e5d07d Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge remote-tracking branch 'origin/5.6' into 5.9Friedemann Kleint2018-02-231-1/+1
|\ | | | | | | Change-Id: I5d1a4734e8f44785898ba62beaa0bdd2004fca22
| * Don't copy duplicate libraries on package installationAlexandru Croitor2018-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes sure to resolve symlinks and copy only one file for every dynamic shared library used (vs 3 before -> 2 symlinks + 1 actual library). This avoids duplicate files, as well as saves space when creating wheel (e.g. no 3 copies of standalone WebEngine library). This filtering happens copying from CMake install dir into pyside_package_dir (the symlinks are still present in the CMake dir, but that shouldn't harm anybody, and might be useful for users of shiboken only for example). Task-number: PYSIDE-495 Change-Id: I0fe454e16c6b254a8682aa7b1c702ec01a3064f0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Remove examples submoduleFriedemann Kleint2018-01-251-4/+1
|/ | | | | Change-Id: I0e4e3472e1d5644db281fb46ce4ba4ddfc1eafae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make standalone installations relocatableAlexandru Croitor2017-11-151-0/+7
| | | | | | | | | | | | | | | | | | This is achieved by registering a qt.conf file with a Prefix pointing to a directory relative to the loaded PySide2 module (e.g. QtCore). Thus Qt does not crash due to not finding platform plugins. Because this change would affect tests, which are ran before the PySide package is installed, a new environment variable called PYSIDE_DISABLE_INTERNAL_QT_CONF is introduced. This variable disables the registration of the internal qt.conf file, thus it will not point to a not yet created location, which will allow tests to run as before. Change-Id: I5a96037adfafe1f08ea57535aa4a2a0d1660dfaf Task-number: PYSIDE-558 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Remove dead / unused code regarding conversionsAlexandru Croitor2017-11-021-1/+0
| | | | | | | | | | | | | | | | | | | | | There's a lot of code that was previously used for doing conversions between C++ / Python types (apparently relying on extensive RTTI / typeid manipulations), which got superseded by a cleaner templated approach. The old code was left behind, and there were a few instances where it was still used even though it wasn't needed, like in QtScript typesystem XML and shiboken's enum handling. Remove the old code, apply the small changes needed to make it work with new the code. This is cleanup to reduce the confusion regarding conversion behavior, and also preparation for a proper implementation of handling "void*" types. Change-Id: I8f16bb31436f9a677bb2d64c7197c4375005b656 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Improve suffix names for shared libraries and cmake config filesAlexandru Croitor2017-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This change decouples the naming of general shared libraries, python module extensions, and cmake configuration files. All of them are now computed depending on the python version and python build configuration, and can also be manually set via CMake variables. The module extensions names now use the most detailed 'import' prefix, which usually informs whether a debug or release python was used, or the Python ABI flags (for Python >= 3.2). When a debug Python interpreter is used for building PySide2, the preprocessor define Py_Debug is now correctly propagated to PySide2 sources, which fixes previous crashes in debug builds. This affects only Linux and macOS builds. There is a subsequent change for making it work for Windows builds. All in all, this now allows proper mixing of debug / release versions of the Python interpreter with debug / release versions of PySide2 on Linux and macOS. Task-number: PYSIDE-508 Change-Id: I88a05c3ada0fb32c7c29bdb86d7a2c15acc963b8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* move everying into sources/pyside2Oswald Buddenhagen2017-05-221-0/+166
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.