summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | CMake: pro2cmake.py: Generate find_package information into examplesTobias Hunger2019-05-092-10/+46
| | | | | | | | | | | | | | | | | | | | Change-Id: I6dab13ebea4386019f14be5f29a143d194268aac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | Keep "special case" modifications when regenerating project filesAlexandru Croitor2019-05-092-4/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pro2cmake.py file is now smarter, and can reapply "special case" modifications after regenerating a CMakeLists.txt file. This substantially lowers the maintenance burden when regenerating many files at once. See the special_case_helper.py file for details on how it works. Make sure to commit the generated .prev_CMakeLists.txt file alongside your CMakeLists.txt changes. To disable the preservation behavior, you can pass -s or --skip-special-case-preservation to the script. To keep around temporary files that are created during this process, you can pass -k or --keep-temporary-files. To get more debug output, pass --debug-special-case-preservation. Fixes: QTBUG-75619 Change-Id: I6d8ba52ac5feb5020f31d47841203104c2a061d8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | | | CMake: scripts: Extract code to write find_package linesTobias Hunger2019-05-092-25/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: pro2cmake.py: Separate library extraction logic from writing out dataTobias Hunger2019-05-091-65/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the logic to find all used libraries from the code that writes out the link_library information into the CMakeLists(.gen)?.txt files. This patch will remove some "PUBLIC_LIBRARIES Qt::Core" from generated files. This is due to us handling some Qt libraries in special ways in some of our add_qt_* helpers. These special libraries were added to the LIBRARIES section, but actually they should be added to the PUBLIC_LIBRARIES section instead. Do so now, so that the newly generated files do not break things again. Change-Id: I588781087a8aecc4d879e949735671d8085f0698 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | CMake: pro2cmake.py: Extract writing lists into cmake filesTobias Hunger2019-05-091-61/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the actual functionality to write a list of "things" below headers and/or cmake parameter and followed by a footer. Reuse this functionality everywhere we write a list of things. Change-Id: Ia7647be465b4788a2b1e6a5dbede1ca868f24ae2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | CMake: scripts: Fix mypy issuesTobias Hunger2019-05-092-14/+16
| | | | | | | | | | | | | | | | | | | | Change-Id: I706740be79eccd6bf08213fdaf747dde08cd053a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | CMake: pro2cmake.py: Add basic support for examplesTobias Hunger2019-05-091-39/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples need to be built stand-alone and as part of Qt, so they need a special CMakeLists.txt file that supports both use-cases. Add an --is-example switch to pro2cmake to make it generate these special CMakeLists.txt files. This is basic support only and is currently still missing the necessary find_package calls. Change-Id: Ie770287350fb8a41e872cb0ea607923caa33073d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | CMake: pro2cmake.py: Do not fail when run from .pro-file directoryTobias Hunger2019-05-081-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I285b05986e3a58efc060ca0b5732f6e3f5121476 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>
* | | | Force pro2cmake.py to always change the dir to the converted pro fileAlexandru Croitor2019-05-071-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise if you call the script from a different directory, path handling becomes broken and certain files are not found. Change-Id: Ia2f60abbd312a771330b3d5e928e1ccd0b4a845b 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-063-29/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-033-282/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: configurejson2cmake: Do not generate useless OPTIONALsTobias Hunger2019-05-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not set properties of packages to type OPTIONAL. That is the default anyway. Update generator script and generated files. Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc 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-022-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Make freetype a required packageAlexandru Croitor2019-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With qmake if we don't find a system package, we use the bundled one. With CMake we don't provide a bundle freetype, hence it's required to find a system one (or custom provided one). Change-Id: I00a5e2ac55459957dae0729f89bafa792a102152 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-1612-117/+187
|\| | | | | | | | | | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * | | Replace Q_DECL_NOTHROW with noexcept the remaining placesAllan Sandfeld Jensen2019-04-091-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first replacement had missed objective-C++ code some places ourside the src dir. In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still need to turn it off when compiled in C mode, but can get rid of the old NOTHROW moniker. Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-03-261-8/+6
| |\| | | | | | | | | | | | | | Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-8/+6
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| | | * Remove broken code from unicode generatorEskil Abrahamsen Blomfeldt2019-03-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current state produces uncompilable code. Change-Id: I9a68b61866a4a416335ed4d7204c58122803fb1c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | * Wasm: Add workaround for Emscripten compiler againEskil Abrahamsen Blomfeldt2019-03-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work around was added directly to the generated files at some point, and never to the generator it seems. So to avoid removing the workaround again when we regenerate the next time, we need to add it. Task-number: QTBUG-74511 Change-Id: Ided1bd949234ba82df61c55891646823e7f72e80 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | | Clean up and document the generator for qurltld_p.hEdward Welbourne2019-03-191-67/+96
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This scans the public suffix list and emits suitable content for the header. Made some modest efficiency gains while hopefully making the code easier to understand. Check for success when opening files. Change-Id: If6b25c5c85f86209b33d9188743e820690e7dc05 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Adjust chunk-size in TLD-suffix list to placate MSVC 2015Edward Welbourne2019-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2015 has a size limit on strings; sizeof (including the terminating '\0') must not exceed 0xffff. The generator for the suffix-list data worked round this by breaking its data into chunks of at most 0xffff bytes; however, it was limiting on the strlen, not the sizeof, so was off by one. It checked for this before adding each suffix, so has (until now) always happened to break early enough; but the latest update gave an exactly 0xffff chunk, whose terminating '\0' took it over MSVC's limit. So adjust the cutoff to effectively include the terminating '\0'. Task-number: QTBUG-72623 Change-Id: I76ea40060d9fc13c0f7002c5ba22e71b8d0af787 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
| * | Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | | | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-192-4/+2
| |\| | | | | | | | | | Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
| | * Add cmdline feature to qmakeJoerg Bornemann2019-02-182-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][qmake] A new feature "cmdline" was added that implies "CONFIG += console" and "CONFIG -= app_bundle". Task-number: QTBUG-27079 Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
| * | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-132-7/+35
| |\| | | | | | | | | | Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
| | * Clean up and update Unicode character data 3rd-party infrastructureEdward Welbourne2018-11-112-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document how to do an update, fix the bit-rot that had crept into main.cpp since last it was compiled, correct the qt_attribution.json to use the actual version number of UCD (its Revision number) instead of the (admittedly correlated) Unicode release number. Updated to Release 22 (which came with Unicode 11.0.0) in the process; but this doesn't change our actual qunicodetables.cpp (so is incidental). Task-number: QTBUG-71281 Change-Id: Ieb7a6e1a4d49f639993f76ff82c8f12a572db3c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Make util/lexgen/ mention itself in its auto-gen lineEdward Welbourne2018-11-014-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the process, update the README's e-mail address for Simon and mention all recognized command-line options in the usage message. The generated CSS scanner was also out of sync with our source, so update it. Also fixed handling of FileHeader to cope with running from a shadow build by handling paths relative to __FILE__; and revised the CSS3 config to use the same copyright header as was already in use by the existing generated file. Change-Id: I918ff84dbdc95d0478fd6aa4ea74e9a221d1a476 Reviewed-by: Simon Hausmann <simon.hausmann@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: pro2cmake.py: Fix handling of libraries in QTTobias Hunger2019-04-121-9/+7
| | | | | | | | | | | | | | | Change-Id: I5737a285ca0575a454e60fad231435d96b2f1be7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: pro2cmake.py: Inherrit VPATH from parent scopesTobias Hunger2019-04-121-4/+8
| | | | | | | | | | | | | | | Change-Id: I95b62fdf3a4cba674bef5a58f0d414464daa3b0c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: pro2cmake.py: Handle setting a key with $$key in the valueTobias Hunger2019-04-121-10/+18
| | | | | | | | | | | | | | | Change-Id: I86552ed2a30f07f8c6060b2bad04fd5489b1d482 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: Configurejson2cmake: Always enable system-pcre2 and handle dlopenTobias Hunger2019-04-121-2/+4
| | | | | | | | | | | | | | | | | | | | | Handle dlopen properly. Code is ifdef-ed on it, so we need it:-/ Change-Id: I7f35d24b97530796a4cdcdc1acbe139757170215 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | | CMake: Support /nolink librariesTobias Hunger2019-04-102-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: pro2cmake.py: Fix plugin type only prints first letterTobias Hunger2019-04-091-1/+1
| | | | | | | | | | | | | | | Change-Id: Ib8989d2c13199d804d0c069903ca1c5eb61763e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@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: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINESTobias Hunger2019-04-091-3/+2
| | | | | | | | | | | | | | | Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Better separation between public and private librariesTobias Hunger2019-04-091-30/+67
| | | | | | | | | | | | | | | Change-Id: I95a941ae92a77e049437d3cdd7d06eece11588f4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Strip '-D' from compile optionsTobias Hunger2019-04-091-0/+2
| | | | | | | | | | | | | | | Change-Id: I8239d36dc6af1b5eeded7f293dd6c151c10e289f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Fix handling of file pathsTobias Hunger2019-04-091-156/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure to store unchanged filenames as taken from qmake into the scopes it creates. The scopes are then kept longer: Merging/including scopes is handled by adding the scope to a private _included_children member of the parent scope. The methods to access data from scopes are then changed to take the _included_children into account and a new "get_files" method is added, that does all the necessary mapping to handle scope-dependent things like $$PWD, etc. This makes sure src/network is converted correctly incl. all the .pri-files it includes as well as src/platformsupport/themes.pro. Both have been troublesome before. Change-Id: I28e92b7bcee1b91b248c17201c2729a54a3ce4a1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Better representation of scopes as strTobias Hunger2019-04-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Include the current directory in the scope __repr__ output to make it easier to understand where things wrt. include or file names go wrong. Change-Id: I09a6c17c6d8d547f1f64801bcde3c2e10c925ee1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Better handling of debug featuresTobias Hunger2019-04-091-2/+4
| | | | | | | | | | | | | | | | | | | | | Improve way that debug features are detected. Change-Id: Ic0f0e74885e6d1e7f236c9efe4c77482ac212dbc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: pro2cmake.py: Fix typing informationTobias Hunger2019-04-091-1/+1
| | | | | | | | | | | | | | | Change-Id: Iaa6ea69c3c72eb1b626a976fcdb16243f15c609e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>