Commit Graph

513 Commits

Author SHA1 Message Date
Alexandru Croitor
e88864578a Generate the c++xx standard features instead of skipping them
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>
2019-06-03 14:41:28 +00:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Simon Hausmann
8fa646dbe2 Add basic support for compiling applications with qmake
* Generate module .pri files
* Generate qconfig.pri
* Propagate MODULE_CONFIG from the .pro files

This enables the basic use-case of simple application builds that for
example use the moc. Omitted from the patch is support for private
module configurations, prl files (should we do this?) and possibly more
hidden gems that need to be implemented to for example support building
Qt modules with qmake.

Task-number: QTBUG-75666
Change-Id: Icbf0d9ccea4cd683e4c38340b9a2320bf7951d0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-31 12:53:09 +00:00
Leander Beernaert
d908e0a47d Fix uncessary relative dir suffix in pro2cmake.py
When we replace the PWD key from qmake files and both the base and
current directory are the same, there's no need to add an extra './' to
the current working directory.

This also fixes a unit test in qtsvg as it requires the passed in path
to match exactly to the one outputed in the log files.

Change-Id: Ide9ca6a70493e8039d3af84a9e576d8f6a313f2a
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-29 08:58:52 +00:00
Leander Beernaert
d843bceb0c Add Library Mapping for QtNetworkAuth
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>
2019-05-28 15:07:25 +00:00
Alexandru Croitor
499771f3ea Enhance the porting scripts with some new functionality
These were some hard requirements while porting QtQml .pro files so
that the generated CMake code is syntactically correct and the result
buildable.

This include handling of a few more different condition scopes
and disabling the c++ make_unique feature test.

Change-Id: Iae875ffaf8d100296e8b56b57d076455e5d72006
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-28 14:04:40 +00:00
Alexandru Croitor
cbb143e9f1 Improve configurejson2cmake.py to handle non-compliant qmake JSON
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
2019-05-27 07:48:51 +00:00
Edward Welbourne
548513a4bd Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.

Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-06 15:54:32 +02:00
Alexandru Croitor
bfed22e3b7 Remove all line continuations when processing qmake syntax
We constantly had to adjust the qmake grammar to handle line
continuations (\\\n) in weird places. Instead of doing that,
just do a preprocess step to remove all the LCs like we do with
comments, and simplify the grammar not to take into account the
LCs.

From some manual testing it doesn't look like we get any regressions.

Change-Id: I2017d59396004cf67b6cb54977583db65c65e7d3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-23 14:19:22 +00:00
Alexandru Croitor
a2e0f19b61 Make debug token output actually work for the pro2cmake qmake parser
setName() and setDebug() need to be called on a parser element before
the parser element is used as a sub-element in another parser element,
otherwise the debug output is not shown.

Hence the "iterate over all locals" approach works only partially.
Instead add a new decorating function add_element() for the
construction of each parser element, and make sure to enable debugging
inside that function.

Unfortunately there is no clean way to avoid duplicating the parser
element name both in the local variable and in the function argument.

Change-Id: Iaa9ed9b7dbb22ec084070b9c049cf51c841d442c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-23 14:19:11 +00:00
Alexandru Croitor
6dfeb81bcb Improve qmake syntax parser in pro2cmake.py
Some qtdeclarative pro files caused exceptions when trying to parse
them using the script. This included the following:
- handling conditions divided by newlines and backslashes
- handling conditions that have no scope

The parser has been fixed to deal with those cases and relevant
tests were added.

After the change, all qtdeclarative project files are parseable by
the script.

Change-Id: Ib9736423f7fb3bcc1944b26cfb3114306b4db9a7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-23 14:17:46 +00:00
Alexandru Croitor
80271e8280 Improve qmake parser debug output in pro2cmake
Override the default debug actions to be decorated with proper
indentation for easier reading.

The setup only has to be done once, and not on each QMakeParser
creation.

Change-Id: If5f965b462c782c654ee8ebfdd33570e8f94b084
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-23 14:17:34 +00:00
Alexandru Croitor
0425ee0610 Change the default enabled AUTOGEN tools list to contain only moc
Before this patch we enabled AUTOMOC, AUTORCC, AUTOUIC for all targets
that did not opt out.

Aside from being wasteful from a performance point of view,
this also caused issues when trying to build qtimageformats which
does not depend on Widgets which is the package that exposes uic.

To avoid this, enable only AUTOMOC for all targets by default, and
UIC and RCC can be opted in via the ENABLE_AUTOGEN_TOOLS option.

To facilitate this some refactoring had to be done, like moving some
common setup for all autogen tools into a separate call, and making
sure that extend_target understands the autogen options, because some
ui files are only added conditionally.

Also the conversion script has been adapted to output the
ENABLE_AUTOGEN_TOOLS option whenever a .pro file contains at least
one FORMS += foo assignment.

Note that we don't really use AUTORCC while building Qt, so nothing
opts into that at the moment.

