Commit Graph

839 Commits

Author SHA1 Message Date
Joerg Bornemann
e3c6e19ad0 CMake: Fix call to qt_apply_rpaths in qt_internal_add_app
We never passed a valid target name to qt_apply_rpaths.
This amends fde98f7794.

Task-number: QTBUG-85399
Change-Id: I1c023ce30a3a8b5ec43d020373960d19fe20f59a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-09-01 11:35:39 +00:00
Joerg Bornemann
5c092c2b40 CMake: Implement configure -trace
Task-number: QTBUG-85373
Change-Id: Ib9ac35ec98dd5b6c272f58f8a61a124d1d262ec0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-01 13:35:39 +02:00
Alessandro Portale
7fe7bd326f CMake: Fix cmake wrapper creation when cross-building
Change-Id: I363ee470973df89d16314671e3c33771040061f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-28 12:09:53 +00:00
Joerg Bornemann
fde98f7794 CMake: Fix rpath for Qt internal applications (non-bootstrapped tools)
We need to call qt_apply_rpaths for targets that are created with
qt_internal_add_app too. This is in line with what qt_app.prf does.

Task-number: QTBUG-85399
Change-Id: If5ffb05cca191c6cae9a330e1f4556d342a68ff8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-08-28 09:44:18 +00:00
Assam Boudjelthia
00a1e5da7e Android: add option to get app arguments with AndroidManifest.xml
AndroidManifest.xml file and the Android plugin already has a way
to provide commandline-arguments to app with the tag
"android.app.arguments". This change allow to set it from qmake/cmake
and allow Qt Creator to use that.

Task-number: QTCREATORBUG-23712
Change-Id: I3e680f40fd36ba6aaac7f344fb9509d2c3360e74
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-28 10:23:18 +03:00
Joerg Bornemann
de751066d6 CMake: Implement configure -force-asserts
Change-Id: Ife15b8d008c5b3f5eed61ec3bc048fda4c4b4e46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-27 22:13:43 +02:00
Fabian Kosmale
b0e4545a4b CMake: Install QtHeadersClean.cmake
For prefix builds we need to install the file.
Amends db21bad936.

Change-Id: Ia8e859dc048cc4bd74eb95ed0d2adce9c6b11902
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-27 22:13:40 +02:00
Kai Koehne
639c2e7f20 cmake: Fix generation of third-party attributes
Fix name of target so that qtattributionsscanner actually generates content.

Change-Id: Ie42067928d7cd1de02fa4ae92a0f5ef54bd54a5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-26 17:31:07 +02:00
Kai Koehne
f1b835e98f cmake: Fix building documentation on Windows
Make sure the executable path contains an .exe on Windows.

Change-Id: I972a3aaf1ad0510525ebfcc84e8c589f555c6d00
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-26 17:30:59 +02:00
Kai Koehne
146421ecaf headersclean: Check for all-W3 MSVC warnings
C4180, C4458 were disabled already in 2012, in commit 6668f5becf.
C4577 was disabled due to QtScript being compiled without exception
support in commit 97d7d80e73.

Anyhow, Qt Script is now officially gone in Qt 6, and Qt headers
do work just fine with C4180. Finally, C4458 is nowadays a W4 warning,
so not enabled in the first place.

Task-number: QTBUG-82615
Change-Id: I2f9b8e858817876b069a166129fbfac7ef3587a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-08-26 17:30:40 +02:00
Kai Koehne
db21bad936 Port headersclean check to CMake
Configure Qt with -DQT_FEATURE_headersclean=ON to enable the
check. There will be separate target for each module include
(e.g. QtCore_header_check), but the check will also be done
when the module is built for the first time.

There are notable differences to the qmake version:
- the build does not pick up anymore default defines or flags from
  the module, or Qt. Instead options like -fPIC they have to be listed
  explicitly. Also for this reason, we have to skip the vulkan-related
  headers from the check, since vulkan/vulkan.h is not necessarily
  in the compiler's default search path.
- some checks for nowadays unsupported compiler versions are
  removed.
- -Wdouble-promotion -Wshorten-64-to-32 is not added for clang
  builds; the qmake code path did never enforce that on CI
  machines (it was non-Apple clang only), and the check currently
  fails on these configurations.

Fixes: QTBUG-82615
Change-Id: I1cd303677b1472116910b6c27748f96436feb35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-25 21:13:08 +02:00
Samuli Piippo
3a4153766e CMake: use definitions when testing EGL
Use any definition from pkgconfig for the EGL compilation test.

