From 00f9a131d8bc8c4e0055b09383d366342bcef78d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 3 Jan 2024 09:14:55 +0100 Subject: [PATCH] Fix for old CMake versions --- cmake/Modules/RemoveDuplicates.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/RemoveDuplicates.cmake b/cmake/Modules/RemoveDuplicates.cmake index 94b12b0fb..446dedbae 100644 --- a/cmake/Modules/RemoveDuplicates.cmake +++ b/cmake/Modules/RemoveDuplicates.cmake @@ -14,7 +14,9 @@ endif() set(__INCLUDED_REMOVE_DUPLICATE_LINKED_LIBRARIES_MODULE TRUE) function(remove_duplicate_linked_libraries target_name) - get_target_property(LINK_LIBRARIES ${target_name} LINK_LIBRARIES) - list(REMOVE_DUPLICATES LINK_LIBRARIES) - set_target_properties(${target_name} PROPERTIES LINK_LIBRARIES "${LINK_LIBRARIES}") + if(CMAKE_VERSION VERSION_GREATER 3.5) + get_target_property(LINK_LIBRARIES ${target_name} LINK_LIBRARIES) + list(REMOVE_DUPLICATES LINK_LIBRARIES) + set_target_properties(${target_name} PROPERTIES LINK_LIBRARIES "${LINK_LIBRARIES}") + endif() endfunction() \ No newline at end of file