Commit Graph

106 Commits

Author SHA1 Message Date
Joerg Bornemann
062b50abff CMake: Namespace all our IMPORTED targets
CMake IMPORTED targets should be namespaced so that CMake knows that
the name refers to a target and not a file.

Use the existing WrapXXX naming scheme where applicable.

Fixes: QTBUG-83773
Change-Id: I5b0b722c811200c56c260c69e76940a625228769
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 23:08:32 +02:00
Leander Beernaert
30f69f7ff6 CMake: Add library mapping for xcb-fixes
Change-Id: Ida893674fa0782446acdac4ee5dfec4849d4605f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-15 16:25:19 +02:00
Leander Beernaert
812cc76b02 CMake: Update pro2cmake and friend to convert QtVirtualkeyboard
Expand $$MODULE_BASE_DIR to ${QT_BUILD_DIR}.

Add library mappings for Hunspell.

Add test mappings for QtVirtualKeyboard regarding 3rdparty Hunspell and
T9Write.

Change-Id: Ief007456d0471cbcf9a03d819291edec5f63680f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-15 14:15:52 +00:00
Mikhail Svetkin
ae57e4fba5 cmake: Add library mapping for QtHttpServer
Change-Id: I3e12f164f7f6891c60c0d9da700b888850021e53
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-09 20:11:31 +02:00
Alexandru Croitor
e0346df1b2 CMake: Handle finding of OpenSSL headers correctly
In Coin when provisioning for Android, we download and configure
the OpenSSL package, but don't actually build it. This means that
find_package(OpenSSL) can find the headers, but not the library,
and thus the package is marked as not found.

Previously the openssl_headers feature used the result of finding
the OpenSSL package, which led to it being disabled in the above
described Android case.

Introduce 2 new find scripts FindWrapOpenSSL and
FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL,
and checks if the headers were found, regardless of the OpenSSL_FOUND
value, which can be used for implementing the openssl_headers feature.

FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the
OpenSSL target if available.

The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android.
Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will
always be prepended to the Android sysroot, causing the package not
to be found.

Adjust the mapping in helper.py to use the targets created by these
find scripts. This also replaces the openssl/nolink target.

Adjust the projects and tests to use the new target names.

Adjust the compile tests for dtls and oscp to use the
WrapOpenSSLHeaders target, so that the features can be enabled even
if the library is dlopen-ed (like on Android).

Task-number: QTBUG-83371
Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-04-08 22:03:24 +02:00
Sona Kurazyan
6a6482cb8d Add Qt Core5Compat to the library mapping
Change-Id: Iad613c75705b09f7ae043cff417b0fcf3f5dd946
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-03 17:45:43 +00:00
Alexandru Croitor
61d9428d8c CMake: Make sure that the library config.test is used for assimp
Change-Id: Ia5b2a2ffca2dda460a323fd3f564c548be84c0aa
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-03 16:05:22 +02:00
Leander Beernaert
8dcf7d2674 CMake: Add support for bundled SQLite library
Change-Id: I4d3f6e3bf04eb2fcf337e2c5dbc04b6e6f8ebe0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-25 13:52:05 +01:00
Tor Arne Vestbø
77885f8402 cmake: Remove APPLE prefix from platform names
None of the other platforms have it.

Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:56 +01:00
Tor Arne Vestbø
db745fdd2d cmake: Fix naming when referring to Apple macOS
Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 17:57:52 +01:00
Alexandru Croitor
d4018dac8b CMake: Reformat the python scripts using black
Change-Id: I1e2eba46eb7c9dfefd267be91790be7898634c3a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:53 +01:00
Alexandru Croitor
729a73a9cf CMake: Remove old 3rdparty mechanism for double conversion
Change-Id: I2b20d4d9d95a1f7f59bc506046a1ebc20eb305f7
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-10 07:33:07 +01:00
Leander Beernaert
8ffb9053ad Handle configure.json library tests
This patch updates configurejson2cmake.py to generate compile tests for
library entries. The test also support the inherit keyword, which is
currently limited to one level of inheritance.

LibraryMapping has been extended with a test_library_overwrite as a
means to overwrite the mapped library during a compile test. Certain
tests such as openssl_headers form src/network are mapped with *_nolink
libraries which do not exist when the test is run. Failing to do so will
cause the test to run as it is skipped when the library target isn't
found.

