diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f8e7b1eb271b2..d343de836e528 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -23,6 +23,13 @@ message(STATUS "Building using CMake version: ${CMAKE_VERSION}") # Compiler id for Apple Clang is now AppleClang. cmake_policy(SET CMP0025 NEW) +# https://cmake.org/cmake/help/latest/policy/CMP0042.html +# +# Enable MACOSX_RPATH by default. @rpath in a target's install name is +# a more flexible and powerful mechanism than @executable_path or +# @loader_path for locating shared libraries. +cmake_policy(SET CMP0042 NEW) + # https://www.cmake.org/cmake/help/latest/policy/CMP0054.html # # Only interpret if() arguments as variables or keywords when unquoted.