From e2b4a3675188916298084f69f9f342ecbb707f6e Mon Sep 17 00:00:00 2001 From: Toby Bell Date: Thu, 25 Feb 2021 09:51:03 -0700 Subject: [PATCH] Silence warning for policy CMP0042 CMake policy CMP0042 affects whether @rpath is used in the install path for dynamic libraries on macOS. It was introduced in CMake 3.0. If the policy is not explicitly set, CMake uses OLD behavior and emits a warning. This commit explicitly sets NEW behavior in order to silence the warning and adopt the preferred behavior by CMake. This uses @rpath instead of @loader_path in install names. Documentation for policy CMP0042: https://cmake.org/cmake/help/latest/policy/CMP0042.html --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index af80c65..d48ba5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,10 @@ else() set(USE_NAMESPACED_LIB NO) endif() +if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) +endif() + if(POLICY CMP0072) set(OpenGL_GL_PREFERENCE GLVND) endif()