@@ -39,28 +39,29 @@ if(OpenVINODeveloperPackage_FOUND)
39
39
# ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
40
40
endif ()
41
41
42
- if (DEFINED PY_BUILD_CMAKE_PACKAGE_NAME)
43
- # RPATH for wheel is mandatory to find openvino_genai library. It
44
- # must be forced because GenAI may be built with OpenVINO targeting
45
- # archive. Such OpenVINO configurations sets
46
- # CMAKE_SKIP_INSTALL_RPATH to ON because it relies on setupvars.sh.
47
- set (CMAKE_SKIP_INSTALL_RPATH OFF )
48
- endif ()
49
42
# setting RPATH / LC_RPATH depending on platform
50
43
if (LINUX)
51
44
# to find libopenvino_genai.so in the same folder
52
- set (rpaths "$ORIGIN" )
45
+ set (py_rpaths "$ORIGIN" )
46
+ # to find libopenvino_c.so for libopenvino_genai.so
47
+ set (cpp_rpaths "$ORIGIN/../openvino/libs" )
53
48
elseif (APPLE )
54
49
# to find libopenvino_genai.dylib in the same folder
55
- set (rpaths "@loader_path" )
50
+ set (py_rpaths "@loader_path" )
56
51
if (DEFINED PY_BUILD_CMAKE_PACKAGE_NAME)
57
52
# in case we build pip package, we need to refer to libopenvino.dylib from 'openvino' package
58
- list (APPEND rpaths "@loader_path/../openvino/libs" )
53
+ list (APPEND py_rpaths "@loader_path/../openvino/libs" )
59
54
endif ()
55
+ # to find libopenvino_c.dylib for libopenvino_genai.dylib
56
+ set (cpp_rpaths "$loader_path/../openvino/libs" )
57
+ endif ()
58
+
59
+ if (py_rpaths)
60
+ set_target_properties (${TARGET_NAME} PROPERTIES INSTALL_RPATH "${py_rpaths} " )
60
61
endif ()
61
62
62
- if (rpaths )
63
- set_target_properties (${TARGET_NAME} PROPERTIES INSTALL_RPATH "${rpaths } " )
63
+ if (cpp_rpaths )
64
+ set_target_properties (openvino_genai PROPERTIES INSTALL_RPATH "${cpp_rpaths } " )
64
65
endif ()
65
66
66
67
install (FILES "${CMAKE_CURRENT_SOURCE_DIR} /openvino_genai/__init__.py"
0 commit comments