Task-number: QTBUG-75875
Change-Id: I889c4980e9fb1b74ba361abed4044737f8842ea4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-22 14:58:08 +00:00
Alexandru Croitor
4e7756a6cd Add a few more 3rd party libraries to helper.py
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>
2019-05-21 15:28:24 +00:00
Alexandru Croitor
76f5b784ce Fix the fix to correctly handle comments in multi-line assignments
The previous fix where the Grammar comment style was changed to
remove the newlines was incorrect, because if you have

 foo=1#comment
 bar=2

after the Grammar comment ignoring, it would transform into

 foo=1bar=2

which will clearly fail to parse, so the new line has to stay.

But we would still have the following case which would fail:
 foo=a \
 # comment
 b

Apparently qmake things that's the equivalent of
foo=a b

but the grammar parses it as
 foo=a \
 \n (newline)
 b

Thus the parsing fails because there's a newline and then some
weird 'b' token which the grammar does not expect.

The best fix I found is to preprocess the source, to remove
completely commented out lines.

So:
 foo=a \
 # comment
 b

gets transformed into

 foo=a \
 b

Change-Id: I2487a0dbf94a6ad4d917d0a0ce05247341e9b7da
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-20 13:18:11 +00:00
Alexandru Croitor
e4b8c488bd Improve configure2cmake to find_package only in certain conditions
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>
2019-05-20 13:15:16 +00:00
Alexandru Croitor
846adfe079 Handle the new cmdline config feature in pro2cmake
cmdline implies console, so use that also to determine if a binary
should get a GUI flag.

Change-Id: I084e0a45785df96a7dc2c101af5305fbb39efbc3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-20 09:23:14 +00:00
Alexandru Croitor
826821658d Workaround fix in pro2cmake Operation __init__ method
There are still call sites that call Operation.__init__ with a string
instead of a list. Restore the handling of such a case.

Amends 5fe8a38af3

Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-20 09:18:56 +00:00
Alexandru Croitor
c454e622a1 Don't exclude QtCore from dependencies when generating modules
and plugins.

src/network/network.pro for instance depends on core-private, but
because we ignore adding QtCore as a public dependency, the exported
Config file for Network doesn't depend on QtCore anymore, so if a user
only links against Network, they won't automatically link against
Core.

Change-Id: I4a60ffae7e071927360b8ccf6b1b7479ab391060
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-20 09:15:31 +00:00
Alexandru Croitor
e0a6e9f3aa Fix parsing qmake assignments that have comments in between
For some reason the python comment regex that we used does not ignore
the line break at the end of a comment line.

This caused issues when parsing multi line assignments with comments
in between.

Use our own regex for comments to circumvent the issue. It was found
while trying to port the qtimageformats repo.

Added a pytest as well.

Change-Id: Ie4bbdac2d1e1c133bc787a995224d0bbd8238204
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-17 13:31:03 +00:00
Tobias Hunger
14bf7e952e CMake: Fix test_scope_handling
Adapt to updated APIs in pro2cmake.py

Change-Id: I39898b675e27d6295ef6cfa049c82b245d71188a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-17 13:26:29 +00:00
Tobias Hunger
5fe8a38af3 CMake: Fix test_operations
Fix test_operations and do some small mypy cleanups along the way

Change-Id: I6586b5d3491e5dcf44252c098516f0922fa60420
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-17 13:26:26 +00:00
Edward Welbourne
5b672693e7 Add locale support for Cebuano and Erzya languages (new in CLDR v35.1)
Change-Id: I5d0ee7bc27eeca1c046d442b0410128ea5abbdb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-20 20:42:11 +02:00
Edward Welbourne
b7d8169f02 Suggest name, when available, for unknown codes
When parsing the CLDR data, we only handle language, script and
territory (which we call country) codes if they are known to our
enumdata.py tables.  When reporting the rest as unknown, in the
content of an actual locale definition (not the likely subtag data),
check whether en.xml can resolve the code for us; if it can, report
the full name it provides, as a hint to whoever's running the script
that an update to enumdata.py may be in order.

Change-Id: I9ca1d6922a91d45bc436f4b622e5557261897d7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-20 20:42:11 +02:00
Edward Welbourne
248b6756da Rename util/locale_database/ to include the e that was missing
It was misnamed local_database, quite missing the point of its name.