To avoid redundant checks, the library tests need to be opt in by
setting run_library_test to True on an instance of LibraryMapping.

Change-Id: I607b24eda389fa67afad301c616e31bb7ab38d20
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-06 12:32:48 +01:00
Alexandru Croitor
26059d1b9b CMake: Allow building bundled 3rd party libraries in qtbase
A few things are needed to accomplish that:

- the python scripts do not ignore certain system_foo features anymore
  (it is a hardcoded list for now just to be safe)

- configurejson2cmake now outputs
  qt_find_package(WrapSystemFoo) calls for bundled libraries
  (see below)

- the harfbuzz .pro file is modified to accommodate pro2cmake
  not being able to correctly parse some conditional scopes

- the freetype .pro file is modified to make sure linking of the
  library succeeds without duplicate symbol errors, which qmake
  doesn't encounter due to magical exclusion of cpp files that are
  included in other cpp files (presumably for include moc_foo.cpp
  support)

- feature evaluation for Core, Gui, Network now happens in the
  qtbase/src directory, so that bundled libraries can be conditionally
  built

- for each bundled library there are now two FindWrap scripts:
  - FindWrapSystemFoo which finds an installed library in the system
  - FindWrapFoo which either uses the system installed library or
    the built bundled one depending on a condition

- projects that intend to use bundled libraries need to link against
  WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets
  (this is handled by pro2cmake).
  Unfortunately manually added qt_find_package(WrapFoo) calls might
  still be needed as is the case for WrapFreetype and others.

- a new cmake/QtFindWrapHelper.cmake file is added that provides
  a macro to simplify creation of WrapFoo targets that link against
  a bundled or system library. The implementation is fairly ugly
  due to CMake macro constraints, but it was deemed better than
  copy-pasting a bunch of almost identical code across all
  FindWrapFoo.cmake files.

- a qtzlib header-only module is now created when using bundled
  zlib, to provide public syncqt created headers for consumers
  that need them. These are projects that have
  'QT_PRIVATE += zlib-private' in their .pro files
  (e.g. qtimageformats, qtlocation, qt3d, etc.)
  This is unfortunately needed due to QtNetwork using zlib
  types in its private C++ API.

The change includes support for building the following bundled
libraries:
- zlib
- libpng
- libjpeg
- Freetype
- Harfbuzz-ng
- PCRE2

The following 3rd party libraries are still using an old
implementation within the CMake build system, and should be migrated
to the new one in the near future:
- double-conversion
- Old harfbuzz

The are a few libraries that are not yet ported:
- system-sqlite
- systemxcb
- maybe others

Among other things, this change allows building qtbase on Windows
without requiring vcpkg.

Task-number: QTBUG-82167
Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-02-25 15:43:16 +01:00
Alexandru Croitor
160184d6a5 CMake: Fix X11 and xkb library usage in the platform projects
This is a prerequisite for building the bundled 3rd party libraries.

Because the feature evaluation will be moved into src/CMakeLists.txt,
some of the X11 packages were found in the src dir, and then a second
time inside the x11-related projects.
These qt_find_package calls in the x11 related projects tried to
promote the imported targets to global, which failed, because they were
created in a different directory scope.

To avoid this, the special case qt_find_package calls are removed from
the nested projects.

Also, fix the mapping of some of the x11 libraries to be correct
- xkbcommon_x11 was incorrectly mapped to XKB::XKB instead of the
  xkb common x11 library
- xlib was mapped to xcb, whereas X11 is the correct CMake target

Change-Id: I30781b2ecbdd478c98419b14baa0492037e49c61
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-25 15:43:16 +01:00
Johan Klokkhammer Helsing
00eeed234f Move QOpenGLWidget from QtOpenGL to its own module
Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets.

