aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/cmake/PySideSetup.cmake
Commit message (Collapse)AuthorAgeFilesLines
* PySide6: Cleanup CMake configuration filesShyamnath Premnadh2025-07-071-0/+1
| | | | | | | | | | | | | | - Variables PYSIDE_PYTHONPATH, PYSIDE_TYPESYSTEMS, PYSIDE_GLUE were corrected to correctly reflect the paths for the build-tree in the CMake configuration files during super-project build of PySide6. These were also corrected for the install-tree based on the wheel structure. - Introduce two new CMake variables PYSIDE_PYTHON_CONFIG_SUFFIX and PYSIDE_SO_VERSION shipped with the CMake config files. - Fix pyside6qml to use the export set of pyside6. Change-Id: I3b177bfed31af1d0e3a13fcc9469019a7f349d22 Reviewed-by: Friedemann Kleint <[email protected]>
* Install QtAsyncioFriedemann Kleint2025-07-071-2/+15
| | | | | | | Initial-patch-by: Christian Tismer <[email protected]> Task-number: PYSIDE-769 Change-Id: I3e7bf645a2b55249685f7aac58eb93342bdb6eb7 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* build system: Extend sanitizer supportFriedemann Kleint2025-07-021-1/+4
| | | | | | | | | Enable address sanitizer for MSVC, which has gained support in the mean time. Add thread sanitizer with a warning. Task-number: PYSIDE-2221 Change-Id: Iaa5a377fdb1cf33c1dcad42df5528a3a3499c773 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* build system: Switch to new cross compilation support of shiboken6Friedemann Kleint2025-06-271-1/+0
| | | | | | | Fixes: PYSIDE-3105 Change-Id: Ie91ee71e7cd9948e34f3425cf42ff18326d9abe9 Reviewed-by: Shyamnath Premnadh <[email protected]> Reviewed-by: Ece Cinucen <[email protected]>
* Fix PySide build for 6.10Friedemann Kleint2025-06-251-1/+2
| | | | | | | | Task-number: PYSIDE-3011 Task-number: QTBUG-87776 Change-Id: If1bbeb6599ef60d72f49a949a30b01f9140c8d97 Reviewed-by: Ece Cinucen <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* Remove hard-coded Q_OS_ defines from the CMake filesFriedemann Kleint2025-06-181-3/+0
| | | | | | | | | | | | | The hard-coded ENABLE_ and Q_OS_ do not work for cross-compiling. They are in fact a left-over from the pre-clang code parser. Clang is actually able to set the right defines when parsing qsystemdetection.h if the correct target is set. pyside6_global.h then no longer needs to be configured by CMake. Task-number: PYSIDE-3105 Change-Id: I640ab9e254b9ba35d5b7194001f5700911a8d421 Reviewed-by: Shyamnath Premnadh <[email protected]>
* Pass CMAKE_SYSTEM_NAME as platform argument to shiboken6Friedemann Kleint2025-06-131-0/+1
| | | | | | Task-number: PYSIDE-3105 Change-Id: I2d1adb0b7b819caab09e72e382a9dc0f964fa14d Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* Make Remote Objects usable beyond ModelsBrett Stottlemyer2025-03-131-0/+3
| | | | | | | | | | | | While present, the Qt Remote Objects bindings to Python have not been very useful. The only usable components were those based on QAbstractItemModel, due to the lack of a way to interpret .rep files from Python. This addresses that limitation. Fixes: PYSIDE-862 Change-Id: Ice57c0c64f11c3c7e74d50ce3c48617bd9b422a3 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Brett Stottlemyer <[email protected]>
* Switch `find_package` from `Qt6<module>` to `Qt6::<component>`Cristian Le2025-03-051-0/+13
| | | | | | | | This guarantees that all find_package hints for `Qt6` are accounted for. Fixes: PYSIDE-3026 Change-Id: Iab7d3a72b1743747e360e7f5ed2372e1b30fa047 Reviewed-by: Shyamnath Premnadh <[email protected]>
* Fix trailing empty linesFriedemann Kleint2024-12-131-1/+0
| | | | | | Pick-to: 6.8 Change-Id: I1a5964463f703ade0657816cb974206355a5ae5b Reviewed-by: Shyamnath Premnadh <[email protected]>
* shiboken: Support compiler options for disabling optimizationsChristian Tismer2024-08-011-0/+4
| | | | | | | | | | | | | | | | | | | The fullname field has been removed, and the signature structures can be optionally compressed. Add a build option for switching these and future compiler features off. Combinable flags: --unoptimize=fullname --unoptimize=compression --unoptimize=folding (to be implemented) or just --unoptimize=all Task-number: PYSIDE-2701 Change-Id: I605dc810542ce99f99d9a6b6432e5feae09273b4 Reviewed-by: Friedemann Kleint <[email protected]>
* Build: Fix super project buildShyamnath Premnadh2023-12-181-0/+4
| | | | | | | | | | | | | - option USE_PYTHON_VERSION can be removed as an option since it does not need to be cached. Also, the default value of empty string did not really work and instead the default value was always set to OFF. - ensure that Python_EXECUTABLE is found during super build. - Related d5b56ebb1534a3359f03534a967bbe3cf2a5eb51 Pick-to: 6.6 Change-Id: I2a90a17a738c91117bcd62ff5e25e4ac7b1d2be4 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Alexandru Croitor <[email protected]>
* Shiboken: Remove FindPythonInterp and FindPythonLibs CMake modulesShyamnath Premnadh2023-12-111-1/+1
| | | | | | | | | | | | | | | - They were deprecated since 3.12 and removed in 3.27 - Use FindPython module as replacement - all the Python cmake variables resulted are renamed to their respective variable names as per the FindPython module instead of FindPythonInterp or FindPythonLibs module Pick-to: 6.6 Fixes: PYSIDE-2439 Change-Id: I1d3106e2cc9ee97e2d4f62d4e19e1a591d1021ad Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* CMake: Allow specifying a shiboken debug-level from the build systemAlexandru Croitor2023-11-011-0/+3
| | | | | | | | | | | | | | | The SHIBOKEN_DEBUG_LEVEL CMake or env var variables can now be set so that the build system passes that value to --debug-level of each shiboken invocation. The possible values are the ones that shiboken's command line parser expects: sparse, medium, full. This is useful for getting shiboken debug output in the CI. Pick-to: 6.6 Change-Id: I62d99e8f67884638449a69b10803aca3b1230e7b Reviewed-by: Friedemann Kleint <[email protected]>
* CMake: Allow passing extra generator flags via a CMake variableAlexandru Croitor2023-11-011-5/+7
| | | | | | | | | | | | | | | | | | | | When building shiboken or pyside directly using CMake, allow passing extra command line options to the shiboken executable when generating bindings. The variable is called SHIBOKEN_GENERATOR_EXTRA_FLAGS and expects a semicolon list of extra options to pass. This is useful for cross-compilation to specify things like extra compiler flags or include paths that the API extractor should take into account when parsing sources. Pick-to: 6.6 Task-number: PYSIDE-1958 Change-Id: I4896fc870d85861e7cc5adbb0e5ae7222ab61a40 Reviewed-by: Cristian Maureira-Fredes <[email protected]> Reviewed-by: Shyamnath Premnadh <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* shiboken6: Replace options related to nb_zero by nb_boolFriedemann Kleint2023-09-061-1/+1
| | | | | | | | | | | | | | nb_zero is Python 2 terminology. Rename the related functions and use new options. [ChangeLog][shiboken6] The command line options --use-operator-bool-as-nb_nonzero and --use-isnull-as-nb_nonzero have been replaced by --use-operator-bool-as-nb-bool and --use-isnull-as-nb-bool, respectivily to match Python 3 terminology. The old options continue to work. Change-Id: I1201f4b15e021c8df96740149c20fa1478c12ae1 Reviewed-by: Shyamnath Premnadh <[email protected]>
* Add license headers to cmake filesFriedemann Kleint2023-02-161-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Task-number: QTBUG-105718 Task-number: QTBUG-88621 Change-Id: I98bd2e80f182d8bf7aef6b633f37a428e2dac69b Reviewed-by: Christian Tismer <[email protected]> Reviewed-by: Kai Köhne <[email protected]>
* Build system: Use modern form of finding and linking Qt librariesFriedemann Kleint2022-11-291-3/+3
| | | | | | | Pick-to: 6.4 Task-number: PYSIDE-962 Change-Id: I91aed62a8e14bbc1101b4f23e25f57a5d6bca173 Reviewed-by: Alexandru Croitor <[email protected]>
* PySide: Enable override of PYTHON_SITE_PACKAGESShyamnath Premnadh2022-10-181-1/+3
| | | | | | | | | | | - Set PYTHON_SITE_PACKAGES if unset, while building PySide Pick-to: 6.4 Fixes: PYSIDE-2074 Change-Id: I8bbc3ebd8587dddeca9f5ca38077aad6a6169588 Reviewed-by: Adrian Herrmann <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* replace osx referencesCristián Maureira-Fredes2022-10-131-1/+1
| | | | | | | | | replacing them by macOS Pick-to: 6.4 Change-Id: Ic6a135406375ab1f0ebed3e63ba17423a34f13cb Reviewed-by: Adrian Herrmann <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* PySide6: Optimize for SizeShyamnath Premnadh2022-04-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build: use the following flag with setup.py to turn off size optimization --no-size-optimization Added the following compiler optimization flags and their corresponding flags on other platforms GCC - -ffunction-sections -fdata-section which segretates data and function section and linker flag --gc-section which removes unused code. - -fno-exceptions to disable exception handling - -Os - Optimize for size. Basically same as -O2 but removes some flags that cause increase in size. (Ran a couple of example and did not see difference in execution time) MSVC - /Gy /Gw /OPT:REF - same as -ffunction-sections, -fdata-section, -Wl, --gc-section - /EHsc same as -fno-exceptions - /O1 instead of /Os because for MSVC /O1 gave the best results. Clang - Same as GCC except for using -Oz instead of -Os. Experiments: Built a wheel with QtCore and noticed a 300kb reduction in size on both Windows and Linux. Built a complete wheel(except QTest) and it gives me a 4 mb size reduction with unaffected performance. Task-number: PYSIDE-1860 Change-Id: Ia5dfa2c4bfde92994c939b5fac0d0831fa3a73ab Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Christian Tismer <[email protected]>
* CMake: pyside: Add support for cross-buildingAlexandru Croitor2022-02-041-27/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The pyside project will be cross-compiled either if CMAKE_CROSSCOMPILING is set to TRUE (which is usually set by a CMake toolchain file or computed by CMake itself) or if QFP_SHIBOKEN_HOST_PATH is provided on the command line. Various code is added to ensure the correct target Qt, Python and Shiboken libraries are found, as well as host Qt and shiboken tools. These are specified to the project by setting one of the following vars: - QFP_QT_TARGET_PATH (for device Qt libs and includes) - QFP_PYTHON_TARGET_PATH (for device python libs and includes) - QFP_SHIBOKEN_TARGET_PATH (for device libs) - QFP_SHIBOKEN_HOST_PATH (for host shiboken generator) - QT_HOST_PATH (for host moc and friends) When cross-compiling, pyi file generation is disabled because it's not possible to run a target python interpeter on a host machine. It might be possible to do that by using qemu userland emulation in the future. Task-number: PYSIDE-802 Task-number: PYSIDE-1033 Change-Id: Ifa101e90d83397fa19132f9f0ce21e03b3523a74 Reviewed-by: Cristian Maureira-Fredes <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* CMake: Create new Shiboken6Tools CMake packageAlexandru Croitor2022-02-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new Shiboken6Tools CMake package which will contain information about the shiboken6 code generator executable. As a consequence, the existing Shiboken6 package will only contain info about the shiboken Python module and its helper shared library. The new Tools package will be searched for when cross-compiling both the shiboken and pyside projects. Adjust the pyside project to look for this new Tools package. Remove the 'data' custom target, it serves no purpose. One consequence is that the shiboken pkg-config .pc file will not contain a path to the code generator executable anymore. Currently, no new .pc file is created for the newly split package. As a drive-by, adjust the Shiboken6 find_package calls to look for version 6 rather than 2. Task-number: PYSIDE-802 Task-number: PYSIDE-1033 Change-Id: I0df29801b1f59010df8f13ac0c9f2d368fa4d1cb Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* PySide6: Enable checking by patch versionFriedemann Kleint2022-01-191-1/+1
| | | | | | | | | | | The multimedia module in 6.2 still receives new API (due to Multimedia being a tech-preview). This requires checking by patch version. Pick-to: 6.2 Change-Id: I49e2ae746fdae10893ab4155e464a25ae8fcef6c Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Christian Tismer <[email protected]>
* Move the QML registration code into a libraryFriedemann Kleint2021-12-081-0/+2
| | | | | | | | | This makes the code easier to maintain. Task-number: PYSIDE-1709 Change-Id: Idb75143a7e6d218637ab75463db88b6135cd4086 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* setup.py: CMake: Remove host python dependency for version parsingAlexandru Croitor2021-12-071-20/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-compiling, the python interpreter found by CMake is the device one (or at least it's supposed to be), which means we can't use it to execute python scripts on the host machine to extract shiboken and pyside version information. Instead of keeping the version numbers in python files, place them into new .cmake.conf files that CMake can include in CMake projects directly. This aligns with storing version information like Qt6 does. setup.py and coin_build_instructions need version info as well, so they will now parse the set() assignments in pyside6/.cmake.conf. Ideally we would have called cmake with a minimal project that outputs those values, but we don't have access to the CMake executable path within coin_build_instructions.py, so we rely on parsing instead. Qt Conan integration does the same, so we should be good, the .cmake.conf file format is unlikely to change and cause breakages. We also modify shiboken_version.py and pyside_version.py to use the new variables when calling configure_file(), because we still ship those files in the wheels. Amends b57c557c8cd1012851f8a245075591dc33be425b Pick-to: 6.2 Change-Id: Icc830069cd459c214ec253840ba6754ece50854e Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* CMake: Cleanup documentation building codeAlexandru Croitor2021-11-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move conditions on whether documentation should be built inside the doc project, rather than outside. Look for qdoc and qhelpgenerator both in PATH and via find_package(Qt6Tools) calls. Add sanity checks that the various tools used in the add_custom_command calls are actually available. Show a warning or error when they are not available, depending on combination of whether it's a standalone doc build or part of the overall shiboken/python build. Set DOC_OUTPUT_FORMAT to html by default if it's not specified. Clean up some of the warning messages. Make sure to check the result of running execute_process on the snippets tool. Pick-to: 6.2 Task-number: PYSIDE-1718 Change-Id: I2969d7a40961881ad0f91d7142b29a7f4130f3b7 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Cristian Maureira-Fredes <[email protected]>
* Move from distutils to setuptoolsCristián Maureira-Fredes2021-11-261-3/+13
| | | | | | | | | | This is motivated by the deprecation of distutils, and removal in future versions https://github.com/pypa/packaging-problems/issues/127 Pick-to: 6.2 Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5 Reviewed-by: Christian Tismer <[email protected]>
* PyPySide: check in the rest of PyPy changesChristian Tismer2021-11-121-0/+12
| | | | | | | | | | | | | | | | | | | The PyPy branch has been apart from the main branch for a long time. Meanwhile, almost everything has settled and can be merged into the main branch. This has the advantage of a single branch for both configurations. This project is still not ready. It will be called ready when the Mandelbrot example can be run without any changes. To achieve that, the current threading problem must be solved. The WIP branch is kept. It now holds only the pypy-blog.txt file. Task-number: PYSIDE-535 Change-Id: I317b0e921cc6810e1b76c69991a0f8e592135c65 Reviewed-by: Friedemann Kleint <[email protected]>
* CMake: Dissolve generic cmake_helpers/helpers.cmakeAlexandru Croitor2021-10-271-3/+5
| | | | | | | | | | | | | | | | | | Move PySide specific functions into a new PySideHelpers.cmake file. Keep functions used by both shiboken and pyside in a renamed ShibokHelpers.cmake file. This brings the CMake file structure more in-line with how it's structured in Qt6 itself. TODO: Ideally the pyside subproject should not include the shiboken files directly, but rather have access to those functions as a consequence of calling find_package(Shiboken6). Pick-to: 6.2 Change-Id: I954d8be0df86a45e74b6011f8e2758026f3340fa Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* CMake: Move non-add-subdirectory related code to PysideSetup.cmakeAlexandru Croitor2021-10-271-0/+225
And tidy up add_subdirectory conditions in pyside6/CMakeLists.txt Pick-to: 6.2 Change-Id: I0549c88eef0ed8497d2e410f382c3e653ab38f94 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>