Change-Id: I95c659b87ab7b0de81f000e3f52195161a493ef5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-25 08:04:39 +03:00
Joerg Bornemann
721812c5d2 CMake: Implement configure -gdb-index
Change-Id: Iea0fb99297751b1baf830a416ea5041d0b9a3b63
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:05:01 +02:00
Joerg Bornemann
97551b90b9 CMake: Actually evaluate AUTODETECT expressions in features
Very simple AUTODETECT expressions worked fine, but expressions with
parentheses, for example, were not correctly evaluated.

Change-Id: Ibec4fa55474e149a701f861838fdea41d31beca0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:04:51 +02:00
Joerg Bornemann
7e7c9ba455 CMake: Support configure tests of type 'linkerSupportsFlag'
Task-number: QTBUG-86155
Change-Id: I3764d99cd4ad1c432b499ec9ba7c4c48391fa421
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:04:46 +02:00
Joerg Bornemann
48cf015906 CMake: Implement configure -optimize-size
This configure switch controls the feature 'optimize_size'.

This isn't merely a mapping to CMAKE_BUILD_TYPE=MinSizeRel, because
we potentially want to combine -optimize-size with -force-debug-info,
which maps to CMAKE_BUILD_CONFIG=RelWithDebInfo.

Task-number: QTBUG-85373
Change-Id: I1a9343ebc54816f52e90e9d33ea3df4c99b1ec9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:04:42 +02:00
Joerg Bornemann
c8fda317ea CMake: Fix configure setting superfluous features
Command line options like -debug result in setting the variable
INPUT_debug. INPUT_debug is mapped to the CMake argument
-DCMAKE_BUILD_TYPE=Debug. INPUT_debug also matches the feature
'debug', and the CMake argument -DFEATURE_debug=ON was passed.

Do not pass -DFEATURE_xxx CMake arguments for inputs that are already
handled.

Change-Id: If096dff1c6dd694545c6f671f5f3512a43c3ec50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:04:38 +02:00
Joerg Bornemann
e66f5e491e CMake: Document more configure argument mappings
Change-Id: Icda71c14cde638e874cc2e6406527b9c98535165
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-23 11:04:32 +02: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
729d102b1c CMake: Implement configure -optimize-debug
Task-number: QTBUG-85373
Change-Id: I3aba1fcf96e36544dd75a5e6adc5f770a9a45726
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-20 17:07:53 +02:00
Joerg Bornemann
2f1a55c0b1 CMake: Implement configure -linker [bfd,gold,lld]
Fixes: QTBUG-86155
Change-Id: I5ba2d3b52d9ca240b48904c492f7902a056c0292
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-20 17:07:49 +02:00
Joerg Bornemann
df28355981 CMake: Support configure tests of type 'compilerSupportsFlag'
Task-number: QTBUG-86155
Change-Id: Iaa5c48b6508870a0f6afdf9df66cd2e634fe19b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-20 17:07:46 +02:00
Cristian Adam
c4d3e5d7d3 CMake Build: Use EGL library as dependency for GLESv2
On QNX the feature detection of GLESv2 is failing due to missing
symbols which are part of EGL library.

Add EGL library as a dependency if it's found on the system.

This allows OpenGL ES feature detection to work on QNX.

Task-number: QTBUG-83202
Change-Id: I90531d925fadce5d893ea9244793fc02a4595ed1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-20 14:41:49 +02:00
Cristian Adam
73277763c1 CMake Build: Add QNX 7.1 build support
This commit allows building Qt6's QtBase using QNX 7.1 and a toolchain
file which is almost identical to what CMake has in its documentation:
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-qnx

set(CMAKE_SYSTEM_NAME QNX)

set(arch gcc_ntoarmv7le)

set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER q++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})

set(CMAKE_SYSROOT $ENV{QNX_TARGET})

The only difference is the usage of q++ instead of QCC, which is no
longer present in QNX 7.1 SDK.

Task-number: QTBUG-83202
Change-Id: I51031540721275f2ee83cee9e7df4994a65db0e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-20 14:41:36 +02:00
Cristian Adam
12e4b63d28 CMake Build: Fix libdrm detection and compilation on QNX
On QNX 7.1 x86drm.h is located under <...>/usr/include/libdrm, unlike
linux where it's present under /usr/include.

