Properties specified in EXPORT_PROPERTIES have their values exported
verbatim, without evaluating generator expression they might contain.
This limitation is removed by the introduced functions. They collect
properties that needs to be exported and evaluate generator
expressions inside the properties using file(GENERATE) before
exporting them. The functions generate the ExtraProperties.cmake
file that contains set_property calls with exported properties
and corresponding values.
Change-Id: If32c30a82a62e8bd48bb91f3df21ff2ad8d07243
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The tracepointgen tool needs to know the enumeration/flag names
and values in order to generate metadata for the tracepoints
in order to pass this information when tracing.
Currently the metadata needs to be provided to the tracepointgen by
hand. This implements metadata parsing from header files.
Task-number: QTBUG-110598
Pick-to: 6.5
Change-Id: Ibb2cc6e724fd2defca4e301af2285b0fdbe8e7f7
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
- The following commands accepts NO_UNITY_BUILD, and
NO_UNITY_BUILD_SOURCES arguments to opt out of the unity build, and
to exclude some source files from unity build, respectively.
- qt_internal_add_executable
- qt_internal_add_module
- qt_internal_add_plugin
- qt_internal_add_tool
- qt_internal_extend_target
- qt_internal_add_common_qt_library_helper
- qt_internal_add_cmake_library
- qt_internal_add_simd_part
- Unity build is disabled by default in these:
- qt_internal_add_test
- qt_internal_add_test_helper
- qt_internal_add_benchmark
- qt_internal_add_3rdparty_library
- qt_update_ignore_pch_source also excludes the files from unity_build
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I5d0e7df633738310a015142a6c73fbb78b6c3467
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The extra quote enforces the arguments to be string, and stops the
COMMAND_EXPAND_LISTS within
QtDbusHelpers.cmake::qt_create_qdbusxml2cpp_command from expanding it
as a list.
Fixes: QTBUG-110459
Fixes: QTBUG-110450
Task-number: QTBUG-99238
Change-Id: Ifddd6570c7bf8f2d1757f275d9445ce2924a93f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The batcher does not currently work properly with non-qtbase
submodules. Disable them temporarily so that at least the
tests in qtbase are batched. Do this from qtbase so that changes
to each and every submodule are not necessary.
Also, maintain a list of tests that were thus skipped. On any
qt cmake internal function call that refers to such a target,
identify the target as skipped and make the call a no-op.
Fixes: QTBUG-109785
Change-Id: Ib0aa5d39eee8315ffd4ac62f6d1f44fe9bbf7a2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
AUTOUIC doesn't handle relative paths to .ui files in parent
directories when using Ninja Multi-Config.
The designer tool in qttools has such a ui file. This leads to the
following error when trying to build qttools together with examples as
ExternalProjects and Ninja Multi-Config:
ninja: error: 'src/designer/src/designer/designer_autogen/
include_Debug/ui_preferencesdialog.h', needed by
'src/designer/src/designer/designer_autogen:Debug',
missing and no known rule to make it
Until cmake is fixed, we can work around the issue by not adding
designer as a dependency when building EP examples, because no example
tries to use the app.
We can't exclude all apps from example dependencies because some
modules use qt_internal_add_app for tools as well, which are called
from public CMake API and also examples.
An example of this is qtapplicationmanager.
Given that we can't exclude all apps, introduce a function to
allow skipping single targets when building EP examples.
This will allow excluding designer specifically.
The examples will now depend on a new ${repo}_src_for_examples target
rather than ${repo}_src, which will exclude skipped targets.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-110369
Change-Id: I2f900253bbf7bac917f2293ef604ab3ea8f298e1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This replaces the qt_parse_all_arguments macro with the built-in
`cmake_parse_arguments(PARSE_ARGV`. In addition, a new function,
_qt_internal_validate_all_args_are_parsed, can be used to check whether
any _UNPARSED_ARGUMENTS have been passed to the function.
Fixes: QTBUG-99238
Change-Id: I8cee83dc92dc6acdaaf747ea6ff9084c11dc649b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Stub targets introduced in 65b7aacb make the old batch target detecting
measure in qt_internal_extend_target,
qt_internal_undefine_global_definition, qt_internal_add_resource
obsolete, since now the targets actually exist in the build system.
Unconditionally fail if the target does not exist and if it does, query
for its inclusion in the batch
Change-Id: I1cd1d8cc7fbf4bdbd2289a1b38ecbea1e93a06c8
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
In developer builds we don't install tools, so syncqt executable is
located in its RUNTIME_OUTPUT_DIRECTORY but not by install path. This
works fine in general case, but in multi-config builds the
RUNTIME_OUTPUT_DIRECTORY path doesn't match the install path. So syncqt
target points to wrong location in this case. It makes sense to use the
existing IMPORTED_LOCATION of syncqt executable directly if Qt is not
supposed to be installed. Also check if the syncqt executable exists at
the expected location before creating the imported target.
Pick-to: 6.5
Fixes: QTBUG-109864
Change-Id: I0de647b2a73169a0d48bd88edeb7ff00975fa774
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Implement platform independent tracing backend in Common trace format.
This allows tracing in platforms without own/existing backend and
analysing all platforms with the same tooling. The backend is the basis
for further work in application level profiling area.
The backend is implemented as a plugin that is loaded immediately when
the application starts in order to process all trace events. The backend
avoids using Qt classes so that it doesn't generate trace events
itself. Adds plumbing to configure the new backend.
Modifies the tracegen and tracepointgen tools to support the new
backend.
Task-number: QTBUG-106399
Pick-to: 6.5
Change-Id: I80711be52d4d48e1acbc72edffbdf3f379fce52a
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Allows automatically generating tracepoint files by scanning source
files for instrumentation macros.
This makes it easier to add tracepoint support to modules and also
ensures that the tracepoint files do not get out of sync with the
functions they are tracing.
Q_TRACE_INSTRUMENT generates entry/exit tracespoints for a function
it is set. Q_TRACE_PARAM_REPLACE is used to change a function parameter
for these functions to convert it to supported parameter type.
Q_TRACE_POINT can be used to create a standalone tracepoint.
Q_TRACE_PREFIX can be used to add prefix for generated tracing backend
for example to add includes for types used in the trace points..
Task-number: QTBUG-107238
Pick-to: 6.5
Change-Id: Ib395b80838434ceb72683dac0545ca20c4d09455
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
The new version uses PARSE_ARGV which deals with semicolons better.
Task-number: QTBUG-99238
Change-Id: Ie9276219400326a67ffa9cf5fc456ae7de0bbcd2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The argument allows to ignore the condition for source files if they
are used in the Qt code without corresponding guards. The header files
of this kind usually have internal guards, that suppress the error
at the location where they are used, so AUTOGEN is skipped for these
header files to suppress the warnings from CMake. If file belongs to
a module, it will display AUTHOR_WARNING which should urge Qt
maintainers to guard the use of the source file properly.
Task-number: QTBUG-103196
Change-Id: I7b4c12031a5d19ff15868d4782c0d396ef7aed8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This allows one to add an extra set of directories to the build, but let
the compiler know that they are system paths (that is, the compiler
should refrain from emitting warnings in code found there). This extends
INCLUDE_DIRECTORIES and is by necessity a private include set.
Will be used by qtquick3dphysics, due to its PhysX dependency.
Change-Id: I76216ced393445a4ae2dfffd1729c556db0cce3d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Process the regular SOURCES and DBus sources the same way in
the qt_internal_extend_target call. Previously the specified
COMPILE_FLAGS had no effect on DBus sources.
[ChangeLog][General] The internal DBus source files that are
generated, now are compiled with the same set of compilation
flags and options as other source files of the Qt module.
Change-Id: I9bdeb8f45c6af1b0cb0235425b0ff7efcb952d59
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extract function arguments to the corresponding variables and use
variables when parsing arguments. Remove whitespace between if keyword
and parentheses. Adjust size of code lines. Document function-specific
arguments.
Change-Id: I1c77fbf268618a844726683768575aff05894c70
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qt_internal_add_configure_time_executable compiles the executable
at configure time and exposes it to the CMake source tree. This is
useful when need to run a small C++ program at configure time.
Task-number: QTBUG-87480
Change-Id: I031efe797c8afa0721d75b46d4f36f67276bf46e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This implements the build system bits required to build Qt
as as separate wasm modules a.k.a Emscripten side modules.
Enable by configuring with the "-shared" flag.
This is the first step towards shared library support and gets
us as far as being able to load QtCore and instantiate a
QCoreApplication.
Task-number: QTBUG-63925
Change-Id: Ib8f07f80fb5b13c8dbba65c7db735dc557b70d0e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The batch test target name is a useful thing to obtain in various
target-generating scripts.
Change-Id: I9605cf860fe1485e48108eba7e93f9064209d8fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
An approach of test batching (joining multiple tests into a single
binary) has been taken, due to long linking times/binary size on certain
platforms, including WASM. This change adds a new feature
'batch_test_support' in Qt testlib. Based on the value of the feature,
test batching may become enabled with the -batch-tests switch.
Batching works for every target added via qt_internal_add_test. When
first such target is being processed, a new combined target for all of
the future test sources is created under the name of 'test_batch'.
CMake attempts to merge the parameters of each of the tests, and some
basic checks are run for parameter differences that are impossible to
reconcile.
On the C++ level, convenience macros instantiating the tests are
redefined when batch_tests is on. The new, changed behavior triggered
by the changes in the macros registers the tests in a central test
registry, where they are available for execution based solely on their
test name. The test name is interoperable with the names CMake is aware
of, so CTest is able to run the tests one by one in the combined binary.
Task-number: QTBUG-105273
Change-Id: I2b6071d58be16979bd967eab2d405249f5a4e658
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Add source files to the _qt_internal_target_sources property, when
running qt_internal_extend_target on interface libraries instead of
ignoring sources for CMake versions that don't support non-interface
properties. The property is not full-functional, but still allows to
execute internal routines on target sources.
Also add qt_internal_get_target_sources_property function that helps
to destinguish which property stores target sources.
Task-number: QTBUG-103196
Change-Id: I435c558090a24a7988f1a1c49f924dc195e72480
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The current qt_internal_extend_target interface expects that the caller
will pass the HEADER_MODULE argument on each call. This is not correct,
since the argument doesn't affect the target internals, but only help to
decide how to modify the target according to its type. The target type
meanwhile can be always read from target properties. So this solution is
more consistent.
Change-Id: Ie84a2226ceb71cb5272670e5d43bdfc7a101360a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Output names of static libraries might be different from target names.
For example, the library name of Qt6::DeviceDiscoverySupportPrivate is
"Qt6DeviceDiscoverySupport.lib", and the library name of
Qt6::QTlsBackendCertOnlyPlugin is "qcertonlybackend.lib".
This commit make pdb files names consistent with the library names.
And make sure we have set correct OUTPUT_NAME property before calling
qt_set_common_target_properties()/qt_internal_set_compile_pdb_names().
Change-Id: Idb3cacd7a46a4f298fd584b927b5d726956faea8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This introduces a new helper function,
qt_internal_add_repo_local_defines and makes use of it in
qt_internal_add_{module,test,executable,benchmark,plugin}. That function
checks whether QT_EXTRA_INTERNAL_TARGET_DEFINES is set. If it is, the
defines listed in there will be aded to all targets passed to the
functions mentioned above.
The intended usage is that QT_EXTRA_INTERNAL_TARGET_DEFINES gets set
in the repository local .cmake.conf. This allows e.g. opting in to
source incompatible changes in leaf modules (as long as those are
guarded by some define).
Pick-to: 6.2 6.3
Fixes: QTBUG-101640
Change-Id: I06c3693ee69f46e95a48de724621f0c97e7cc3a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qt_internal_undefine_global_definition disables an internal global
definition that is defined by the qt_internal_add_global_definition
function for a specific target.
Remove the ability to set the custom "undefine" flag for the
definitions since it's hard to control it using the introduced
function.
Pick-to: 6.2 6.3
Task-number: QTBUG-100334
Change-Id: Ic1637d97aa51bbdd06c5b191c57a941aa208d4dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The generated dbus headers would not appear in IDE source lists
because of incorrectly named variables.
Pick-to: 6.2 6.3
Change-Id: I276d4284eb94b98cc75f791de62ca332ad947004
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
CMake versions less than 3.19 don't support adding the source files to
the PRIVATE scope of the INTERFACE libraries. It looks like these
PRIVATE sources are only used by IDEs to display them in a project
tree. Skip them to avoid configuring issues.
Fixes: QTBUG-99316
Pick-to: 6.3
Change-Id: Id03f540ac9c94e920adfae5de4f364bd7aba4613
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Building against a static debug MSVC Qt produced LNK4099 warnings (PDB
was not found with object file).
This was because we did not install the .pdb files for the object
libraries that are created for Qt resources. Now, these .pdb files are
named like the object library targets and are installed next to the
object files.
Pick-to: 6.2
Fixes: QTBUG-97699
Change-Id: I7e23f8392b7ac657be1d2fb3b33e051ae2e4d407
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
PRIVATE_MODULE_INTERFACE libraries are linked as interface libraries to
the module's Private target and exported as the dependencies of package
targets. We need to register these modules as public package dependencies
to call find_package when resolving module dependencies in user
projects.
Pick-to: 6.2
Fixes: QTBUG-96558
Change-Id: I4eef550aab306eaf357539ef7a0f76d69873f856
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We don't have any APSPI2 includes in our public headers and should
therefore not export the target that provides ATSPI2 include paths for
consumers.
Link against PkgConfig::ATSPI2 instead of the _nolink target.
The former will not be exported.
Pick-to: 6.2
Fixes: QTBUG-97023
Change-Id: I4b12e0c2230917feeb963c02565e6db24f757bd3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Warn if the PRIVATE_MODULE_INTERFACE option is provided a value, but
there is no ${target}Private target to set the interface dependencies
on.
Pick-to: 6.2
Task-number: QTBUG-95921
Change-Id: I7d4df9cb3aa9b7746d836b82019ecdd9c8f50fdc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To detect the internal module ouside the qt_internal_add_module
function need to mark it with the property.
This adds _qt_is_internal_module property to the Qt internal modules.
Since PRIVATE_MODULE_INTERFACE only was applicable to pure Private
modules, INTERNAL_MODULEs is missing those dependencies if they were
specified. Add extra condition to qt_internal_extend_target to link
PRIVATE_MODULE_INTERFACE libraries to internal modules as well.
Pick-to: 6.2 6.1
Change-Id: I9c32fa5bad3aff365f5d7663349e5365d5f1d72d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Do not add catch-all header files like QtCore, QtGui, etc. to
precompiled headers for targets that already define their own set of
precompiled header files.
This reduces the size of the precompiled headers and brings the pch file
sizes down into the region of the qmake build.
Pick-to: 6.2
Task-number: QTBUG-89122
Change-Id: I8e4d17aa6829c7d7b1aa01a01a61b6677e22c460
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The intention is to remove TYPE as a keyword completely before 6.2.0
release, but in case if that's not possible due to the large amount
of repositories and examples, just print a deprecation warning for
now and handle both TYPE and PLUGIN_TYPE.
Task-number: QTBUG-95170
Pick-to: 6.2
Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If Vulkan headers are present on the system when qtbase is configured,
QtGui and QtOpenGL should be compiled with Vulkan support.
If a user project uses a Qt built with Vulkan support, but their system
is missing Vulkan headers, the project configuration needs to succeed.
The project will get compilation errors if it uses Vulkan headers, but
that's intended.
This use case was broken when fixing Vulkan to be found when building
Qt for Android.
Fix the regression with a combination of things
1) Mark the WrapVulkanHeaders package as optional (already the case)
2) Use the include directories directly when compiling Gui and OpenGL
3) Propagate WrapVulkanHeaders::WrapVulkanHeaders link requirement to
consumers only if the target exists. It won't exist if Vulkan
include dirs are not found
This also requires some changes in pri and prl file generation.
For prl file generation, we don't want to link to the
WrapVulkanHeaders target, so we filter out all dependencies that
use TARGET_NAME_IF_EXISTS for anything that calls
__qt_internal_walk_libs which includes qt_collect_libs.
For pri files, we make sure to generate a uses=vulkan/nolink clause
by inspecting a new _qt_is_nolink_target property on the target.
We also don't add include dirs to the pri file if the new
_qt_skip_include_dir_for_pri property is set.
This is intended for Vulkan, because there is separate qmake logic to
try and find the include dirs when configuring a user project.
As a drive-by, fix nolink handling for WrapOpenSSLHeaders.
Amends bb25536a3d
Amends 7b9904849f
Pick-to: 6.2
Fixes: QTBUG-95391
Change-Id: I21e2f4be5c386f9e40033e4691f4786a91ba0e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All internal libraries, plugins, object libraries (resources, plugin
initializers) need to be built with bitcode flags when targeting iOS.
Internal here means all libraries added by qt_internal_add_X
functions or associated with internal libraries.
We didn't do that for plugin initializers, which were added not too
long ago.
Extract the logic that links to Qt::PlatformModuleInternal into a
separate function to be used for object libraries.
Use it for resources and plugin initializers. It will also be used
in qtdeclarative for qml plugin initializers.
Pick-to: 6.2
Task-number: QTBUG-95208
Change-Id: I366996078f5e9d1c2d2797f6b81c522ee99529e3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Both the compiler and linker -fapplication-extension flag should only
be applied when building Qt's libraries (not executables).
It's up to the user project whether their code will be restricted with
application-extension-only APIs.
In qmake that can be achieved by adding to the qmake project
CONFIG += app_extension_api_only
In CMake it can be achieved by either adding the compiler and link flags
in the project directly (using target_X_options) or by setting the
appropriate setting in the Xcode project when using the Xcode
generator.
Amends e189126f1a
Pick-to: 6.2
Task-number: QTBUG-95199
Change-Id: Ie7a764d460a89c7650391abff0fcc5abfcabef64
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The correct variable to check is WIN32, not WINDOWS.
Amends 85e25d93b3
Pick-to: 6.2
Change-Id: I4570eb5a124bcaa0bd38135dd7c7f48345c40c9d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If Qt was configured with -static-runtime which implies MultiThreaded
-MT flag, the plugin initializer object libraries were still compiled
with the default -MD flag.
When an application linked to Qt, that caused linking to fail with
mismatched symbol errors between the application symbols and the
plugin initializer object library symbols.
Make sure to set the MSVC_RUNTIME_LIBRARY property on both plugin
initializer and resource object libraries, depending on the value of
QT_FEATURE_static_runtime.
We did set the property for resources added by
qt_internal_add_resource, but not for the resource created by
the public qt6_add_resources counterpart.
Pick-to: 6.2
Fixes: QTBUG-95043
Change-Id: Ia543cd0241db94a12080be2655ad420fe9ad3f24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In a -debug-and-release build, apps were placed under bin/Release
rather than just bin.
Apply the logic we use for tools for apps as well. Rename and move
the common functions into QtTargetHelpers.cmake.
Pick-to: 6.2
Fixes: QTBUG-95028
Change-Id: I5a9082ea50c9238c8fcf0c6dd099708fbc571bf8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In our *AdditionalTargetInfo.cmake we now set above target properties
for shared libs only, not executables.
IMPORTED_IMPLIB is only set for Windows.
IMPORTED_SONAME is only set for non-Windows platforms.
Pick-to: 6.2
Change-Id: If7f01e6bf5183cca0ac90f9afffd57c41b34dccd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Building a CMake project with CMAKE_BUILD_CONFIG=Debug was broken for
non-prefix debug-and-release builds of Qt.
In debug-and-release builds we set EXCLUDE_FROM_ALL on tools in the
Debug configuration. In non-prefix builds we export(EXPORT) targets, and
that also contains the non-existent Debug variants of the tools. In
prefix builds, we install(EXPORT) instead, which only exports what is
built and installed.
Consequently, we now remove the DEBUG-related import information if the
debug variant if the target binary does not exist.
Pick-to: 6.2
Fixes: QTBUG-95027
Change-Id: I37766d5ab1e2795bcb91a348e7e72150e8a00f82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
CMake 3.21 introduced a new IMPORTED_TARGETS directory property which
we can use to promote all imported targets within a scope to be
global.
This would cover transitive non-Qt imported targets which the Qt build
system does not know about and is thus a more complete solution
compared to promoting only Qt targets.
Run a finalizer at the end of the directory scope where
find_package(Qt6) is called to promote all imported targets within
that scope to global (when requested).
The old promotion method is disabled when the CMake version is new
enough.
Pick-to: 6.2
Task-number: QTBUG-92878
Task-number: QTBUG-94528
Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>