From a4845fa12dba53245fb6299169c0ad083fd0a251 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 4 Aug 2024 23:38:22 +0200 Subject: [PATCH] set MACOSX_RPATH to true on Apple --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75e6b27f36..67d16e5303 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,6 +256,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|Drago endif() endif() +if (APPLE AND BUILD_SHARED_LIBS) +set(CMAKE_MACOSX_RPATH ON) +endif() + # Seems that this hack doesn't required since macOS 11 Big Sur if (APPLE AND BUILD_SHARED_LIBS AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 20) set (CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)