Change-Id: I73a4fdf24f53daac12304de1f443636d89afacb2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-20 20:42:10 +02:00
Tobias Hunger
400f94109d CMake: Wrap DBus1 find_package call to fix xproto not being picked up
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>
2019-05-10 15:09:49 +00:00
Tobias Hunger
e9085f4162 CMake: pro2cmake.py: Add target_link_libraries to examples
Change-Id: Ic7054f0c88e228496b7f4855bffa5620ed717f9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-09 13:14:45 +00:00
Tobias Hunger
35ed41e547 CMake: pro2cmake.py: Generate find_package information into examples
Change-Id: I6dab13ebea4386019f14be5f29a143d194268aac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-09 13:14:37 +00:00
Alexandru Croitor
bc4687f5bb Keep "special case" modifications when regenerating project files
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>
2019-05-09 11:29:54 +00:00
Tobias Hunger
862ebbf7ea CMake: scripts: Extract code to write find_package lines
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>
2019-05-09 11:29:35 +00:00
Tobias Hunger
80e0c615a9 CMake: pro2cmake.py: Separate library extraction logic from writing out data
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>
2019-05-09 11:29:25 +00:00
Tobias Hunger
c4dd1a8fe3 CMake: pro2cmake.py: Extract writing lists into cmake files
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>
2019-05-09 07:38:17 +00:00
Tobias Hunger
ee3d9a8b67 CMake: scripts: Fix mypy issues
Change-Id: I706740be79eccd6bf08213fdaf747dde08cd053a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-09 07:37:58 +00:00
Tobias Hunger
5608bf3cba CMake: pro2cmake.py: Add basic support for examples
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>
2019-05-09 07:37:42 +00:00
Tobias Hunger
0c498ef4ff CMake: pro2cmake.py: Do not fail when run from .pro-file directory
Change-Id: I285b05986e3a58efc060ca0b5732f6e3f5121476
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-08 11:25:58 +00:00
Alexandru Croitor
9d96c8da78 Fix freetype target not being found when using vcpkg
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>
2019-05-08 10:54:15 +00:00
Alexandru Croitor
aed2c1f5ae Force pro2cmake.py to always change the dir to the converted pro file
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>
2019-05-07 17:08:28 +00:00
Tobias Hunger
5ec3baa67a CMake: scripts: Make xcb_qpa_lib known as a Qt module
Change-Id: I65f48d86c4ec946b38004b945078f29625e32d93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-07 14:45:22 +00:00
Tobias Hunger
d5018720db CMake: scripts: Treat libraries mapped to None as known
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>
2019-05-07 14:41:31 +00:00
Tobias Hunger
9ffcc76188 CMake: Scripts: Fix double entries in 3rd party library mapping
Change-Id: I35f29876874d6083d19382800d194e417d57bca1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-06 14:29:20 +00:00
Tobias Hunger
059f4ade7f CMake: pro2cmake.py: Fix library mapping
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>
2019-05-06 14:20:50 +00:00
Alexandru Croitor
6b2de61bf9 Make zlib a required package for QtCore
Change-Id: Ifbb969fafe05e355d6874d8bebe2e8f1e80510ff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-03 14:16:23 +00:00
Tobias Hunger
7874ce7801 CMake: Improve mapping of libraries
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>
2019-05-03 13:42:25 +00:00
Tobias Hunger
9618434de5 CMake: configurejson2cmake: Do not generate useless OPTIONALs
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>
2019-05-03 13:39:48 +00:00
Albert Astals Cid
64b31cafa1 cmake: Fix xcb_glx build
Use the actual cmake library target name

Change-Id: Icda1d232e3b920bf33ebceb00f39682050f7dedd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-03 08:13:56 +00:00
Alexandru Croitor
9b0b464e82 Write find_dependency() calls in Qt Module config files
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>
2019-05-02 07:30:42 +00:00
Alexandru Croitor
5668522413 Make freetype a required package
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>
2019-05-01 19:05:38 +00:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Tobias Hunger
37ed6dae00 CMake: Map xkbcommon_support
Qt 5.12 comes with xkbcommon_support now. Map that accordingly.

Change-Id: Id10708349d377f6bdfed654428ebcef0b533bd69
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-04-12 14:06:07 +00:00
Tobias Hunger
ce809cab29 CMake: pro2cmake.py: Fix handling of libraries in QT
Change-Id: I5737a285ca0575a454e60fad231435d96b2f1be7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-12 11:35:18 +00:00
Tobias Hunger
95cdb0d1ae CMake: pro2cmake.py: Inherrit VPATH from parent scopes
Change-Id: I95b62fdf3a4cba674bef5a58f0d414464daa3b0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-12 11:35:09 +00:00
Tobias Hunger
2ec3f492a7 CMake: pro2cmake.py: Handle setting a key with $$key in the value
Change-Id: I86552ed2a30f07f8c6060b2bad04fd5489b1d482
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-12 11:35:01 +00:00
Tobias Hunger
8f0eb65579 CMake: Configurejson2cmake: Always enable system-pcre2 and handle dlopen
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>
2019-04-12 11:33:39 +00:00
Tobias Hunger
92b0d7b911 CMake: Support /nolink libraries
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>
2019-04-10 09:36:40 +00:00
Allan Sandfeld Jensen
95f787bfdc Replace Q_DECL_NOTHROW with noexcept the remaining places
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>
2019-04-09 14:48:42 +00:00
Liang Qi
677a7a3066 CMake: Fix mappings in helper.py - WUIAS
This amends 9afc605eb5.

