summaryrefslogtreecommitdiffstats
path: root/util/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Rename internal functions to contain qt_internalAlexandru Croitor2020-09-231-9/+36
| | | | | | | | | | Offer compatibility wrapper functions until we update all of the Qt repos to use the new names. Task-number: QTBUG-86815 Change-Id: I5826a4116f52a8509db32601ef7c200f9bd331de Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* xcb: add xcb-util dependency for xcb-imageLiang Qi2020-09-211-0/+3
| | | | | | | | | xcb-image includes xcb_aux.h, which is part of xcb-util. Fixes: QTBUG-86287 Pick-to: 5.15 Change-Id: I253308008c5baeb1d061ef19f516ae6ab6dff52c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: build add flags for building QtAndroid.jarAssam Boudjelthia2020-09-161-1/+1
| | | | | | | | | | | | | Adds -source, -target, -Xlint:unchecked, -bootclasspath flags. Setting default javac build source and target versions to 8. Allow setting custom values for javac build versions via -DQT_ANDROID_JAVAC_SOURCE, and -DQT_ANDROID_JAVAC_TARGET. Task-number: QTBUG-86282 Change-Id: I98f4f193ac96016dc722d178594d7fd401202f68 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -ltcgJoerg Bornemann2020-09-111-2/+30
| | | | | | | | | | | | | | | | | | | This configure switch sets the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> per release config to ON. The feature 'ltcg' is enabled if any of the variables CMAKE_INTERPROCEDURAL_OPTIMIZATION, CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> are ON. In order to implement the check, configurejson2cmake had to be extended to be able to write extra CMake code before and after the feature definition. This extra code can be added to a feature mapping below the keys "cmakePrelude" and "cmakeEpilogue". Task-number: QTBUG-85373 Change-Id: Ia2eb907edcf087f137977a9b090705397f83eb05 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove the -no-compile-examples configure switchJoerg Bornemann2020-09-111-1/+0
| | | | | | | | | | | | If '-make examples -no-compile-examples' was specified, sources of Qt's examples would be installed, but the examples would not be built. This switch has always been a source for confusion and is only interesting for distributors, who can just package the examples directory tree. Change-Id: I0291d70e4951d98b553a4abf217db49d05316d3a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* configurejson2cmake: Handle expressions of the form "foo != 0"Joerg Bornemann2020-09-101-0/+2
| | | | | | | Such expressions were translated to "foo NOT = 0" which is invalid code. Change-Id: I8b485bfe1d1f553c08df3b5d59b0f39f2dcbd5c0 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* xcb: drop Xinerama supportLiang Qi2020-09-041-7/+0
| | | | | | | | | | [ChangeLog][Important Behavior Changes][X11] Xinerama is no longer supported. Fixes: QTBUG-86082 Change-Id: Ieb57d9035e1659fc22bf8333247fc3573fb62992 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* pro2cmake: Fix qmake parser's line continuation handlingJoerg Bornemann2020-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The qmake parser of pro2cmake handles completely commented lines to make assignments like this work: SUBDIRS = \ foo \ # bar \ bar However, assignments like SUBDIRS = \ foo \ #bar \ bar were cut off at the commented line. Fix this by allowing leading whitespace for "fully commented lines". Change-Id: Ib5de850a02fd9b9ebb7c056c2f64f9d684334b08 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* pro2cmake.py: support multiple versions in QT_QML_SOURCE_VERSIONMitch Curtis2020-08-231-4/+8
| | | | | | Task-number: QTBUG-86174 Change-Id: I56f4a54874410a19f782ce4dda2e166789570fb9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -gdb-indexJoerg Bornemann2020-08-231-1/+0
| | | | | Change-Id: Iea0fb99297751b1baf830a416ea5041d0b9a3b63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix detection of the 'debug' featureJoerg Bornemann2020-08-231-0/+1
| | | | | | | | | | | | | The debug feature for the CMake build is solely determined by the value of CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES. There is no point in restricting the autoDetect expression to developer builds or MSVC and macOS builds. User-visible result: -DCMAKE_BUILD_TYPE=Debug now actually turns the 'debug' feature on, also for non-developer builds on Linux. Change-Id: I65c92575c9483bff16beb78b60606c55aeadcece Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Support configure tests of type 'linkerSupportsFlag'Joerg Bornemann2020-08-231-0/+18
| | | | | | Task-number: QTBUG-86155 Change-Id: I3764d99cd4ad1c432b499ec9ba7c4c48391fa421 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -optimize-sizeJoerg Bornemann2020-08-231-1/+0
| | | | | | | | | | | | This configure switch controls the feature 'optimize_size'. This isn't merely a mapping to CMAKE_BUILD_TYPE=MinSizeRel, because we potentially want to combine -optimize-size with -force-debug-info, which maps to CMAKE_BUILD_CONFIG=RelWithDebInfo. Task-number: QTBUG-85373 Change-Id: I1a9343ebc54816f52e90e9d33ea3df4c99b1ec9f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -optimize-debugJoerg Bornemann2020-08-201-1/+0
| | | | | | Task-number: QTBUG-85373 Change-Id: I3aba1fcf96e36544dd75a5e6adc5f770a9a45726 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -linker [bfd,gold,lld]Joerg Bornemann2020-08-201-2/+2
| | | | | | Fixes: QTBUG-86155 Change-Id: I5ba2d3b52d9ca240b48904c492f7902a056c0292 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Support configure tests of type 'compilerSupportsFlag'Joerg Bornemann2020-08-201-0/+19
| | | | | | Task-number: QTBUG-86155 Change-Id: Iaa5c48b6508870a0f6afdf9df66cd2e634fe19b3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -qreal <type>Joerg Bornemann2020-08-191-0/+15
| | | | | | | | | The configure argument -qreal <type> maps to the CMake argument -DQT_COORD_TYPE=<type>. Fixes: QTBUG-83325 Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Re-implement configure/qmake's command line handling in CMakeJoerg Bornemann2020-08-171-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | We extend configurejson2cmake to read the "commandline" information from configure.json. This data is then translated to CMake function calls and written it into commandline.cmake files. We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake files to feed our command line handling code, which is a re-implementation of the command line handling in qt_configure.prf. The command line handler sets INPUT_xxx variables, similar to configure/qmake's config.input.xxx variables. The INPUT_xxx values are translated - to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature, - to corresponding CMake variables if such a variable is known, - or to -DINPUT_xxx=yyy CMake arguments. Configure arguments that have an entry in cmake/configure-cmake-mapping.md are actually implemented. Other arguments are likely to need more work. Task-number: QTBUG-85373 Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add quickcontrols2impl to helper.pyMitch Curtis2020-08-131-0/+3
| | | | | | | | It's new in Qt 6 after the type registration changes. Task-number: QTBUG-82922 Change-Id: Id4aa22e50a8d84736688dbf2ab51e12a116177f0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* helper.py: document extra parameterMitch Curtis2020-08-131-0/+1
| | | | | Change-Id: Ib21a682af70a6f46fc4b1c779f3d462193209cce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake: Specify library versions for 3rd party libs part 2Alexandru Croitor2020-08-101-11/+11
| | | | | | | | | | Embed package versions into the qt_find_package calls for various Linux specific packages. Task-number: QTBUG-82917 Change-Id: I5d1cb623f81932dfae4658b8a3a89eedb71ea3af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: pro2cmake: Specify library versions for 3rd party librariesAlexandru Croitor2020-08-101-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | If certain 3rd party libraries have a version that's not suitable for Qt, the configure summary should say so, rather than use them and fail at build time. With the current situation, we have to duplicate the version information from the configure.json files in helper.py, by assigning the version number as an extra find_package variable. Rerunning configurejson2cmake then embeds this version info into the qt_find_package calls in configure.cmake. Some of the Find modules are rewritten to take the specified version into account when looking for the libraries. This involves moving around the code for creating a target, after calling find_package_handle_standard_args() so we know if a good enough version was found. Task-number: QTBUG-82917 Change-Id: I139748d8090e0630cda413362760034dc3483e11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QDecompressHelper: Add brotli supportMårten Nordheim2020-08-061-0/+1
| | | | | | Task-number: QTBUG-83269 Change-Id: If23b098ee76a4892e4c2c6ce5c635688d8d9138d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove last remaining bits of QtPlatformHeadersTor Arne Vestbø2020-08-041-3/+0
| | | | | | Task-number: QTBUG-84220 Change-Id: I951e04bfe9358a99951d1d61ff47b675584b7f81 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QtCore: Use system-wide libb2 if presentLinus Jahn2020-07-312-0/+2
| | | | | | | | | | | | This adds the option to build Qt with libb2, which is especially recommended, if you care about the performance of the BLAKE2 hashing algorithms. The bundled version is the pure reference C implementation of BLAKE2, while libb2 has many additional hardware optimizations. However, the API of both is the same, so no changes to the code were necessary here. Change-Id: I3563982f4e07be300291fe103c38b16a404b3ebb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake: Fix errors reported by flake8 and mypyAlexandru Croitor2020-07-315-19/+18
| | | | | | Change-Id: I842c0f8d7ec1d173fa1dbd74e769e2c370e70518 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: pro2cmake: Reformat files using blackAlexandru Croitor2020-07-313-85/+98
| | | | | Change-Id: Ic06840f9877d6b863f48a5eb97fcd6735ab9bde8 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Teach pro2cmake to convert load(qt_app)Alexandru Croitor2020-07-311-13/+233
| | | | | | | | | | | | Changes pro2cmake to handle load(qt_app) projects and write out qt_internal_add_app calls. Also adds handling of macOS and Windows specific resource files for Qt apps only. Task-number: QTBUG-85757 Change-Id: I994d8d19ab2ae366a985cab7894b97d6a278a56f Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove reference to removed moduleEirik Aavitsland2020-07-231-3/+0
| | | | | | | The openglextensions module is dicontinued and removed in Qt 6. Change-Id: I0b98f9b6575026828c188786aeb5c1a62de1f8a3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configurejson2cmake: Use a context manager for file special handlingJoerg Bornemann2020-07-131-13/+21
| | | | | | | | | | | | One can now write with special_cased_file("base/dir", "foo.txt") as fh: do_something(fh) This makes the code of processJson a bit clearer, and it allows us to easily add more files that support the special handling comments. Change-Id: Ia25d0c0d48df1802c5e2123d05345a88b42a2981 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configurejson2cmake: Generalize special case supportJoerg Bornemann2020-07-132-19/+8
| | | | | | | | | The SpecialCaseHandler supported only two file names: "CMakeLists.txt" and "configure.cmake". Generalize the code to allow for arbitrary file names. We will use this in a subsequent commit. Change-Id: I0adada91409a11a369fd1cf2d6ab21cc8f28ba0f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove duplicate dict entryDimitrios Apostolou2020-07-101-1/+0
| | | | | | | As found by LGTM.com. Change-Id: I9d41fec8a9f80fe9cb1cae960418032f84646a99 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove dead codeDimitrios Apostolou2020-07-101-28/+0
| | | | | | | Found by LGTM.com. Change-Id: I661e2287a6964b63d5b03c8913bc4b09f21ffdf1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix various issues with the Android buildAlexandru Croitor2020-07-091-0/+1
| | | | | | | | | | | | | | | | | | | Certain resources and compiled jar files have to be copied into the non-prefix build dir location. They were previously only installed, which doesn't do anything in a non-prefix build. Change pro2cmake to generate code that places the compiled java jars into QT_BUILD_DIR, so that non-prefix builds work. Place the module dependencies xml files into lib folder in non-prefix builds. Don't special case the output and install location of the Android QPA plugin. Task-number: QTBUG-85399 Change-Id: I4ac9d3929ea8ecc95ec99a77e621ad2121b68832 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: pro2cmake: Remove dead code regarding resource retainingAlexandru Croitor2020-07-071-22/+0
| | | | | | | | | qtdeclarative as of 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c always retains the resources, so there's no manual facility for retaining left. Remove the code. Change-Id: If79b66683897b5f430844e13c0230e41a2cf061d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: pro2cmake: Fix handling of QT_SKIP_QUICKCOMPILERAlexandru Croitor2020-07-071-10/+25
| | | | | | | | | | | | | | | | If a file was part of a resource that has a non-empty base directory, the script generated set_source_files_properties calls to the file path without including the base dir, which means the command did nothing. The script should set the QT_SKIP_QUICKCOMPILER on the full file path if a base dir is present, similar to how the alias handled. Refactor the alias property writing code to write all properties into the command that uses the full correct path. Change-Id: Ic75d51ecf60eef3ada9bd6ca26882de3447896e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make QtPlatformHeaders a private moduleTor Arne Vestbø2020-07-061-0/+1
| | | | | | | | | | | The APIs will be reintroduced as part of the new platform interface API where appropriate. Clients that still depend on the platform headers can include it via QT += platformheaders-private. Change-Id: Ifbd836d833d19f3cf48cd4f933d7fe754c06d2d9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Generate qdevice.pri when cross-buildingJoerg Bornemann2020-06-291-0/+9
| | | | | | | | | | | | | This adds the CMake equivalent to the classical -device-option key=value configure argument: -DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN] The keys and values get dumped verbatim into qdevice.pri. This patch also ports the machineTuple configure test. Its result is written into qdevice.pri as value for the GCC_MACHINE_DUMP variable. Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Create a Find module wrapper for OpenGLAlexandru Croitor2020-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Our .prl files embedded an absolute path to the OpenGL.tbd file. This obviously breaks their usage when used on another machine when no SDK exists. To fix that we need to use a "-framework OpenGL" linker flag instead of linking against the absolute path library. To convince CMake to do that, we have to create a wrapping OpenGL target which sets an appropriate INTERFACE_LINK_LIBRARIES property. So create a FindWrapOpenGL find module to do that on darwin platforms. Adjust helper.py and our build system to use it. This tangentially amends 38cd18384f6198c5bc3ea1da9ffc0158e960a778 because it recreates the FindWrapOpenGL module, but for a different purpose. Task-number: QTBUG-85240 Task-number: QTBUG-84781 Change-Id: I3498c19157ae31db5099e6edfb9d71490187f1d3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Adjust conversion scripts to iconv changes in qt5compatJoerg Bornemann2020-06-282-23/+2
| | | | | Change-Id: I8e06a09768bd3554500d666273060d2e130965b8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake.py: Parse qmldir import statements with versionsUlf Hermann2020-06-241-3/+6
| | | | | | | | | | | | You can write the following in a qmldir file these days: import QtQuick auto import QtQml 2.4 pro2cmake should understand and convert these to cmake. Change-Id: Ica1728de0c8d7a0b2b5aa341d20e60b23dfa7fe1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Improve sanitizer detectionAlexandru Croitor2020-06-151-5/+1
| | | | | | | | | | | | | | | The change fixes the labels to show up correctly in the configure summary. It also allows enabling the sanitizer via the feature flags, e.g. -DFEATURE_sanitize_address=ON. Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra so that repos built after qtbase have the same sanitizer options enabled. Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12 Fixes: QTBUG-84721 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix usage of gc_binaries featureAlexandru Croitor2020-06-121-1/+3
| | | | | | | | | | | | | | | | The qt_internal_apply_gc_binaries function should apply both compile and link flags, not just link flags. The flags should be applied publically to all consumers of Bootstrap regardless if the gc_binaries feature is enabled. The flags should be applied publically to Core only in case if the feature is enabled (aka for static builds only). Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac Fixes: QTBUG-84461 Task-number: QTBUG-83929 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* pro2cmake: Parse "optional plugin" from qmldir filesUlf Hermann2020-06-091-1/+13
| | | | | | | Task-number: QTBUG-84639 Change-Id: Iedfa2e53c686a7c7c855efc7b9deee097a15f4b7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move QtAccessibilitySupport into QtGuiTor Arne Vestbø2020-06-021-6/+0
| | | | | | Task-number: QTBUG-83255 Change-Id: Ibc1b38e77c3c90030a832c41f4de65c6c38bc91d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adds library mappings for the Qt OPC UA module in helper.pyJannis Voelker2020-06-021-0/+2
| | | | | Change-Id: I64bee2a7c149b8e4b14b71103ebc748c32993145 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make it possible to build tools when cross-compilingLeander Beernaert2020-06-021-15/+30
| | | | | | | | | | | | | | | | | | | This patch allows tools to be built for the target platform when the QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration time. To avoid naming conflicts, the target tools are suffixed with "_native". The qt_get_tool_target_name() function can be used to get the tool name for both scenarios (cross and non-cross compilation). Extend pro2cmake to refer to the right target name for tools. The relevant write_XXX functions have a new target_ref parameter that will be "${target_name}" for tools and literally the target name for everything else. Fixes: QTBUG-81901 Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Update src\gui\configure.json and the conversion scriptLaszlo Agocs2020-05-292-8/+1
| | | | | | | | | The ANGLE removal's manual configure.cmake changes are now replaced by updating the conversion script's special cases instead. Change-Id: I06317fe0202b25bd9f9524da14e1bb0ccbb30cc1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: pro2cmake: Check existence of QMLTYPES_INSTALL_DIRAlexandru Croitor2020-05-291-2/+4
| | | | | | | | | | | | | | | | When writing the qt6_qml_type_registration call, make sure to write the set(QT_QML_MODULE_INSTALL_QMLTYPES TRUE) statement only if an explicit path was provided via QMLTYPES_INSTALL_DIR / QT_QML_MODULE_INSTALL_DIR. This will remove the QT_QML_MODULE_INSTALL_QMLTYPES property from many examples and tests in qtdeclarative, thus not installing the .qmltypes file into the Qt prefix, thus polluting it. Task-number: QTBUG-84403 Change-Id: I5c64d42915896d14f2591cbb64d73d912dbf7c7d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add SvgWidgets libraryVolker Hilsheimer2020-05-291-0/+1
| | | | | | Change-Id: I243aa35a0628f80219b589a0ba943ec1a25bb972 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>