find_path would not find it on QNX, and instead get /usr/include from
host, which resulted in a failure to compile.

Task-number: QTBUG-83202
Change-Id: I03d6c2d4dfbe91bb70df0a322e84890bd7c8548a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 18:43:37 +02:00
Alexandru Croitor
41800c3c31 CMake: Add /OPT:REF flag when building Qt on Windows
In qmake it's done for all qmake projects, in CMake we lean on the
safe side and apply it to building Qt itself. User CMake projects can
then choose to add it themselves.

Task-number: QTBUG-85992
Change-Id: I51919f947d43ffd9925e3d2837dcad17e480367d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-08-19 18:26:00 +02:00
Alexandru Croitor
cb1600145b CMake: Adjust compiler flag optimizations to qmake mkspec ones
There are inconsistencies in the default optimization flags added by
CMake across configurations like Release and RelWithDebInfo.
In particular Release uses -O3, whereas RelWithDebInfo uses -O2,
as well as usage of /INCREMENTAL in release configs with MSVC, etc.

To make sure that the Qt 6 binaries built with CMake are consistent
across configs, as well as consistent with the flags we used when
building Qt 5 with qmake, add a horrible search and replace mechanism
to replaces the CMake flags with what our mkspecs indicate to use.

Ideally this would be done by providing custom CMake toolchain files
for each platform we support, and we might revisit that later if the
need really arises.

To implement the replacing, we first need the flags that should be
added. Port the QMAKE_CFLAGS_OPTIMIZE variables to CMake, which is
done in QtCompilerOptimization.cmake.

Then a new function called
qt_internal_set_up_config_optimizations_like_in_qmake will look for
any kind of optimization flags set in the
CMAKE_<LANG>_FLAGS_<CONFIG> style variables, remove them, and add
the appropriate flags that qmake mkspecs provide.

On some platforms (like Windows MSVC) the function also alters the
linker CMAKE_${TYPE}_LINKER_FLAGS_<CONFIG> style variables.

The mechanism allows opting out of this replacing by
setting the QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS value.

It also allows opting into removal of flags for custom configs by
providing QT_ADDITIONAL_OPTIMIZATION_FLAG_CONFIGS. It's only removal,
because we wouldn't know what kind of config it is, and thus what
flags to add.

The currently modified configs are: Release, RelWithDebInfo,
MinSizeRel, Debug aka the usual default CMake provided ones.

The mechanism is only applied to C-like languages.
ASM is not handled to be on the safe side due to not knowing what kind
of compiler flags the platform assembler might take.
It's also important to skip RC on MSVC platforms.

Task-number: QTBUG-85992
Change-Id: I3712d5cd5a34fceab54f56a6fa46b4e678952362
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-19 18:25:59 +02:00
Cristian Adam
7e10dcb1d4 CMake Build: Add include guards for FindPPS.cmake and FindSlog2.cmake
The CMake configure process fails without include guards for these
two find modules on QNX.

Task-number: QTBUG-83202
Change-Id: I3cc589f98bc3b6b22c401421927ee6dab2663fb7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 12:46:10 +02:00
Cristian Adam
1b802c41eb CMake Build: Disable pkg-config for QNX
QNX doesn't come with pkg-config support.

Task-number: QTBUG-83202
Change-Id: I2ac0c014a071b83ef9a2d8114bae0e9ff9b3b422
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 12:46:10 +02:00
Kai Koehne
bfd4b958b5 CMake Port: Remove outdated information in README.md
Change-Id: Iefc1e13f5882ca69a2583f2454d00d9dfb42640d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 12:46:09 +02:00
Joerg Bornemann
5f729da74a CMake: Implement configure -qreal <type>
The configure argument -qreal <type> maps to the CMake argument
-DQT_COORD_TYPE=<type>.

Fixes: QTBUG-83325
Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 08:28:50 +02:00
Alexandru Croitor
f8af82e3b3 CMake: Fix usage of ccache when no executable was found
Change-Id: Ia9a44234cb074fa5ba2b1dc9ca22a676d1b2d4ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-18 10:40:26 +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
96dd73c5fe CMake: Fix typo in README about how to build Android for arm64
Task-number: QTBUG-85399
Change-Id: I764f5d5155d6548ca61d3217fb5bb10f5b15908f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-17 18:19:21 +02:00
Joerg Bornemann
f107713452 CMake: De-duplicate list input handling code in QtProcessConfigureArgs
Change-Id: I9fd77dd81f67fcc9a0306ab0d627257f209cdb08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 08:08:26 +02:00
Joerg Bornemann
584d4be174 CMake: Re-implement configure/qmake's command line handling in CMake
We extend configurejson2cmake to read the "commandline"
information from configure.json. This data is then translated to CMake function
calls and written it into commandline.cmake files.