Change-Id: If246811d267d091c692875a1645c96767f781010
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-09 14:26:05 +00:00
Tobias Hunger
511124bf1d CMake: pro2cmake.py: Fix plugin type only prints first letter
Change-Id: Ib8989d2c13199d804d0c069903ca1c5eb61763e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-09 09:54:23 +00:00
Tobias Hunger
9afc605eb5 CMake: Fix mappings in helper.py
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>
2019-04-09 07:29:21 +00:00
Tobias Hunger
3bc9586e61 CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINES
Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:29:08 +00:00
Tobias Hunger
3cf92ab183 CMake: pro2cmake.py: Better separation between public and private libraries
Change-Id: I95a941ae92a77e049437d3cdd7d06eece11588f4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:58 +00:00
Tobias Hunger
8c28c85465 CMake: pro2cmake.py: Strip '-D' from compile options
Change-Id: I8239d36dc6af1b5eeded7f293dd6c151c10e289f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:44 +00:00
Tobias Hunger
9d83b54015 CMake: pro2cmake.py: Fix handling of file paths
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>
2019-04-09 07:28:30 +00:00
Tobias Hunger
52f676bf66 CMake: pro2cmake.py: Better representation of scopes as str
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>
2019-04-09 07:28:18 +00:00
Tobias Hunger
77a465ea2d CMake: pro2cmake.py: Better handling of debug features
Improve way that debug features are detected.

Change-Id: Ic0f0e74885e6d1e7f236c9efe4c77482ac212dbc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:28:08 +00:00
Tobias Hunger
9365a01531 CMake: pro2cmake.py: Fix typing information
Change-Id: Iaa6ea69c3c72eb1b626a976fcdb16243f15c609e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:27:59 +00:00
Tobias Hunger
81542ffb91 CMake: Map linuxaccessibility_supportPrivate to Qt::LASP
Change-Id: I6066f69c74c39fb97a286eb92748b5c4172b1efd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-04-09 07:27:48 +00:00
Alexandru Croitor
4f07e711c9 Add script to print out list of unconverted .pro files
Also prints some statistics.

Change-Id: Ieb55618c0d39604ca76d7a44390e61e02824a01f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-08 14:53:46 +00:00
Alexandru Croitor
547c7f8ca5 Fix architecture conditions
The actual variable that contains the architecture is
TEST_architecture_arch. TEST_architecture only contains the value
if the test was performed or not.

Fix the conversion script and all the generated files.

Change-Id: Icb3480832cab894948f4fef03b8bc8187cab6152
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-03 09:00:08 +00:00
Tobias Hunger
29f5c0ee70 CMake: Map cups to Cups::Cups, vulkan_support_private to Qt::VulkanSupportPrivate
Change-Id: Id03942becb08ca3ece589479ffe515f68034ddd4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-03 08:53:57 +00:00
Alexandru Croitor
e2e4525f78 Fix simplification of conditions involving apple
Previously a condition like APPLE AND (NOT APPLE_OSX) got simplified
to APPLE, which is wrong.

This happened by accident due to some sub-family simplifications
involving BSD, which APPLE was part of.

