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
This commit is contained in:
Toby Bell 2021-02-25 09:51:03 -07:00
parent 547fc11b29
commit e2b4a36751

View File

@ -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()