From 20d671e3eb3270f0d6a202794224555d7b15c551 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..72b71e4dd 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") + set_target_properties(deprecated_name PROPERTIES DEPRECATION "${deprecated_name} target is deprecated, please use ${target_name} instead") + endif() endfunction()