CMake: Fix AUTORCC_OPTIONS INTERFACE_LIBRARY error with CMake 3.16

Make sure not to set the AUTORCC_OPTIONS property on INTERFACE_LIBRARY
targets, because it's not allowed with CMake versions lower than 3.18.

Amends 329dbfcc78d067d26b5a4dd99f4284900fd68f2c

Pick-to: 6.6 6.5
Fixes: QTBUG-122266
Task-number: QTBUG-106466
Task-number: QTBUG-101353
Task-number: QTBUG-121948
Change-Id: I9ab606c0b11e2b4f8689e0bde9c001f59c81fa42
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b3cc89e81c149533e279df2442a79cc1dfce9ec5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-02-14 14:48:33 +01:00 committed by Qt Cherry-pick Bot
parent 2832ad2f9d
commit b404d8e361

View File

@ -602,7 +602,10 @@ function(_qt_internal_disable_autorcc_zstd_when_not_supported target)
AND DEFINED QT_FEATURE_zstd
AND NOT QT_FEATURE_zstd
AND NOT QT_NO_AUTORCC_ZSTD)
set_property(TARGET "${target}" APPEND PROPERTY AUTORCC_OPTIONS "--no-zstd")
get_target_property(target_type ${target} TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
set_property(TARGET "${target}" APPEND PROPERTY AUTORCC_OPTIONS "--no-zstd")
endif()
endif()
endfunction()