Fix build of multiple apks in a single project tree

ExternalProject_Add_Step adds the step timestamp file as the
dependency to a '-complete' file generated by add_custom_command
that is run inside the ExternalProject_Add function. Since the
'-complete' file path is computed using CMAKE_CURRENT_BINARY_DIR
we run into the issue if ExternalProject_Add and
ExternalProject_Add_Step are run from the different source
directories and have the different default binary directories as
well. This change suppresses the behavior by adding the
'EXCLUDE_FROM_MAIN TRUE' flag. We may do this since the target
related to the step is added to the dependency chain of executable
target and the chain of external project is not used for now.

Pick-to: 6.3
Change-Id: I7203261b61cfa56bcd9e49ac3e8d7ecb217a5a6c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2021-12-29 16:30:47 +01:00
parent 2cb50b9fef
commit d62463305d

View File

@ -900,7 +900,6 @@ function(_qt_internal_configure_android_multiabi_target target)
"-DQT_INTERNAL_ANDROID_MULTI_ABI_BINARY_DIR=${CMAKE_BINARY_DIR}"
"${config_arg}"
EXCLUDE_FROM_ALL TRUE
STETPS_TARGETS
BUILD_COMMAND "" # avoid top-level build of external project
)
set_property(GLOBAL APPEND PROPERTY
@ -912,6 +911,7 @@ function(_qt_internal_configure_android_multiabi_target target)
# TODO: Remove this when the step will depend on DEPFILE generated by
# androiddeployqt for the ${target}.
ALWAYS TRUE
EXCLUDE_FROM_MAIN TRUE
COMMAND "${CMAKE_COMMAND}"
"--build" "${android_abi_build_dir}"
"--config" "$<CONFIG>"