We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake
files to feed our command line handling code, which is a
re-implementation of the command line handling in qt_configure.prf.

The command line handler sets INPUT_xxx variables, similar to
configure/qmake's config.input.xxx variables. The INPUT_xxx values are
translated
- to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature,
- to corresponding CMake variables if such a variable is known,
- or to -DINPUT_xxx=yyy CMake arguments.

Configure arguments that have an entry in
cmake/configure-cmake-mapping.md are actually implemented. Other
arguments are likely to need more work.

Task-number: QTBUG-85373
Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 08:08:20 +02:00
Alexandru Croitor
32121e9882 CMake: Split out some Android functions into a public API file
To fix CMake Qt For Android projects to configure, we need to move
some functions from a private CMake API file only, to a public one.

Add Qt6AndroidMacros.cmake which will be loaded by Qt6Core package.

We'll have to decide how we proceed with Qt5AndroidSupport.cmake,
because that file automatically runs code when included in Qt5, and we
usually don't want to do it.

We'll also have to decide how to handle the define_property() calls
that are still left in the private QtPlatformAndroid.cmake file.

With this fix, Qt example CMake projects that use
add_qt_gui_executable should now be buildable. An APK can be created
with 'ninja apk'.

Unfortunately Qt Creator 4.13 does not currently seem to support
opening and building CMake Qt For Android projects properly.
While the build succeeds after fiddling with the Kit settings, the APK
deploy step fails to run (at least on my machine).

So the simplest way to run the built APK is to open the android-build
dir with Android Studio and launch the example application from there.

Task-number: QTBUG-85399
Change-Id: I77f246331de7a6e9e6d4ba7d973730190138f136
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
c1038019fc CMake: Fix various issues with building CMake Android projects
Fix detection of qt android platform plugin by globbing inside
the install qt6 prefix location. This is just a sanity check.

Fix platform plugin detection for CMake standalone tests configured
using qt-cmake-standalone-test, which used to look into the fake
standalone prefix location instead of the real Qt location.

Fix detection of stdlib path using CMAKE_SYSROOT.

Add a global apk target that allows easier building of all apk targets
defined in the project. Creation of this target can be opted out by
setting QT_NO_GLOBAL_APK_TARGET to TRUE.

Amends b1f8ca8032.

Task-number: QTBUG-85399
Change-Id: Ic9c1646b4f00e0084fe3f4397df471b8f925afd8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
3b3029f959 CMake: Move QtPostProcess functions into QtPostProcessHelpers.cmake
The helpers can now be included manually in a project to call any
required function. There was a use case for that in qttools, which was
not possible because including QtPostProcess early would produce side
effects.

Task-number: QTBUG-86035
Change-Id: I05d5576bbac45d4b9e298b23aa2a33088d64968e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +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
Alexandru Croitor
57b94b58df CMake: Allow opting out of global target promotion
The endless saga of fighting with qt_find_package and global target
promotion. In certain scenarios we want to opt out of target promotion
to global scope.

One such case is in qttools with WrapLibClang and Threads::Threads.
Threads::Threads will be found in the top-level scope via
Qt6Dependencies.
WrapLibClang is declared in src/ directory scope, and
then we try to promote it ands its dependencies to the global scope,
via qt_find_package() ->
qt_find_package_promote_targets_to_global_scope().

This fails because we can't promote Threads::Threads due to it being
added in a different subdirectory scope.

Introduce 2 new functions.
qt_internal_should_not_promote_package_target_to_global and
qt_internal_disable_find_package_global_promotion.

The first one is used to disable promotion of targets to global scope
in qt_find_package.

To mark a target not to be promoted, the second function is used.
It will be used by qttools for the WrapLibClang case.