Technically APPLE is BSD derived, but for the purposes of the
conversion script consider APPLE not to be a BSD (hopefully there
should be no cases of using the bsd scope for apple machines in
qmake files.

Also regenerate the fontdatabase project, where the issue was found.

Change-Id: I18dcf4f29ffbff48c183ba95ca2a2e5cd5325d86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-02 13:32:21 +00:00
Tobias Hunger
5c05c46e92 CMake: Set define for default QPA platform
This is used to set the default QPA platform and without it
all Gui applications trigger an assert in QString:-/

This is way simpler than going through configure.json.

Change-Id: I2c053e95c0f7e99e97a0b2918d8e4ac13d3494fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-02 13:17:26 +00:00
Tobias Hunger
03a64ab80d CMake: pro2cmake.py: Handle QDBUSXML2CPP_*_HEADER_FLAGS
Change-Id: Ib5d34a6bf550a11154109064e4e718d0c79c722b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:29:47 +00:00
Tobias Hunger
75658794e4 CMake: pro2cmake.py: Improve handling of dbus interfaces/adaptor sources
Change-Id: I3b642e1ae31996a81618e312183f4cc168bbbe1b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:29:29 +00:00
Tobias Hunger
b9a3217c41 CMake: pro2cmake.py: Handle $$PWD better
Change-Id: I2e28b652c60d3490138ae0548b32d010faccc5a4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:28:51 +00:00
Tobias Hunger
6a834a0c59 CMake: Map odbc to ODBC::ODBC
Change-Id: I55cf506cca87ac3e3fe9e0e1803f5118b46bf818
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:27:43 +00:00
Tobias Hunger
b0d4ac8498 CMake: Map SQLite3 to SQLite::SQLite3
Fix sqlite maping while at it.

Change-Id: I712ca562fa362a7f5857047346e8b3083f901bfb
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:27:29 +00:00
Tobias Hunger
1ac36d4bc2 CMake: Map glx_support and glx_supportPrivate
Change-Id: I777ea84a080a6856961d644a0290e4d73e07c518
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:27:13 +00:00
Tobias Hunger
61ec3d0b6e CMake: Map psql to PostgreSQL::PostgreSQL
Change-Id: I8332d2120e8b629c8722b5c9a95b47950b327d4c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:26:58 +00:00
Tobias Hunger
828f2965e7 CMake: pro2cmake.py: deduplicate and sort libraries
Change-Id: I924cfac365a0b4ba18c2579820bc37729f1ea8d9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-03-29 14:06:41 +00:00
Tobias Hunger
0c5b63207b CMake: Map atspi2 to PkgConfig::ATSPI2
Change-Id: Ifd21eb278e06a6166ab87106c442d8ec94d92dc5
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 09:33:30 +00:00
Tobias Hunger
2268d171cd CMake: Map tslib, mtdev, libinput and xkbcommen_evdev
Change-Id: If144a8969904b63a3de3884370baaeca1cb4242a
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 09:33:05 +00:00
Tobias Hunger
2b5e3590ca CMake: Map fontconfig to Fontconfig::Fontconfig
Change-Id: I2761ef23cffefbee57da6bb1a07d06b2232d1c57
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 09:32:50 +00:00
Tobias Hunger
f375876d1a CMake: Map libudev to PkgConfig::Libudev
Change-Id: Iac5d0fbf336f0c3905a3dca20524f90432227cf4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 09:32:34 +00:00
Jędrzej Nowacki
a697df786d Fix exception when parsing tests.pro
The ParseResults may be a nested list of list. Now the code doesn't
raise exceptions, but it fails in do_include as includes that doesn't
provide resolved path will fail. Anyway step in the right direction.

Change-Id: Ice44e4c10d221293cc6c1facca30abd5495791be
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-28 13:18:25 +00:00
Jędrzej Nowacki
ce9a143467 Do not overwrite CMakeLists.txt when running run_pro2cmake
One directory may contain many pro files. The generator was happily
generating the same CMakeLists.txt for all of them (overwriting).

This patch implements a different logic. It tries to find the main
pro file and skips others assuming that somehow implicitly they will
be incorporated (for example through SUBDIRS).

Change-Id: Ie07d75e900a96dd48bf981a896c9dfb920f39a23
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-28 12:29:44 +00:00
Jędrzej Nowacki
601c840973 Do not validate file existence if path contains variables
We do not need to validate everything, while converting project
files. Some checks can be left to building step.

It fixes some false positive NOTFOUND errors.

Change-Id: I81ff2421fdea13add0bfc03086152a47bce39908
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-28 09:29:06 +00:00
Jędrzej Nowacki
89f34ee42a Fix turned logic in RemoveOperation
It is regression caused by a0a94576fa
("Fix RemoveOperation").

Add unit test for all operation types to make sure this code actually
works:-)

Change-Id: I97c94cb3411f05de89422e3fa2222f2217a09e49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-28 06:30:32 +00:00
Jędrzej Nowacki
a0a94576fa Fix RemoveOperation
The operation was using an empty set as a base, so it was not really
functional.

Change-Id: I98fd80c1ede31994857aa1f0c8947ca7b9f76649
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-03-26 11:14:32 +00:00
Jędrzej Nowacki
eb3d73ffb7 Speedup run_pro2cmake
We can use all cores. Sadly it doesn't balance cores well as
corelib.pro takes most of the time anyway, but the speedup is
visible from ~15 to 5 min.

Change-Id: Id8209c58491b38d19c6e9f1163d366c3e33a182c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-26 11:10:10 +00:00
Friedemann Kleint
7f635d9777 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
2019-03-26 08:24:59 +01:00
Alexandru Croitor
8158a8767c Temporarily disable the opengles2 feature on WIN32
The feature used to be implicitly enabled because qt source ships with
ANGLE sources, and thus ANGLE could always be built. Yet because the
CMake port of ANGLE is not done yet, and because the feature is
implicitly enabled, the build failed when trying to find GLES headers.

To provide a nicer out-of-the-box configuring of the Windows build,
disable the opengles2 feature on Windows, to default to a desktop GL
build. It can be re-enabled once (if) ANGLE porting is done.

After this change, you shouldn't need to pass any additional custom
FEATURE_foo options to cmake to build qtbase on Windows.

Change-Id: I94c96d8ef70cf671d2ce0198311f70b55fa642b1
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-21 21:51:22 +00:00
Alexandru Croitor
ba7c62eed5 Fix sub-architecture (instruction sets / SIMD) handling
In qmake there are at least 2 things to know regarding
sub-architectures and instruction sets.

Which instruction sets does the compiler know to compile for,
represented by the various config.tests and features in
qtbase/configure.json.

And which instructions sets are enabled by the compiler by default,
represented by the configure.json "architecture" test and accessed
via QT_CPU_FEATURES.$$arch qmake argument.

Before this patch there was some mishandling of the above concepts
in CMake code.

The former can now be checked in CMake with via TEST_subarch_foo and
QT_FEATURE_foo (where foo is sse2, etc).

The latter can now be checked by
TEST_arch_${TEST_architecture_arch}_subarch_foo
(where foo is sse2, etc and the main arch is dynamyicall evaluated).

