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.5 6.6 6.7
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>
This commit is contained in:
Alexandru Croitor 2024-02-14 14:48:33 +01:00
parent 5b993fa8ed
commit b3cc89e81c

View File

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