Task-number: QTBUG-85877
Change-Id: If6caf10a94999402026517a623ae29e3ab1eeb7f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-13 21:36:37 +02:00
Joerg Bornemann
8a0ca71c4a CMake: Extend configure-cmake-mapping.md
Change-Id: Ie54b131c9a7b0f560fa735562fc4cbae4df35a49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-13 20:07:54 +02:00
Alexandru Croitor
48dbcefe57 CMake: Allow specifying a sysconfdir that's outside the prefix
Also use the value to actually write it into qconfig.cpp so that qmake
reports the right information.

Change-Id: Icc4bf36b0dc6ad75d93ac16f39e5b361c0ce52b4
Fixes: QTBUG-81289
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-13 19:45:33 +02:00
Alexandru Croitor
9e044765ec CMake: Fix empty value of CMAKE_SIZEOF_VOID_P when looking for tools
Our initial approach to looking for host Qt tools when cross-compiling
to a platform with a different architecture bitness compared to the
host one was to unset CMAKE_SIZEOF_VOID_P before calling
find_package(Qt6FooTools) and then restoring the value.

That works to bypass the architecture bitness test in the
ConfigVersion files, but it also influences the paths that
find_package() searches in, specifically the lib<arch> paths like
/usr/lib64 will not be searched in.

Fortunately since CMake 3.14, write_basic_package_version_file() can
take an additional ARCH_INDEPENDENT parameter. This disables the
architecture bitness test when looking for the package, while allowing
to still search in the /usr/lib64 like paths.

Use it when creating the QtFooToolConfigVersion.cmake files.

One could argue we should actually check if the tool executables could
run on the host system where find_package is called for
cross-compilation.
We could do that in another change if the problem ever arises.

Amends 03aa74e40d
Amends 914b367c7f

Change-Id: I1181ff637ac80064a6a8538170b28a41743fc90c
Fixes: QTBUG-81672
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-13 19:45:29 +02:00
Joerg Bornemann
fdd61b3a7b CMake: Introduce QtFeatureCommon.cmake
This file provides common feature-functionality is supposed to be
included by QtFeature.cmake and QtProcessConfigureArgs.cmake.

Change-Id: Ifb483c2a9c4014d240c2a4d6ff07b5c0ceee9c3a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-13 19:31:59 +02:00
Joerg Bornemann
fb8aea60bd CMake: Write QMAKE_MACOSX_DEPLOYMENT_TARGET to qconfig.pri
If the user specified CMAKE_OSX_DEPLOYMENT_TARGET=10.15 for the Qt
build then building projects with qmake failed, because the mkspec
hard-codes QMAKE_MACOSX_DEPLOYMENT_TARGET to 10.14.

We now write QMAKE_MACOSX_DEPLOYMENT_TARGET to qconfig.pri to override
the mkspecs' default.

Fixes: QTBUG-85923
Change-Id: I6a39cfe047ac0f99e1da0ca0728d63c741bd4fed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-13 19:31:59 +02:00
Joerg Bornemann
edc8c1ee9d CMake: Add missing newline at the end of qconfig.pri
Change-Id: I929d74234b685bf0684d3067f7f958d474df20ff
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-13 19:31:59 +02:00
Kai Koehne
ff6a3a80dd cmake: Suggest qt-cmake-private script for building other Qt modules
This automatically sets the CMake Generator to be the same as the one
used for qtbase.

Change-Id: If9e1a6942520417393055c572f0d892efca43d2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-12 16:37:51 +02:00
Alexandru Croitor
52fdb9dc93 CMake: Fix Threads::Threads dependency handling with CMake < 3.18
Apparently CMake encods targets from different scopes with a different
encoding scheme for earlier CMake versions.

CMake 3.16.3: Threads::Threads::@<0x5604cb3f6b50>
CMake 3.18.0: ::@(0x5604cb3f6b50);Threads::Threads;::@

Handle the earlier version approach as well. It needs to be done both
when writing out 3rd party dependencies, as well as for lib prl files.
Possibly in more places as well, but I didn't detect additional
places yet.

Amends 92ee9bd6b8

Task-number: QTBUG-85801
Task-number: QTBUG-85877
Change-Id: Ib348b51b2d623fb50d9080dba2beeb931d47a69c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-12 16:29:35 +02:00
Richard Moe Gustavsen
1d4457da13 cmake, README: clearify the usage of '-' in feature names
It's not immediately obvious that you need to use
all underscores for the feature name, so add a
line that explaines it.

Change-Id: I508eaf909c808fb0a93442f6e71428c18559b965
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-12 14:51:18 +02:00