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

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>
(cherry picked from commit b404d8e36193d75fb9d837489bec847e480d24f7)
(cherry picked from commit a6c0f17038743e6613b5e2984c65d04e58a89c96)
This commit is contained in:
Alexandru Croitor 2024-02-14 14:48:33 +01:00 committed by Qt Cherry-pick Bot
parent a430edf1d8
commit fc24040962

View File

@ -576,7 +576,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()