From 5e44b6bfc0ba2ee36c594caf1999eaf5d26133ed Mon Sep 17 00:00:00 2001
From: Martin Szulecki
Date: Sat, 12 Feb 2011 18:48:42 +0100
Subject: Make sure install_name_tool on OSX picks up library install path

This allows dylib to correctly find the library and fixes linking on OSX.
---
 src/CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index afeb33b..85ce6eb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,11 +24,17 @@ ADD_LIBRARY( plist SHARED ${libplist_SRC} )
 TARGET_LINK_LIBRARIES( plist ${LIBXML2_LIBRARIES} ${GLIB2_LIBRARIES} )
 SET_TARGET_PROPERTIES( plist PROPERTIES VERSION ${LIBPLIST_LIBVERSION} )
 SET_TARGET_PROPERTIES( plist PROPERTIES SOVERSION ${LIBPLIST_SOVERSION} )
+if(APPLE)
+  SET_TARGET_PROPERTIES( plist PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif()
 
 ADD_LIBRARY( plist++ SHARED ${libplist++_SRC} )
 TARGET_LINK_LIBRARIES( plist++ plist )
 SET_TARGET_PROPERTIES( plist++ PROPERTIES VERSION ${LIBPLIST_LIBVERSION} )
 SET_TARGET_PROPERTIES( plist++ PROPERTIES SOVERSION ${LIBPLIST_SOVERSION} )
+if(APPLE)
+  SET_TARGET_PROPERTIES( plist++ PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif()
 
 INSTALL(TARGETS plist plist++
  RUNTIME DESTINATION bin COMPONENT lib
-- 
cgit v1.1-32-gdbae