aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* 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.