From dd088c8ba501e4582aee1f9319a644a3298b1686 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Sat, 14 Mar 2020 15:17:48 -0300 Subject: [PATCH] cmake compatibility fix --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 373d08b..246c22e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,11 @@ if(NOT SODIUM_LIBRARIES) pkg_search_module(SODIUM REQUIRED libsodium) endif() -# allow adding links to non-local targets (which is allowed even under old policy as long as the -# target is an interface, but under new cmake it spews out warnings). -cmake_policy(SET CMP0079 NEW) +if(NOT ${CMAKE_VERSION} VERSION_LESS 3.13) + # allow adding links to non-local targets (which is allowed even under old policy as long as the + # target is an interface, but under new cmake it spews out warnings). + cmake_policy(SET CMP0079 NEW) +endif() function(link_dep_libs target linktype libdirs) foreach(lib ${ARGN})