The configurejson2cmake script was adjusted to take care of the above
changes, and the cmake files were regenerated as well.

Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-21 17:47:01 +00:00
Qt Forward Merge Bot
6893919b0c Merge remote-tracking branch 'origin/5.12' into 5.13
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
2019-03-20 14:09:30 +01:00
Tobias Hunger
cb7a3aaa4c CMake: pro2cmake.py: Report more qmake variables as used
Report some more qmake variables as used when they are used to decide
which kind of target to write.

Change-Id: Id2602bb8cc07130456c04c53148acb73f21b0f21
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-20 10:45:14 +00:00
Tobias Hunger
88549c2855 CMake: pro2cmake.py: Handle "target.path" and "INSTALLS = target"
Add installation location information into CMakeLists.txt files if
available in CMake.

Change-Id: I498deac71b1cc33c7d30790e32da236afdcb23af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-20 10:45:04 +00:00
Tobias Hunger
347261aaf6 CMake: pro2cmake.py: Handle DBUS_*S
Handle DBUS_ADAPTORS and DBUS_INTERFACES and turn them into
equivalent CMake statements.

Change-Id: Ia8a69e7ab97d9f18df93097a6e2c7c1686cb16a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-20 10:44:46 +00:00
Tobias Hunger
d84a2b8274 CMake: pro2cmake.py: Fix typo
Change-Id: I5eebe64f825ab28a67093b1a2cef417ed0908ec0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-20 10:44:33 +00:00
Edward Welbourne
c0ab2ad98f Clean up and document the generator for qurltld_p.h
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>
2019-03-19 17:52:09 +00:00
Alexandru Croitor
37b154858f Improve configurejson2cmake feature output generation
There were a few cases of feature outputs that were handled
incorrectly before this change, specifically:
- publicFeatures and privateFeatures with custom names
- privateFeatures that also ended up writing defines into
  public headers
- publicFeatures that ended up in private headers
- internal features (that should have no QT_FEATURE_foo
  defines) that were still written to either public or
  private headers

The change takes care of all those cases by keeping a map
of which features need to be written along with any visibility
specifications, as well as custom name changes.

Change-Id: I37baeaeacdfe4935128a392c72ca71b5c3ca1c8d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-18 15:34:33 +00:00
Eskil Abrahamsen Blomfeldt
01380dc267 Remove broken code from unicode generator
The current state produces uncompilable code.

Change-Id: I9a68b61866a4a416335ed4d7204c58122803fb1c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-03-18 15:17:10 +00:00
Eskil Abrahamsen Blomfeldt
e59ba35f1b Wasm: Add workaround for Emscripten compiler again
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>
2019-03-18 15:16:53 +00:00
Tobias Hunger
fbf98bf255 CMake: pro2cmake.py: Better reporting of unused keys from qmake
Change-Id: Ie1b1f446c314bb5248cc13efeae1f279b0182e04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-18 11:38:05 +00:00
Tobias Hunger
6e16f127ad CMake: pro2cmake.py: Handle SIMD sources
Change-Id: Ib445888e769432e8c247ae2d2fb5d8af2d5cd275
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-18 11:37:47 +00:00
Tobias Hunger
42ae8218b1 CMake: configurejson2cmake.py: Fix typo
Change-Id: Ib142032577f1d84bfb2402103271db04a4bb25a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-12 08:43:03 +00:00
Tobias Hunger
4b105d77c2 CMake: pro2cmake.py: Remove .qrc files!
Remove qrc files from CMake. Use add_qt_resource function instead.

Change-Id: I64cdbd9498f97d23cd8e03f34ab5ae4a52dba5af
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-11 14:52:09 +00:00
Tobias Hunger
66a4267f93 CMake: pro2cmake.py: Map libpng to PNG::PNG
Change-Id: Ia8dd20b777e24e2783bedb0f063db2189e0b7ed3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:09:04 +00:00
Tobias Hunger
a5f51e4898 CMake: pro2cmake.py: Automatically map equals(QT_ARCH, "foo") in conditions
Change-Id: I10d8001ba8330deaa622ef8c499b2b6fe438e28a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:08:57 +00:00
Tobias Hunger
363eccf010 CMake: pro2cmake.py: Handle BOOTSTRAP for add_qt_tool
Add BOOTSTRAP for tools that need it automatically.

Change-Id: I33b2ec16dfcb09709f844ed232ce9974a9d7c7ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-03-04 09:08:48 +00:00
Михаил Светкин
3c9d7dfb30 cmake: Cleanup harfbuzz features
Remove system-harfbuzz feature and use harfbuzz feature as system

Change-Id: I441345a667450f1c2d19380b0709911011c7ceb7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-03-01 19:24:50 +00:00
Edward Welbourne
f9421f0968 Adjust chunk-size in TLD-suffix list to placate MSVC 2015
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>
2019-03-01 13:26:46 +00:00
Tobias Hunger
83354655b2 CMake: pro2cmake.py: Simplify code and add test for line continuation
Simplify code a bit and add a test for line continuation fixup.

Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:41 +00:00
Tobias Hunger
f2e968b245 CMake: pro2cmake.py: Handle for loops without block
Handle for loops with a single line of instructions and add a test
for that.

