0027499: Configuration, CMake - add option INSTALL_NAME_DIR on OS X
authorkgv <kgv@opencascade.com>
Sun, 15 May 2016 13:41:30 +0000 (16:41 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 19 May 2016 12:02:13 +0000 (15:02 +0300)
CMakeLists.txt
adm/cmake/occt_toolkit.cmake

index dc95958..3c2a6a0 100644 (file)
@@ -294,6 +294,10 @@ else()
   OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR}")
 endif()
 
+if(APPLE)
+  set (INSTALL_NAME_DIR "" CACHE STRING "install_name library suffix on OS X (e.g. @executable_path/../Frameworks)")
+endif()
+
 # a directory recognized as a 'patch' for OCCT
 set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}")
 
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)