From e584a00e9ab98e9ff78d8a6083cc5aad5532baca Mon Sep 17 00:00:00 2001 From: "romain.biessy" Date: Thu, 12 Dec 2024 10:26:01 +0000 Subject: [PATCH] [cmake] Only set deprecated property when supported --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e844968d..82dae704b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,7 +44,9 @@ function(add_deprecated_library target_name) # The INTERFACE IMPORTED target works like an alias which can have different properties add_library(deprecated_name INTERFACE IMPORTED) target_link_libraries(deprecated_name INTERFACE target_name) - set_target_properties(deprecated_name PROPERTIES DEPRECATION "${deprecated_name} target is deprecated, please use ${target_name} instead") + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.1") + set_target_properties(deprecated_name PROPERTIES DEPRECATION "${deprecated_name} target is deprecated, please use ${target_name} instead") + endif() endfunction()