From 6ab7660e0ca253fa6ecfe13e3db4bd2708883030 Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Sun, 3 Apr 2022 20:00:41 +0300 Subject: [PATCH] [cmake] Don't mix plain & keyword target_link_libraries() Closes: #1357 --- CMakeLists.txt | 5 +++++ src/celestia/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12d5feb08..1ef46ad33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.8) option(LEGACY_OPENGL_LIBS "Use legacy OpenGL libraries instead of glvnd library (Default: off)" OFF) +# Plain and keyword target_link_libraries() signatures cannot be mixed +if (POLICY CMP0023) + cmake_policy(SET CMP0023 NEW) +endif() + # Honor link flags in try_compile() if (POLICY CMP0056) cmake_policy(SET CMP0056 NEW) diff --git a/src/celestia/CMakeLists.txt b/src/celestia/CMakeLists.txt index ddf9884d0..0e1d73cec 100644 --- a/src/celestia/CMakeLists.txt +++ b/src/celestia/CMakeLists.txt @@ -81,7 +81,7 @@ if(ENABLE_FFMPEG) endif() if (HAVE_MESHOPTIMIZER) - target_link_libraries(celestia PRIVATE meshoptimizer::meshoptimizer) + target_link_libraries(celestia meshoptimizer::meshoptimizer) endif() install(TARGETS celestia LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP)