From 44c0d53b322ba0355a34e7ba322db3598db6242e Mon Sep 17 00:00:00 2001 From: Romain Biessy Date: Thu, 9 Jan 2025 18:12:04 +0100 Subject: [PATCH] cmake: Only set deprecated property when supported (#621) --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f9fa22c02..c3e21c97a 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()