Change-Id: I041ae30f64abcbd3db7df29933647f047b92ede3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:30 +00:00
Tobias Hunger
33fe56c630 CMake: pro2cmake.py: Make \$\$QT_FOO work in assignments
This broke somewhere along the way. Add a test for this.

Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:17 +00:00
Tobias Hunger
754ba28799 CMake: pro2cmake.py: Fix parsing of Line continuation before end of file
... and add a test case for this.

Change-Id: If20d737b54ecb3f9e128e59070b238c840acad6c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:08 +00:00
Tobias Hunger
8512f5179d CMake: pro2cmake.py: Fix parsing of for loops
Ignore for loops in the pro2cmake.py parser and add a unit test for that.

Change-Id: I2a0c075c45cf56f4f24ada2d53e8e8e94ce19f26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:08:00 +00:00
Tobias Hunger
04d6981702 CMake: run_pro2cmake.py: Add statistics
Change-Id: I78e65970694d0c37c4b3c3ba6e6a83155579ea0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:07:07 +00:00
Tobias Hunger
eb832cb00a CMake: pro2cmake.py: Handle complex conditions
Change-Id: Ifb047e5736f1831ddbd65b210e760c2729378334
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:06:49 +00:00
Tobias Hunger
951e297362 CMake: pro2cmake.py: Warn and fix broken line continuation
Warn on broken line continuation in .pro-files, but fix up the issue
and proceed.

Change-Id: Ibe68011b312bcea25620ce790a0b44b2983fbd88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-28 08:06:41 +00:00
Tobias Hunger
c971d2d359 CMake: pro2cmake.py: Handle values with () in assignments
Change-Id: I0f59c7fa57cd6c64b151f439d4eea4ae56dca288
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:20 +00:00
Tobias Hunger
22dc78f417 CMake: pro2cmake.py: Fix handling of TEMPLATE=subdir .pro-files
Change-Id: I52f575df199c4d9b38123ab5d838f2e85344835d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:07 +00:00
Tobias Hunger
8c04d6c967 CMake: pro2cmake.py: Improve condition simplification code
Improve the code that simplifies conditions to take "OS families"
into account. E.g. if a system must be ANDROID, then it is redundant
to express that it is NOT APPLE_OSX.

Change-Id: Ib7e62726c309bf84b9e5e0d6a6e3465511db0ead
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:58 +00:00
Tobias Hunger
35f23a3dad CMake: pro2cmake.py: Better parsing of scopes with else
Parse conditions more exactly as before, enabling proper handling
of else scopes.

Change-Id: Icb5dcc73010be4833b2d1cbc1396191992df1ee4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:45 +00:00
Tobias Hunger
b1fa25e7b8 CMake: Small unsorted fixes in preparation of upgrading to dev branch
Change-Id: Id4d03558e956c6994dc6a8b701030ba4edf86adf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:29 +00:00
Mikhail Svetkin
885494c50f CMake: Fix build without double-conversion on macOS
Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-27 15:28:11 +00:00
Albert Astals Cid
31e1dda94b cmake: Give the egl_x11 test the necessary libs to compile
And add the eglfs_x11 plugin

We need to actually try to compile the test as the comment it it says
that having x11 and egl is not enough since sometimes they are actually
incompatible

Change-Id: If6bdc08c21b91fa9c41663f2fa653fd59e5ddd2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 15:04:59 +00:00
Albert Astals Cid
e03596c2a7 pro2cmake: account for child .pro files having includes
Change-Id: Ic2213578c9bd27787ae9788acbe4455252a1158c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 15:04:48 +00:00
Robert Loehning
85b0ce8ca3 Fix can not -> cannot
Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-02-25 13:03:45 +00:00
Edward Welbourne
d3b887707d Clean up some poorly-placed newlines in the TLD suffix data
A comma appeared on a line on its own; a closing-brace didn't.

Change-Id: I33cf37bb3574cd421c8af5ab6312865b71ce61f1
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
2019-03-08 10:44:05 +01:00
Liang Qi
388fe97f2a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
2019-05-13 08:04:58 +02:00
Qt Forward Merge Bot
e56d3b03ed Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale_data_p.h
        (Regenerated by running the scripts in util/local_database/)
	src/gui/opengl/qopengltextureuploader.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
2019-05-09 13:06:11 +00:00
Edward Welbourne
b58cfb2f1f Update cldr2qlocalexml.py's claimed CLDR version support
It was up to date with v34 (and seems to cope with v35.1) but only
clained support for v29.

Change-Id: I686cae1977824a4deec4633f19604b91061fe78a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-07 09:29:36 +00:00
Edward Welbourne
8c8b4b8fde Correct and expand support for CLDR's date/time format strings
Our conversion from CLDR's format to our own was missing some things
it could support sensibly, and some it could do better than ignore or
treat as literal, while mis-handling the 'E'-based formats for day
names.  At least in CLDR v34 this doesn't actually make any difference
(on regenerating our locale data, the only change is the date of
generation).

