Skip to content

Commit 44c0d53

Browse files
authored
cmake: Only set deprecated property when supported (uxlfoundation#621)
1 parent 6b42d46 commit 44c0d53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ function(add_deprecated_library target_name)
4444
# The INTERFACE IMPORTED target works like an alias which can have different properties
4545
add_library(deprecated_name INTERFACE IMPORTED)
4646
target_link_libraries(deprecated_name INTERFACE target_name)
47-
set_target_properties(deprecated_name PROPERTIES DEPRECATION "${deprecated_name} target is deprecated, please use ${target_name} instead")
47+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.1")
48+
set_target_properties(deprecated_name PROPERTIES DEPRECATION "${deprecated_name} target is deprecated, please use ${target_name} instead")
49+
endif()
4850
endfunction()
4951

5052

0 commit comments

Comments
 (0)