Commit Graph

4 Commits

Author SHA1 Message Date
Alexandru Croitor
5fa823491b CMake: Fix automatic sysrootification detection for qmake
The way we detected whether SysrootifyPrefix needs to be set was
incorrect.

We checked if extprefix == prefix => SysrootifyPrefix should be
true. But that was previously always the case for a non-prefix build,
which means it was not possible to build apps (due to qmake expecting
to find include dirs in the sysroot, despite the non-prefix Qt not
being installed anywhere into the sysroot).

Instead we should do what qmake does. Only set SysrootifyPrefix to
true if extprefix was not provided and a sysroot is available.

To make it work for iOS and Android, the sysroot detection code had to
be moved earlier than the SysrootifyPrefix detection.

Task-number: QTBUG-86053
Change-Id: Idcc1260a675fb2ef9ae27fc9dc42a68b30f763b8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-26 13:46:49 +01:00
Alexandru Croitor
bf3d834ab4 CMake: Fix creation of host-qmake wrapper when cross-compiling
The -host prefix was added to the 'preliminary' directory rather than
the actual wrapper shell script. This caused it to be overwritten
every time by the cross-compiled qmake binary.

Change-Id: I103811c6aa9181fa701e3e7ecaf828ecdd1e3c90
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-23 11:04:07 +02:00
Joerg Bornemann
d6e41abd62 CMake: Handle -D, -I, -F and -L configure arguments
Introduce new CMake variables and map
-D to QT_EXTRA_DEFINES,
-I to QT_EXTRA_INCLUDEPATHS,
-L to QT_EXTRA_LIBDIRS,
and -F to QT_EXTRA_FRAMEWORKPATHS.

Those variables only affect the Qt build, not user projects.

Fixes: QTBUG-85878
Change-Id: I229df2eed1505a2619068d0d32975962b052569a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 18:19:24 +02:00
Alexandru Croitor
44cce1a2ea CMake: Split QtBuild.cmake into smaller files
QtBuild.cmake is huge. Split it.

Move module, plugin, tools, executables and test related functions out
of QtBuild.cmake into separate files.
Do the same for many other things too.

An additional requirement is that all the new Helpers files only
define functions and macros.
No global variable definitions are allowed, nor execution of commands
with side effects.

Some notes:
qt_install_qml_files is removed because it's dead code.

Some functions still need to be figured out, because they are
interspersed and depend on various global state assignments.

Task-number: QTBUG-86035
Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-14 13:17:11 +02:00