Task-number: QTBUG-74409
Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-18 09:22:51 +01:00
Mårten Nordheim
f126d44db6 Add library mapping for QtShaderTools
Change-Id: Ideefd13d75bdd4e0463c0f7b1e15c0781cfffe8c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-12 08:44:51 +00:00
Mårten Nordheim
b14ee53a08 Add necessities for qtquick3d
Change-Id: I39aadda7ed2b088a475ba5f940d1cb65b5b62f94
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 13:22:34 +00:00
Leander Beernaert
b29cb7889a Run make format
Change-Id: If1107aefbfd374d6b664a94b21b9bbb5ed4cc178
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-16 08:41:08 +00:00
Leander Beernaert
6d73b02ace Add library mappings for QtAxContainer and QtWekKitWidgets
Change-Id: I5d5b77e86437f752465bf8ae7c6dd6730b3bf471
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-12-11 11:33:01 +00:00
Leander Beernaert
ea9c2e558c Add library mapping for QtTools
Change-Id: I59fdad5b56875b965a4831b07b5d8d13f9d7b10f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-12-09 14:42:51 +00:00
Leander Beernaert
1c655fb0fc Post merge fixes
Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-25 14:53:27 +00:00
Alexandru Croitor
8d35ad8726 Add FindWrapHarfbuzz
Apparently we didn't have a wrap find module for it before. Add one,
and add special support to handle a Gentoo broken Config file which is
exported by an autotools build of harbuzz.

Change-Id: I83cbeb817caf2610104c16713d4eac6ab6f8c63b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-25 11:58:02 +00:00
Leander Beernaert
2dcab2b9e0 Fix formatting in helper.py
Change-Id: I8ee2abd27064bfc5bf3f291c2743570d11227fcf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-25 08:39:28 +00:00
Mårten Nordheim
a640db0180 Add parts needed for QtQuick3D
There is a patch in progress to add mappings for Qt3D, so reuse the old
broken Qt3D mappings, delete the duplicates.

QtOpenGLExtensions is needed, so this patch includes it.

Change-Id: I27896ee88b9e6873c8cd52d86afc330e309e1e14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-22 18:03:20 +00:00
Alexandru Croitor
c219aaf4d1 pro2cmake: Reformat code with black
Change-Id: I699031d4a05dad84a0807039dcdba17fd5acf2e3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-13 13:35:40 +00:00
Leander Beernaert
026471378d Add mapping entry for LinuxOfonoSupport
Change-Id: I4c88b58cad6b4f4a88f02a38dd84d3a667bcc063
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-12 10:27:51 +00:00
Alexandru Croitor
190e9dcdcf Regenerate files after dev -> wip/cmake merge
Note the following bigger things that had to be done:
Handle GSS library / feature with a new custom find module.
Implement rudimentary support for relocatability (does not currently
handle extprefix).

Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 19:01:19 +00:00
Alexandru Croitor
fd431fadc1 Fix styling of configurejson2cmake script to make flake8 happy
Amends a986455d10

Change-Id: I5a6327f5bfd9d73e518f0ec1d9bb418282c45077
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-11 09:20:19 +00:00
Alexandru Croitor
a986455d10 configurejson2cmake: Re-add wayland_server library for qtbase
Now there are two of them, one used in qtbase and one in qtwayland.
In the future we should merge them.

Amends 08aba5ea0a

Change-Id: Ife98df28c762836277a02a34dd07e82ce7a1e871
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-10-11 09:17:09 +00:00
Frederik Gladhorn
ffb28b9930 cmake scripts: format with black
There is agreement to use black for formatting, run it and make flake8
happy with its output.

Change-Id: I800d764a50cacba0eac1d8efb5c1dee0cf10a4ad
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-11 08:13:54 +00:00
Frederik Gladhorn
174b17d65d cmake scripts: flake8 cleanup
At least setting the example install dir looks like a bug.

Change-Id: Ibcced739d05de5445fa455e509cc6f42b9ed935b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 14:26:49 +00:00
Frederik Gladhorn
b7adc85642 cmake scripts: do not redefine built-ins
Try not to override built-ins, the code becomes confusing to editors and people.

Change-Id: I9e9421e1506a206551ccfc550f882a075e208181
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-08 19:25:20 +00:00
Mårten Nordheim
c718213548 Make SDL2 library-mapping use a wrapper
Since at least one system provides config files without an included
target.

