diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c1e235..284e348 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,6 +2,8 @@ include_directories(
     ${PROJECT_SOURCE_DIR}
 )
 
+include(GNUInstallDirs)
+
 if(Boost_FOUND)
     include_directories(${Boost_INCLUDE_DIRS})
 endif()
@@ -129,6 +131,8 @@ target_link_libraries(libcryptominisat5
 )
 set_target_properties(libcryptominisat5 PROPERTIES
     OUTPUT_NAME cryptominisat5
+    MACOSX_RPATH TRUE
+    INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}"
     PUBLIC_HEADER "${cryptominisat5_public_headers}"
     VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
     SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
@@ -185,9 +189,9 @@ endforeach()
 
 install(TARGETS libcryptominisat5
     EXPORT ${CRYPTOMINISAT5_EXPORT_NAME}
-    LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
-    ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
-    PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include/cryptominisat5"
+    LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
+    ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}"
+    PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/cryptominisat5"
 )
 
 if (NOT ONLY_SIMPLE)
