0027499: Configuration, CMake - add option INSTALL_NAME_DIR on OS X
[occt.git] / adm / cmake / occt_toolkit.cmake
index 6b33c45..85aaea3 100644 (file)
@@ -176,6 +176,11 @@ endif()
 if (CURRENT_MODULE)
   set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Modules/${CURRENT_MODULE}")
   set_target_properties (${PROJECT_NAME} PROPERTIES MODULE "${CURRENT_MODULE}")
+  if (APPLE)
+    if (NOT "${INSTALL_NAME_DIR}" STREQUAL "")
+      set_target_properties (${PROJECT_NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "${INSTALL_NAME_DIR}")
+    endif()
+  endif()
 endif()
 
 get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)