Skip to content

Commit

Permalink
cmake: Only set deprecated property when supported (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy authored Jan 9, 2025
1 parent 6b42d46 commit 44c0d53
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.1")
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 44c0d53

Please sign in to comment.