Change-Id: If1f336aab4cec9704412349d7951849ee8c3dabb
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-03 10:45:58 +00:00
Joerg Bornemann
3886828c1f pro2cmake: Add qtremoteobjects
Change-Id: I6cb2ee0c83e0dd3bf830a063f5790e35cbf73285
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-01 08:56:59 +00:00
Jean-Michaël Celerier
309f96ccb6 Add CMake support for directfb plug-in
Change-Id: I126545e1da54018ce081b42a29e62ca30ee04d64
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-30 11:31:54 +00:00
Oliver Wolff
724281d1aa cmake: Add BlueZ to the list of libraries used by Qt (connectivity)
Task-number: QTBUG-78181
Change-Id: I4eda42c4e42ccb28ebb64eb060d02a33c3af6b03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-25 12:08:54 +00:00
Johan Klokkhammer Helsing
eaf0b27091 CMake: Add missing library-mappings for QtWayland
I haven't checked if the config for wayland-kms actually works, as that
requires building for a target that supports it (RCar M3 or similar).

Task-number: QTBUG-78177
Change-Id: Ib30a63a4e5feb955d17763c37e32ad3f2c13d358
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-25 11:38:22 +00:00
Cristian Maureira-Fredes
cfa3c64625 Adapt string formatting in util/cmake
Second and final batch of changes related to string
formatting styling.

Change-Id: Ifc0e999ee95fe52fd076ac2f001b4a58f82ab5be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-21 15:48:40 +00:00
Simon Hausmann
9ef4ffb1a4 Add platform mapping for emscripten
EMSCRIPTEN is the name in cmake land as per emscripten's toolchain
file.

Change-Id: I11fa444204003f25f14fbf993ecf6766bf37d884
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-20 14:07:03 +00:00
Joerg Bornemann
7e91bd1f27 cmake: Add scxml to the library mapping
Change-Id: I86653af25fbbc2d269eb439ceefaa2f4d4ebde28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-19 10:35:28 +00:00
Mårten Nordheim
2214be5e5a Add SDL2 to 3rd-party library mapping
Change-Id: I9f9df259340271b22a75ddfa6112ecba0f25bbbf
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 19:14:25 +00:00
Cristian Maureira-Fredes
91634c3c9b Improve styling of util/cmake scripts
flake8 was used to evaluate the file, with a couple of exeptions:
    E501,E266,W503

black was used to reformat the code automatically

The changes were:
* Added a README that explains how to use pipenv and pip,
* Remove unnecessary return statements,
* Remove '\' from the end of the lines,
* Use f-strings (>= 3.6) since we are requiring Python 3.7,
* Commenting unused variables,
* Adding assert when Python >= 3.7 is not being used,
* Wrapping long lines to 100 (Qt Style),
* Re-factoring some lines,
* Re-ordering imports,
* Naming `except` for sympy (SympifyError, TypeError)

Change-Id: Ie05f754e7d8ee4bf427117c58e0eb1b903202933
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 12:00:26 +00:00
Frederik Gladhorn
d6ca7306ad CMake: add Qt::TextToSpeech to library mapping
Change-Id: Ib682dede7d8e99461b146e9ef71e6d455daa8b6e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-18 07:45:38 +00:00
Frederik Gladhorn
bb95a030d9 CMake: add library mapping for QtSpeech
Change-Id: I274e7382b1593dcb010f5f03ba0e2ccc9a37e5b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-18 07:07:21 +00:00
Johan Klokkhammer Helsing
08aba5ea0a cmake: Add library mappings for qtwayland
Change-Id: I9d394229073579df104e21c539bbbb614ef8efbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-17 17:12:11 +00:00
Karsten Heimrich
17e11745f1 Add initial support for QtKnx cmake
Change-Id: I419d15ca0bb0b02e11001b75d0c612dddfa3abec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-17 17:11:37 +00:00
Alex Blasche
b935fa8e08 Add a mapping for QtSerialBus
Change-Id: I3664dfe5a7aa064ea4fa8f9455242815a359f346
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-17 14:17:12 +00:00
Sona Kurazyan
ce8337dbeb Add Qt Coap to the library mapping
Task-number: QTBUG-78308
Change-Id: I6ba6f84354d7d008e128c784e24db00ecd67647a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-17 09:57:01 +00:00
Ville Voutilainen
b2a11daaa1 cmake: Enable building of the oci plugin
Change-Id: I003d6da10c7e47402fb373d3956817817328cf0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-09-05 08:24:07 +00:00