aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2022-11-29 15:33:14 -0800
committerGuy Harris <gharris@sonic.net>2022-11-29 15:33:14 -0800
commit16e1e243a9e9f03d8e8f4ee1067ba46795439a8d (patch)
tree9580f3a41fe82e098719149b6ae4e1f344131f1c /CMakeLists.txt
parent96a3d1a895dbf458489eadd5179239dc33a4e3f6 (diff)
CMake: fix the install name of the installed shared library.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50a211bf..2ba0dd3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
project(pcap C)
#
+# Setting CMAKE_MACOSX_RPATH to FALSE causes the installed
+# libpcap.A.dylib to have just libpcap.A.dylib as the install
+# name; Apple built libpcap with an install_name of /usr/lib/libpcap.A.dylib
+# (back when they still shipped individual system dylibs rather than
+# shipping a pre-built shared library cache, at least), and we do the
+# same with autotools; do the same with CMake.
+#
+if (NOT DEFINED CMAKE_INSTALL_NAME_DIR)
+ set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+endif()
+
+#
# For getting raw lists of --libs and --libs --static information from a
# pkg-config module.
#