Skip to content

Commit

Permalink
cmake: Only set deprecated property when supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Dec 12, 2024
1 parent 40b7e0a commit 20d671e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit 20d671e

Please sign in to comment.