summaryrefslogtreecommitdiffstats
path: root/util/cmake/helper.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix mapping of Apple platforms in pro2cmake.pyAlexandru Croitor2019-07-231-1/+1
| | | | | | | | | | | | "mac" scope in qmake actually means all mac platforms, just like "darwin", aka macOS, iOS, watchOS, etc. Regenerate corelib, gui and testlib after this modification. This is a requirement for the iOS port. Change-Id: I029c7e907d13f6ec31816a08602a5930f9ac16a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Add support for QML pluginsLeander Beernaert2019-07-151-0/+2
| | | | | | | | | | | | | | | | | | Add the necessary code to both the QtBuild and pro2cmake to be able to handle qml plugins in qt declarative. Add condition replacement for QTDIR_build to QT_BUILDING_QT so that certain qml examples work correctly when being built in the build directory. Fix add_qt_resources not being updated during build after changes were made. Files list used as dependencies were not populated. Add missing module mappings for qtdeclarative. Change-Id: I0f71d0a3a0e7e97ba96807950d11cffaee04d9b2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix XCB feature detectionSimon Hausmann2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The xcb feature controls whether to build the xcb platform plugin. The feature depends among other things on qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) to succeed. This means at the moment setting XCB_FOUND to true, that's what the condition checks. Later on, in configure.cmake, we also check for other components in the XCB package, for example: qt_find_package(XCB COMPONENTS XINPUT PROVIDED_TARGETS XCB::XINPUT) If this component is not available, the xcb platform plugin has perhaps reduce functionality, but it should be built and the feature should be abled. However it isn't, because when that find_package call fails, XCB_FOUND will be set to false. And that in turn will disable the feature as the condition fails. Therefore this patch changes the condition to check for the presence of the XCB::XCB target instead. Change-Id: I534087d8c3b7ff5edf81a5ffcf16cc0bb78b9fb7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-119/+119
| | | | | | | | | | This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* CMake: Add WrapPCRE2 packageCristian Adam2019-06-051-1/+1
| | | | | | | | The WrapPCRE2 package handles the PCRE2 packages that have targets, and reuse them. Change-Id: I24b0b51f507703cd8287f845f7e425f62dd2c3d6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix xcb buildAlbert Astals Cid2019-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Need qt_find_package(X11_XCB) in src/gui/configure.cmake since we're using it in the file qt_feature("xcb_xlib" PRIVATE LABEL "XCB Xlib" CONDITION QT_FEATURE_xlib AND X11_XCB_FOUND ) Need qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) in src/plugins/platforms/xcb/CMakeLists.tx since we're using it in the file extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender PUBLIC_LIBRARIES PkgConfig::xrender ) Use capital XRender in pkgconfig to be more consistent on how XRender is called everywhere else Change-Id: I403ead2cc123b08f741c5142f20db88987657ba8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* More fixes to conversion script while porting qtdeclarativeAlexandru Croitor2019-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | Hardcode a few cases regarding scopes containing "qtConfig(opengl)". These arew few, and contain regular expressions, to just manually check and replace them. Add a new entry to _qt_library_map for handling QmlModels module. Fix Scope.children property to recursively access the .children property on included scopes (instead of just ._children) so that we get the full list of scopes from included children that include other scopes. This is needed for nested .pri files. Fix mapping of "win*" to WIN32. Change-Id: If949a8051f517683e56cda605733719daadb384a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot
* Generate the c++xx standard features instead of skipping themAlexandru Croitor2019-06-031-1/+4
| | | | | | | | | | | The features are reused in qtdeclarative (and maybe somewhere else too), so they should be present. We can still map the conditions to proper CMake compile feature tests. Change-Id: I4d307d29d4d293cc23ab005b195ea346087c7162 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add Library Mapping for QtNetworkAuthLeander Beernaert2019-05-281-0/+1
| | | | | | | | | Added library mapping information for any projects referencing the QtNetworkAuth project. Change-Id: I9c4309d26ee9895f94995d4844ffde4ee4444766 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve configurejson2cmake.py to handle non-compliant qmake JSONAlexandru Croitor2019-05-271-0/+26
| | | | | | | | | | | | | Some configure.json files contain new lines inside quoted strings, which is not conformant with the JSON spec. Add a new json_parser python module which uses pyparsing to preprocess the json files to remove the new lines inside the quoted strings, and then hands over the preprocessed content to the regular json module. Change-Id: I5f8938492068dda5640465cc78f5a7b6be0e709a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Add a few more 3rd party libraries to helper.pyAlexandru Croitor2019-05-211-0/+3
| | | | | | | | Handle a few more libraries that are used in qtimageformats repi. Change-Id: Ia3b9a845bc6cb8ce98a477b9355011bbadc32c1a Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve configure2cmake to find_package only in certain conditionsAlexandru Croitor2019-05-201-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make much sense to look for X11 related packages on macOS and Windows by default. Usually they would not be there, and as a result the configuration step would show a long list of scary not found packages, and also eat precious configure time. Change the conversion script to allow putting conditions around generated find_package calls. These conditions can be manually set in the conversion script library mapping, using the emit_if argument, which we do for the X11 and Wayland related packages. They are also computed by checking which features use a given library, and if the feature is protected by a simple emitIf condition like config.linux, the relevant library find_package call will be protected by the same condition. If a developer still wishes to look for all packages, they can define the CACHE variable QT_FIND_ALL_PACKAGES_ALWAYS to ON. The relevant configure.cmake files are regenerated in this patch. Change-Id: I6f918a94f50257ec41d6216305dae9774933389a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Fix test_operationsTobias Hunger2019-05-171-0/+1
| | | | | | | Fix test_operations and do some small mypy cleanups along the way Change-Id: I6586b5d3491e5dcf44252c098516f0922fa60420 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Wrap DBus1 find_package call to fix xproto not being picked upTobias Hunger2019-05-101-1/+1
| | | | | | | | | | | | | | DBus1 (1.12) configuration file breaks PKG_CONFIG environment variables and will thus prevent other libraries to be picked up by pkgconfig. Main sympthom is that xproto is not getting picked up anymore, which results in hundreds of lines of warnings about this being printed. Work around that by wrapping the call to find_package(DBus1) and restoring the environment. Change-Id: Ia69f10b014dddc32045b40972500a843e5d29b38 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Generate find_package information into examplesTobias Hunger2019-05-091-0/+16
| | | | | Change-Id: I6dab13ebea4386019f14be5f29a143d194268aac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: scripts: Extract code to write find_package linesTobias Hunger2019-05-091-0/+39
| | | | | | | | Extract code to write find_package lines from configurejson2cmake.py and move this over into helper.py. Change-Id: Iefd313b2a56cb78a99a7f3151c3f6c6284482f79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: scripts: Fix mypy issuesTobias Hunger2019-05-091-3/+4
| | | | | Change-Id: I706740be79eccd6bf08213fdaf747dde08cd053a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix freetype target not being found when using vcpkgAlexandru Croitor2019-05-081-1/+1
| | | | | | | | | | vcpkg and upstream CMake find module define different target names for the same package. To circumvent this, create our own Wrap find module, and link against it. Inside the find module, try both target names. Change-Id: Iba488bce0fb410ddb83f6414244f86ad367de72b Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: scripts: Make xcb_qpa_lib known as a Qt moduleTobias Hunger2019-05-071-0/+1
| | | | | Change-Id: I65f48d86c4ec946b38004b945078f29625e32d93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: scripts: Treat libraries mapped to None as knownTobias Hunger2019-05-071-1/+1
| | | | | | | | | This detects doubleconversion as a 3rd party library. This fixes defaulting QT_FEATURE_system_doubleconversion to 'ON'. Change-Id: I9d18dbbb6f7a99f6a5c674bed3013b96f19bf6e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Scripts: Fix double entries in 3rd party library mappingTobias Hunger2019-05-061-2/+0
| | | | | Change-Id: I35f29876874d6083d19382800d194e417d57bca1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Fix library mappingTobias Hunger2019-05-061-11/+19
| | | | | | | | | | | | | Fix library substitution again which broke when I merged all the library related pieces of information. Keep Qt and 3rdparty libraries separate so that dbus does not get mapped into Qt::DBus (or the other way around). Make names in helper.py more consistent while at it. Change-Id: I5e5bf02bdabf8bafe991c5701deca76bde4df2c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make zlib a required package for QtCoreAlexandru Croitor2019-05-031-1/+1
| | | | | Change-Id: Ifbb969fafe05e355d6874d8bebe2e8f1e80510ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Improve mapping of librariesTobias Hunger2019-05-031-184/+243
| | | | | | | | | | | | | Merge all data related to mapping libraries into one data structure in helper.py. Use that data for everything related to library mapping. This change enables way more features now like e.g. adding find_package calls into generated files. Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Fix xcb_glx buildAlbert Astals Cid2019-05-031-0/+1
| | | | | | | Use the actual cmake library target name Change-Id: Icda1d232e3b920bf33ebceb00f39682050f7dedd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Write find_dependency() calls in Qt Module config filesAlexandru Croitor2019-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Map xkbcommon_supportTobias Hunger2019-04-121-0/+1
| | | | | | | Qt 5.12 comes with xkbcommon_support now. Map that accordingly. Change-Id: Id10708349d377f6bdfed654428ebcef0b533bd69 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Support /nolink librariesTobias Hunger2019-04-101-1/+6
| | | | | | | | | | | | | Add a helper function to QtBuild that generates Foo_nolink versions of Foo library targets. Map 'Foo/nolink' libs found in qmake to Foo_nolink. Automatically run helper function to create _nolink targets as part of extend_target. Change-Id: I4c23ea68b3037d23c9a31d4ac272a6bd0565f7c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix mappings in helper.py - WUIASLiang Qi2019-04-091-1/+1
| | | | | | | This amends 9afc605eb5dea636d3805b0a4e14294030595da3. Change-Id: If246811d267d091c692875a1645c96767f781010 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Fix mappings in helper.pyTobias Hunger2019-04-091-6/+3
| | | | | | | | Some of the Qt names were wrong. Fix them and remove the work-arounds in the library mappings. Change-Id: I9b9afa3fb35c578e5c8d9cdef77224eb072ec8da Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Map linuxaccessibility_supportPrivate to Qt::LASPTobias Hunger2019-04-091-0/+1
| | | | | Change-Id: I6066f69c74c39fb97a286eb92748b5c4172b1efd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Map cups to Cups::Cups, vulkan_support_private to ↵Tobias Hunger2019-04-031-0/+3
| | | | | | | Qt::VulkanSupportPrivate Change-Id: Id03942becb08ca3ece589479ffe515f68034ddd4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Map odbc to ODBC::ODBCTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I55cf506cca87ac3e3fe9e0e1803f5118b46bf818 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map SQLite3 to SQLite::SQLite3Tobias Hunger2019-03-291-1/+2
| | | | | | | Fix sqlite maping while at it. Change-Id: I712ca562fa362a7f5857047346e8b3083f901bfb Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map glx_support and glx_supportPrivateTobias Hunger2019-03-291-0/+2
| | | | | Change-Id: I777ea84a080a6856961d644a0290e4d73e07c518 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map psql to PostgreSQL::PostgreSQLTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I8332d2120e8b629c8722b5c9a95b47950b327d4c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map atspi2 to PkgConfig::ATSPI2Tobias Hunger2019-03-291-0/+1
| | | | | Change-Id: Ifd21eb278e06a6166ab87106c442d8ec94d92dc5 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map tslib, mtdev, libinput and xkbcommen_evdevTobias Hunger2019-03-291-0/+4
| | | | | Change-Id: If144a8969904b63a3de3884370baaeca1cb4242a Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map fontconfig to Fontconfig::FontconfigTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I2761ef23cffefbee57da6bb1a07d06b2232d1c57 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map libudev to PkgConfig::LibudevTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: Iac5d0fbf336f0c3905a3dca20524f90432227cf4 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: Map libpng to PNG::PNGTobias Hunger2019-03-041-0/+1
| | | | | Change-Id: Ia8dd20b777e24e2783bedb0f063db2189e0b7ed3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: add more mappings to helper.pyAlbert Astals Cid2019-02-181-0/+3
| | | | | Change-Id: Ie5096c1fe74105db84ccd60655a20d389a887b14 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: helper.py more mappingsAlbert Astals Cid2019-02-151-0/+3
| | | | | Change-Id: I69a1715bbda8f5ddfb367e7c7c693e4ec412f5c3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: enable vnc platform pluginAlbert Astals Cid2019-02-121-0/+2
| | | | | Change-Id: I5015681aff3c9ceb5c0b72571bc8756f3ada104c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Search and enable the sqlite[3] pluginAlbert Astals Cid2019-02-121-0/+1
| | | | | | | | Added to QtFeature.cmake a way to be able to run feature_module begin and end without having an actual module by passing NO_MODULE Change-Id: Ib708bd3878e2591da193d18563c8932cc4b75e7f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: helper.py: Map harfbuzz libraryTobias Hunger2019-02-111-0/+1
| | | | | Change-Id: I71daa9acf391c70c6cba99609c1f67ca5eeaa220 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* CMake: pro2cmake.py: Add XCB and X11 librariesTobias Hunger2019-02-111-2/+22
| | | | | | | | Add all the XCB and X11 libraries needed for the XCB plugin. Change-Id: I772b99c68521cd46cbba736912c8d8594d9d2ad8 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CMake: pro2cmake.py: Handle more librariesTobias Hunger2019-01-311-1/+9
| | | | | Change-Id: I561b619c4dbc56a1f6ad383a68ce4b82858a031c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Use FindGLIB2 from cmake-extra-modulesTobias Hunger2019-01-311-1/+2
| | | | | | | Use FindGLIB2 from cmake-extra-modules over hand-rolled own version. Change-Id: I1f8e055bc12dd728c033fd88480690643d90159a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CMake: pro2cmake.py: More mappings!Tobias Hunger2019-01-291-0/+7
| | | | | | | Add some more mappings from qmake to CMake equivalents conditions. Change-Id: I57b7bea9d6628e1c2b8d6ae88f799219942b571e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>