Skip to content

Commit 16e1e24

Browse files
committed
CMake: fix the install name of the installed shared library.
1 parent 96a3d1a commit 16e1e24

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
6868
#
6969
project(pcap C)
7070

71+
#
72+
# Setting CMAKE_MACOSX_RPATH to FALSE causes the installed
73+
# libpcap.A.dylib to have just libpcap.A.dylib as the install
74+
# name; Apple built libpcap with an install_name of /usr/lib/libpcap.A.dylib
75+
# (back when they still shipped individual system dylibs rather than
76+
# shipping a pre-built shared library cache, at least), and we do the
77+
# same with autotools; do the same with CMake.
78+
#
79+
if (NOT DEFINED CMAKE_INSTALL_NAME_DIR)
80+
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
81+
endif()
82+
7183
#
7284
# For getting raw lists of --libs and --libs --static information from a
7385
# pkg-config module.

0 commit comments

Comments
 (0)