Task-number: QTBUG-70516
Change-Id: I9d27b9bf24afd168c2f8a5258143d3d695bca0ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-07 09:29:18 +00:00
Liang Qi
dc37318684 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/gui/util/qshaderformat.cpp
	src/gui/util/qshaderformat_p.h
	src/widgets/graphicsview/qgraphicsitem_p.h

Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
2019-04-24 09:52:30 +02:00
Edward Welbourne
40d9ac93e0 Clean up help message for the public suffix list processor
The grep given in the help from the program to process the
effective-TLD list only worked for voodoo reasons.
Replaced it with an actually-correct use of grep.

The commands given used the name effective_tld_names.dat in the URL
fetched; however, the relevant file has (for some time now) said
explicitly "Please pull this list from, and only from
https://publicsuffix.org/list/public_suffix_list.dat"
Changed the name used to match that URL.

Revised the output file's suggested name and the instructions for what
to do with its contents, making clear they *replace* what was there
before ...

Fixed some typos and related ugliness.

Change-Id: Iacd186c0003227d657099716262eb3a89c9e5f1b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-04-23 17:29:29 +00:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Albert Astals Cid
5f8e4b7cf0 cmake: add more mappings to helper.py
Change-Id: Ie5096c1fe74105db84ccd60655a20d389a887b14
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:06:49 +00:00
Albert Astals Cid
dc0870db74 pro2cmake: Target dependencies can be on -private libs
so use map_qt_library instead of map_qt_base_library

Change-Id: I4dd0097fff3ffd9ec4aad36d11d79ea23a08cb90
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:05:49 +00:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[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>
2019-02-18 07:12:14 +00:00
Albert Astals Cid
db9cb61993 cmake: helper.py more mappings
Change-Id: I69a1715bbda8f5ddfb367e7c7c693e4ec412f5c3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-15 15:08:12 +00:00
Albert Astals Cid
d523a642dc cmake: enable vnc platform plugin
Change-Id: I5015681aff3c9ceb5c0b72571bc8756f3ada104c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 17:02:02 +00:00
Simon Hausmann
519ef817ff Fix Desktop GL/EGL/GLESv2 linkage
This change fixes a few things in one go:

  * cmake's FindOpenGL cannot be used reliably to detect EGL. So use a
    custom module for that.
  * Added a custom module for GLESv2 detection, as cmake's FindOpenGL
    does not support that.
  * Map CONFIG += opengl to a WrapOpenGL target, which links against
    either GLESv2 or libGL - just like mkspecs/features/*/opengl.prf
  * cmake's FindOpenGL remains in use solely to detect the availability
    of desktop gl.

Change-Id: I9315e5ad1fd88e1b7dc7e920053e98fb51fea7fc
Reviewed-by: Volker Krause <volker.krause@kdab.com>
2019-02-12 14:57:30 +00:00
Albert Astals Cid
0a14d13b30 cmake: Find and build odbc plugin
Change-Id: I479d2b1cc897f601ef68b10272c9396e52228201
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 14:39:50 +00:00
Albert Astals Cid
11acba6504 cmake: Find and build psql plugin
Change-Id: I8cbc8ab0061f67824d78198cbb926f0625fc7e41
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 14:39:33 +00:00
Albert Astals Cid
9bef044a0b cmake: Search and enable the sqlite[3] plugin
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>
2019-02-12 14:02:22 +00:00
Albert Astals Cid
05aeaed906 Find mtdev and use it
Change-Id: I90db48efaa6a23add770fcf69b46c4f4c84866c1
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 13:35:07 +00:00
Albert Astals Cid
92f81ebc21 configurejson2cmake.py: openssl -> OpenSSL mapping
Change-Id: I29480dfbd4f144e3d5620b43419ec46fb866cf4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 11:22:53 +00:00
Kai Koehne
7b434c0287 CMake: Fix build of system jpeg is not available
Change-Id: Ie7462db556d0615e74755fa4fc3b51f625aade2f
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 09:47:23 +00:00
Albert Astals Cid
443ee65d3b configurejson2cmake.py: Don't emit a fixme for C++11 config
Change-Id: I8408f6126115a0f76b0fed2cc42b54e5c148821d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 09:25:01 +00:00
Albert Astals Cid
cfba14e1e9 configurejson2cmake.py: Support for the two cases that have LIBS +=
Since there's only two i hardcoded it for the moment instead of trying
to parse the line

Change-Id: I0da578af64ef9621cbbc78bf6ce15bf8a3f63f1c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 09:24:31 +00:00
Albert Astals Cid
2e64ac90d8 cmake: also write FIXME on the configure.cmake for 'use'
Since most of the times it means we need to link with some other stuff

Change-Id: I06262d4403225bca7a5e68d47145fefcf6702e5a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 09:22:02 +00:00