• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1include(CMakePackageConfigHelpers)
2
3set(RUNTIME_PKG_NAME ${PKG_NAME_PREFIX}-${RUNTIME_COMPONENT_NAME})
4
5set(CONVERTER_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/converter)
6set(OBFUSCATOR_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/obfuscator)
7set(CROPPER_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/cropper)
8if(WIN32)
9    set(BUILD_DIR ${TOP_DIR}/build)
10else()
11    set(BUILD_DIR ${TOP_DIR}/mindspore/lite/build)
12endif()
13set(TEST_CASE_DIR ${TOP_DIR}/mindspore/lite/test/build)
14set(EXTENDRT_BUILD_DIR ${TOP_DIR}/mindspore/lite/build/src/extendrt)
15set(EXECUTOR_BUILD_DIR ${TOP_DIR}/mindspore/lite/build/src/extendrt/unified_executor)
16
17set(RUNTIME_DIR ${RUNTIME_PKG_NAME}/runtime)
18set(RUNTIME_INC_DIR ${RUNTIME_PKG_NAME}/runtime/include)
19set(RUNTIME_LIB_DIR ${RUNTIME_PKG_NAME}/runtime/lib)
20set(PROVIDERS_LIB_DIR ${RUNTIME_PKG_NAME}/providers)
21set(MIND_DATA_INC_DIR ${RUNTIME_PKG_NAME}/runtime/include/dataset)
22set(TURBO_DIR ${RUNTIME_PKG_NAME}/runtime/third_party/libjpeg-turbo)
23set(GLOG_DIR ${RUNTIME_PKG_NAME}/runtime/third_party/glog)
24set(DNNL_DIR ${RUNTIME_PKG_NAME}/runtime/third_party/dnnl)
25set(SECUREC_DIR ${RUNTIME_PKG_NAME}/runtime/third_party/securec)
26set(MINDSPORE_LITE_LIB_NAME libmindspore-lite)
27set(MINDSPORE_LITE_EXTENDRT_LIB_NAME libmindspore-lite)
28set(MINDSPORE_CORE_LIB_NAME libmindspore_core)
29set(MINDSPORE_GE_LITERT_LIB_NAME libmsplugin-ge-litert)
30set(MINDSPORE_LITE_ASCEND_NATIVE_PLUGIN libascend_native_plugin)
31set(MINDSPORE_LITE_EXECUTOR_LIB_NAME liblite-unified-executor)
32set(BENCHMARK_NAME benchmark)
33set(MSLITE_NNIE_LIB_NAME libmslite_nnie)
34set(MSLITE_PROPOSAL_LIB_NAME libmslite_proposal)
35set(MICRO_NNIE_LIB_NAME libmicro_nnie)
36set(DPICO_ACL_ADAPTER_LIB_NAME libdpico_acl_adapter)
37set(BENCHMARK_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/benchmark)
38
39set(MINDSPORE_LITE_TRAIN_LIB_NAME libmindspore-lite-train)
40set(BENCHMARK_TRAIN_NAME benchmark_train)
41set(BENCHMARK_TRAIN_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/benchmark_train)
42file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so*)
43
44include(${TOP_DIR}/cmake/package_micro.cmake)
45
46function(__install_white_list_ops)
47    install(FILES
48            ${TOP_DIR}/mindspore/core/ops/nn_op_name.h
49            ${TOP_DIR}/mindspore/core/ops/adam.h
50            ${TOP_DIR}/mindspore/core/ops/all.h
51            ${TOP_DIR}/mindspore/core/ops/apply_momentum.h
52            ${TOP_DIR}/mindspore/core/ops/assert.h
53            ${TOP_DIR}/mindspore/core/ops/audio_spectrogram.h
54            ${TOP_DIR}/mindspore/core/ops/batch_to_space.h
55            ${TOP_DIR}/mindspore/core/ops/batch_to_space_nd.h
56            ${TOP_DIR}/mindspore/core/ops/broadcast.h
57            ${TOP_DIR}/mindspore/core/ops/clip.h
58            ${TOP_DIR}/mindspore/core/ops/attention.h
59            ${TOP_DIR}/mindspore/core/ops/constant_of_shape.h
60            ${TOP_DIR}/mindspore/core/ops/crop.h
61            ${TOP_DIR}/mindspore/core/ops/custom_extract_features.h
62            ${TOP_DIR}/mindspore/core/ops/custom_normalize.h
63            ${TOP_DIR}/mindspore/core/ops/custom_predict.h
64            ${TOP_DIR}/mindspore/core/ops/depend.h
65            ${TOP_DIR}/mindspore/core/ops/depth_to_space.h
66            ${TOP_DIR}/mindspore/core/ops/detection_post_process.h
67            ${TOP_DIR}/mindspore/core/ops/eltwise.h
68            ${TOP_DIR}/mindspore/core/ops/fake_quant_with_min_max_vars.h
69            ${TOP_DIR}/mindspore/core/ops/fake_quant_with_min_max_vars_per_channel.h
70            ${TOP_DIR}/mindspore/core/ops/fake_quant_with_min_max_vars.h
71            ${TOP_DIR}/mindspore/core/ops/fft_real.h
72            ${TOP_DIR}/mindspore/core/ops/fft_imag.h
73            ${TOP_DIR}/mindspore/core/ops/fill.h
74            ${TOP_DIR}/mindspore/core/ops/fused_batch_norm.h
75            ${TOP_DIR}/mindspore/core/ops/hashtable_lookup.h
76            ${TOP_DIR}/mindspore/core/ops/instance_norm.h
77            ${TOP_DIR}/mindspore/core/ops/leaky_relu.h
78            ${TOP_DIR}/mindspore/core/ops/lp_normalization.h
79            ${TOP_DIR}/mindspore/core/ops/lrn.h
80            ${TOP_DIR}/mindspore/core/ops/lsh_projection.h
81            ${TOP_DIR}/mindspore/core/ops/lstm.h
82            ${TOP_DIR}/mindspore/core/ops/switch_layer.h
83            ${TOP_DIR}/mindspore/core/ops/mfcc.h
84            ${TOP_DIR}/mindspore/core/ops/mod.h
85            ${TOP_DIR}/mindspore/core/ops/non_max_suppression.h
86            ${TOP_DIR}/mindspore/core/ops/prior_box.h
87            ${TOP_DIR}/mindspore/core/ops/quant_dtype_cast.h
88            ${TOP_DIR}/mindspore/core/ops/resize.h
89            ${TOP_DIR}/mindspore/core/ops/reverse_sequence.h
90            ${TOP_DIR}/mindspore/core/ops/rfft.h
91            ${TOP_DIR}/mindspore/core/ops/roi_pooling.h
92            ${TOP_DIR}/mindspore/core/ops/sgd.h
93            ${TOP_DIR}/mindspore/core/ops/sigmoid_cross_entropy_with_logits.h
94            ${TOP_DIR}/mindspore/core/ops/skip_gram.h
95            ${TOP_DIR}/mindspore/core/ops/smooth_l1_loss.h
96            ${TOP_DIR}/mindspore/core/ops/softmax_cross_entropy_with_logits.h
97            ${TOP_DIR}/mindspore/core/ops/space_to_batch.h
98            ${TOP_DIR}/mindspore/core/ops/space_to_batch_nd.h
99            ${TOP_DIR}/mindspore/core/ops/space_to_depth.h
100            ${TOP_DIR}/mindspore/core/ops/sparse_softmax_cross_entropy_with_logits.h
101            ${TOP_DIR}/mindspore/core/ops/sparse_to_dense.h
102            ${TOP_DIR}/mindspore/core/ops/squeeze.h
103            ${TOP_DIR}/mindspore/core/ops/squared_difference.h
104            ${TOP_DIR}/mindspore/core/ops/stack.h
105            ${TOP_DIR}/mindspore/core/ops/switch.h
106            ${TOP_DIR}/mindspore/core/ops/tensor_list_from_tensor.h
107            ${TOP_DIR}/mindspore/core/ops/tensor_list_get_item.h
108            ${TOP_DIR}/mindspore/core/ops/tensor_list_reserve.h
109            ${TOP_DIR}/mindspore/core/ops/tensor_list_set_item.h
110            ${TOP_DIR}/mindspore/core/ops/tensor_list_stack.h
111            ${TOP_DIR}/mindspore/core/ops/unique.h
112            ${TOP_DIR}/mindspore/core/ops/unsqueeze.h
113            ${TOP_DIR}/mindspore/core/ops/unstack.h
114            ${TOP_DIR}/mindspore/core/ops/where.h
115            ${TOP_DIR}/mindspore/core/ops/scatter_nd_update.h
116            ${TOP_DIR}/mindspore/core/ops/gru.h
117            ${TOP_DIR}/mindspore/core/ops/invert_permutation.h
118            ${TOP_DIR}/mindspore/core/ops/size.h
119            ${TOP_DIR}/mindspore/core/ops/random_standard_normal.h
120            ${TOP_DIR}/mindspore/core/ops/crop_and_resize.h
121            ${TOP_DIR}/mindspore/core/ops/uniform_real.h
122            ${TOP_DIR}/mindspore/core/ops/splice.h
123            ${TOP_DIR}/mindspore/core/ops/call.h
124            ${TOP_DIR}/mindspore/core/ops/custom.h
125            ${TOP_DIR}/mindspore/core/ops/split_with_overlap.h
126            ${TOP_DIR}/mindspore/core/ops/ragged_range.h
127            ${TOP_DIR}/mindspore/core/ops/glu.h
128            ${TOP_DIR}/mindspore/core/ops/tensor_array.h
129            ${TOP_DIR}/mindspore/core/ops/tensor_array_read.h
130            ${TOP_DIR}/mindspore/core/ops/tensor_array_write.h
131            ${TOP_DIR}/mindspore/core/ops/affine.h
132            ${TOP_DIR}/mindspore/core/ops/all_gather.h
133            ${TOP_DIR}/mindspore/core/ops/reduce_scatter.h
134            ${TOP_DIR}/mindspore/core/ops/dynamic_quant.h
135            ${TOP_DIR}/mindspore/core/ops/random_normal.h
136            ${TOP_DIR}/mindspore/core/ops/op_name.h
137            ${TOP_DIR}/mindspore/core/ops/tuple_get_item.h
138            ${TOP_DIR}/mindspore/core/ops/tuple_get_item.h
139            ${TOP_DIR}/mindspore/core/ops/scale.h
140            ${TOP_DIR}/mindspore/core/ops/sub.h
141            ${TOP_DIR}/mindspore/core/ops/conv2d_transpose.h
142            ${TOP_DIR}/mindspore/core/ops/conv2d.h
143            ${TOP_DIR}/mindspore/core/ops/topk.h
144            ${TOP_DIR}/mindspore/core/ops/reduce.h
145            ${TOP_DIR}/mindspore/core/ops/max_pool.h
146            ${TOP_DIR}/mindspore/core/ops/make_tuple.h
147            ${TOP_DIR}/mindspore/core/ops/base_operator.h
148            ${TOP_DIR}/mindspore/core/ops/return.h
149            ${TOP_DIR}/mindspore/core/ops/pad.h
150            DESTINATION ${CONVERTER_ROOT_DIR}/include/ops
151            COMPONENT ${RUNTIME_COMPONENT_NAME}
152            )
153    install(FILES
154            ${TOP_DIR}/mindspore/core/ops/fusion/activation.h
155            ${TOP_DIR}/mindspore/core/ops/fusion/add_fusion.h
156            ${TOP_DIR}/mindspore/core/ops/fusion/adder_fusion.h
157            ${TOP_DIR}/mindspore/core/ops/fusion/arg_max_fusion.h
158            ${TOP_DIR}/mindspore/core/ops/fusion/arg_min_fusion.h
159            ${TOP_DIR}/mindspore/core/ops/fusion/avg_pool_fusion.h
160            ${TOP_DIR}/mindspore/core/ops/fusion/conv2d_backprop_filter_fusion.h
161            ${TOP_DIR}/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h
162            ${TOP_DIR}/mindspore/core/ops/fusion/conv2d_fusion.h
163            ${TOP_DIR}/mindspore/core/ops/fusion/conv2d_transpose_fusion.h
164            ${TOP_DIR}/mindspore/core/ops/fusion/div_fusion.h
165            ${TOP_DIR}/mindspore/core/ops/fusion/embedding_lookup_fusion.h
166            ${TOP_DIR}/mindspore/core/ops/fusion/exp_fusion.h
167            ${TOP_DIR}/mindspore/core/ops/fusion/full_connection.h
168            ${TOP_DIR}/mindspore/core/ops/fusion/layer_norm_fusion.h
169            ${TOP_DIR}/mindspore/core/ops/fusion/l2_normalize_fusion.h
170            ${TOP_DIR}/mindspore/core/ops/fusion/mat_mul_fusion.h
171            ${TOP_DIR}/mindspore/core/ops/fusion/max_pool_fusion.h
172            ${TOP_DIR}/mindspore/core/ops/fusion/mul_fusion.h
173            ${TOP_DIR}/mindspore/core/ops/fusion/pad_fusion.h
174            ${TOP_DIR}/mindspore/core/ops/fusion/partial_fusion.h
175            ${TOP_DIR}/mindspore/core/ops/fusion/pow_fusion.h
176            ${TOP_DIR}/mindspore/core/ops/fusion/prelu_fusion.h
177            ${TOP_DIR}/mindspore/core/ops/fusion/reduce_fusion.h
178            ${TOP_DIR}/mindspore/core/ops/fusion/scale_fusion.h
179            ${TOP_DIR}/mindspore/core/ops/fusion/slice_fusion.h
180            ${TOP_DIR}/mindspore/core/ops/fusion/sub_fusion.h
181            ${TOP_DIR}/mindspore/core/ops/fusion/tile_fusion.h
182            ${TOP_DIR}/mindspore/core/ops/fusion/topk_fusion.h
183            DESTINATION ${CONVERTER_ROOT_DIR}/include/ops/fusion
184            COMPONENT ${RUNTIME_COMPONENT_NAME}
185            )
186    install(FILES
187            ${TOP_DIR}/mindspore/core/ops/auto_generate/gen_lite_ops.h
188            ${TOP_DIR}/mindspore/core/ops/auto_generate/gen_ops_name.h
189            DESTINATION ${CONVERTER_ROOT_DIR}/include/ops/auto_generate
190            COMPONENT ${RUNTIME_COMPONENT_NAME}
191            )
192endfunction()
193
194function(__install_ascend_tbe_and_aicpu)
195    set(TBE_CUSTOM_OPP_DIR ${TOP_DIR}/mindspore/lite/build/tools/kernel_builder/ascend/tbe_and_aicpu/makepkg/packages)
196    set(TBE_OPP_DST_DIR ${RUNTIME_PKG_NAME}/tools/custom_kernels/ascend/tbe_and_aicpu)
197    install(DIRECTORY ${TBE_CUSTOM_OPP_DIR} DESTINATION ${TBE_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
198    install(FILES ${TBE_CUSTOM_OPP_DIR}/../install.sh DESTINATION
199                  ${TBE_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
200    install(FILES ${TBE_CUSTOM_OPP_DIR}/../set_env.bash DESTINATION
201                  ${TBE_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
202endfunction()
203
204function(__install_ascend_ascendc)
205    set(ASCEMDC_CUSTOM_OPP_DIR ${TOP_DIR}/mindspore/lite/build/tools/kernel_builder/ascend/ascendc/makepkg/packages)
206    set(ASCENDC_OPP_DST_DIR ${RUNTIME_PKG_NAME}/tools/custom_kernels/ascend/ascendc)
207    install(DIRECTORY ${ASCEMDC_CUSTOM_OPP_DIR} DESTINATION ${ASCENDC_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
208    install(FILES ${CMAKE_BINARY_DIR}/ascendc_scripts/install.sh DESTINATION
209            ${ASCENDC_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
210    install(FILES ${CMAKE_BINARY_DIR}/ascendc_scripts/set_env.bash DESTINATION
211            ${ASCENDC_OPP_DST_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
212endfunction()
213
214# full mode will also package the files of lite_cv mode.
215if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "full")
216    # full header files
217    install(FILES
218            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/constants.h
219            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/data_helper.h
220            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/execute.h
221            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/iterator.h
222            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/samplers.h
223            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/transforms.h
224            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_lite.h
225            ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/liteapi/include/datasets.h
226        DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
227
228    if(PLATFORM_ARM64)
229        if((MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) AND MSLITE_ENABLE_ACL)
230            install(FILES ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
231                    DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
232            install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/kernels-dvpp-image/utils/libdvpp_utils.so
233                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
234        endif()
235        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION
236                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
237        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.a DESTINATION
238                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
239        install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
240        install(FILES ${TOP_DIR}/mindspore/lite/build/securec/src/libsecurec.a
241                DESTINATION ${SECUREC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
242    elseif(PLATFORM_ARM32)
243        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION
244                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
245        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.a DESTINATION
246                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
247        install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
248        install(FILES ${TOP_DIR}/mindspore/lite/build/securec/src/libsecurec.a
249                DESTINATION ${SECUREC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
250    else()
251        if((MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) AND MSLITE_ENABLE_ACL)
252                install(FILES ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
253                        DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
254                install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/kernels-dvpp-image/utils/libdvpp_utils.so
255                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
256        endif()
257        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION
258                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
259        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.a DESTINATION
260                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
261        install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib
262                RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME})
263        install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib
264                RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
265        install(FILES ${TOP_DIR}/mindspore/lite/build/securec/src/libsecurec.a
266                DESTINATION ${SECUREC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
267    endif()
268
269    # lite_cv header files
270    install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
271            DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
272endif()
273
274if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "wrapper")
275    install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/ DESTINATION ${MIND_DATA_INC_DIR}
276            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "vision.h" EXCLUDE)
277    if(PLATFORM_ARM64)
278        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
279                COMPONENT ${RUNTIME_COMPONENT_NAME})
280        install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
281    elseif(PLATFORM_ARM32)
282        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
283                COMPONENT ${RUNTIME_COMPONENT_NAME})
284        install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
285    else()
286        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
287                COMPONENT ${RUNTIME_COMPONENT_NAME})
288        install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62
289                COMPONENT ${RUNTIME_COMPONENT_NAME})
290        install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib RENAME libturbojpeg.so.0
291                COMPONENT ${RUNTIME_COMPONENT_NAME})
292    endif()
293endif()
294
295if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "lite")
296    install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/ DESTINATION ${MIND_DATA_INC_DIR}
297            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
298    if(PLATFORM_ARM64)
299        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
300                COMPONENT ${RUNTIME_COMPONENT_NAME})
301        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so DESTINATION ${TURBO_DIR}/lib
302                COMPONENT ${RUNTIME_COMPONENT_NAME})
303        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so DESTINATION ${TURBO_DIR}/lib
304                COMPONENT ${RUNTIME_COMPONENT_NAME})
305    elseif(PLATFORM_ARM32)
306        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
307                COMPONENT ${RUNTIME_COMPONENT_NAME})
308        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so DESTINATION ${TURBO_DIR}/lib
309                COMPONENT ${RUNTIME_COMPONENT_NAME})
310        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so DESTINATION ${TURBO_DIR}/lib
311                COMPONENT ${RUNTIME_COMPONENT_NAME})
312    else()
313        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
314                COMPONENT ${RUNTIME_COMPONENT_NAME})
315        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so.62.3.0
316                DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME})
317        install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so.0.2.0
318                DESTINATION ${TURBO_DIR}/lib RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
319    endif()
320endif()
321
322if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "lite_cv")
323    if(PLATFORM_ARM64)
324        install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
325                DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
326        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so
327                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
328    elseif(PLATFORM_ARM32)
329        install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
330                DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
331        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
332                COMPONENT ${RUNTIME_COMPONENT_NAME})
333    else()
334        install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
335                DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
336        install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${RUNTIME_LIB_DIR}
337                COMPONENT ${RUNTIME_COMPONENT_NAME})
338    endif()
339endif()
340
341if(WIN32)
342    install(FILES ${TOP_DIR}/build/.commit_id DESTINATION ${RUNTIME_PKG_NAME}
343            COMPONENT ${RUNTIME_COMPONENT_NAME})
344else()
345    install(FILES ${TOP_DIR}/mindspore/lite/build/.commit_id DESTINATION ${RUNTIME_PKG_NAME}
346            COMPONENT ${RUNTIME_COMPONENT_NAME})
347endif()
348if(NOT PLATFORM_MCU)
349    install(DIRECTORY ${flatbuffers_INC}/ DESTINATION ${RUNTIME_INC_DIR}/third_party
350            COMPONENT ${RUNTIME_COMPONENT_NAME})
351endif()
352
353if(ANDROID_NDK)
354    set(glog_name libmindspore_glog.so)
355else()
356    set(glog_name libmindspore_glog.so.0.4.0)
357endif()
358
359if(PLATFORM_ARM64)
360    if(SUPPORT_NPU)
361        install(FILES ${DDK_LIB_PATH}/libhiai.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
362                COMPONENT ${RUNTIME_COMPONENT_NAME})
363        install(FILES ${DDK_LIB_PATH}/libhiai_ir.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
364                COMPONENT ${RUNTIME_COMPONENT_NAME})
365        install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
366                COMPONENT ${RUNTIME_COMPONENT_NAME})
367        if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so")
368            install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so
369                    DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
370        endif()
371    endif()
372    install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${RUNTIME_INC_DIR}
373            COMPONENT ${RUNTIME_COMPONENT_NAME})
374    install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${RUNTIME_INC_DIR}/registry
375            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "register_kernel_interface.h"
376            PATTERN "register_kernel.h")
377    if(SUPPORT_TRAIN)
378        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.so DESTINATION
379                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
380        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.a DESTINATION
381                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
382    endif()
383    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/model_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
384            COMPONENT ${RUNTIME_COMPONENT_NAME})
385    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
386            COMPONENT ${RUNTIME_COMPONENT_NAME})
387    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_types_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
388            COMPONENT ${RUNTIME_COMPONENT_NAME})
389    if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)
390        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/${MINDSPORE_LITE_EXTENDRT_LIB_NAME}.so
391                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
392        install(FILES ${EXTENDRT_BUILD_DIR}/delegate/graph_executor/litert/${MINDSPORE_GE_LITERT_LIB_NAME}.so
393                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
394        if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
395            install(FILES ${EXECUTOR_BUILD_DIR}/${MINDSPORE_LITE_EXECUTOR_LIB_NAME}.so
396                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
397        endif()
398        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
399                RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
400        install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
401        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/convert/libruntime_convert_plugin.so
402                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
403        if(MSLITE_ENABLE_ACL)
404            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/kernel/ascend/libascend_kernel_plugin.so
405                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
406            if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
407                install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/ascend_ge/libascend_ge_plugin.so
408                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
409            endif()
410            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/cxx_api/llm_engine/libllm_engine_plugin.so
411                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
412            __install_ascend_tbe_and_aicpu()
413            __install_ascend_ascendc()
414        endif()
415        if(MSLITE_GPU_BACKEND STREQUAL tensorrt)
416            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/tensorrt/libtensorrt_plugin.so
417                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
418        endif()
419    else()
420        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
421                COMPONENT ${RUNTIME_COMPONENT_NAME})
422        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
423                COMPONENT ${RUNTIME_COMPONENT_NAME})
424        if(MSLITE_ENABLE_ACL)
425            install(FILES ${TOP_DIR}/mindspore/lite/build/src/litert/kernel/ascend/libascend_kernel_plugin.so
426                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
427        endif()
428    endif()
429    install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
430            COMPONENT ${RUNTIME_COMPONENT_NAME})
431    install(FILES
432            ${TOP_DIR}/mindspore/core/mindapi/base/format.h
433            ${TOP_DIR}/mindspore/core/mindapi/base/type_id.h
434            ${TOP_DIR}/mindspore/core/mindapi/base/types.h
435            DESTINATION ${RUNTIME_INC_DIR}/mindapi/base
436            COMPONENT ${RUNTIME_COMPONENT_NAME})
437    install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
438            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
439    install(DIRECTORY ${TOP_DIR}/include/c_api/ DESTINATION ${RUNTIME_INC_DIR}/c_api
440            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
441    if(ANDROID_NDK_TOOLCHAIN_INCLUDED OR MSLITE_ENABLE_CONVERTER OR TARGET_HIMIX OR TARGET_OHOS)
442        __install_micro_wrapper()
443    endif()
444    if(MSLITE_ENABLE_RUNTIME_GLOG)
445        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${GLOG_DIR} RENAME libmindspore_glog.so.0
446                COMPONENT ${RUNTIME_COMPONENT_NAME})
447    endif()
448    if(MSLITE_ENABLE_TOOLS)
449        if(NOT MSLITE_COMPILE_TWICE)
450            install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR}
451                    COMPONENT ${RUNTIME_COMPONENT_NAME})
452            if(TARGET_HIMIX)
453                if(${MSLITE_REGISTRY_DEVICE}  STREQUAL "Hi3559A")
454                    install(FILES ${TOP_DIR}/mindspore/lite/build/tools/benchmark/nnie/${MSLITE_NNIE_LIB_NAME}.so
455                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
456                            COMPONENT ${RUNTIME_COMPONENT_NAME})
457                    install(FILES
458                            ${TOP_DIR}/mindspore/lite/build/tools/benchmark/nnie_proposal/${MSLITE_PROPOSAL_LIB_NAME}.so
459                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
460                            COMPONENT ${RUNTIME_COMPONENT_NAME})
461                    install(FILES
462                            ${TOP_DIR}/mindspore/lite/build/nnie_micro/${MICRO_NNIE_LIB_NAME}.so
463                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
464                            COMPONENT ${RUNTIME_COMPONENT_NAME})
465                endif()
466            elseif(TARGET_MIX210)
467                if(${MSLITE_REGISTRY_DEVICE}  STREQUAL "SD3403" AND (NOT MSLITE_ENABLE_ACL))
468                    install(FILES ${TOP_DIR}/mindspore/lite/build/tools/benchmark/dpico/${DPICO_ACL_ADAPTER_LIB_NAME}.so
469                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
470                            COMPONENT ${RUNTIME_COMPONENT_NAME})
471                endif()
472            endif()
473        endif()
474        if(SUPPORT_TRAIN)
475            install(TARGETS ${BENCHMARK_TRAIN_NAME} RUNTIME DESTINATION ${BENCHMARK_TRAIN_ROOT_DIR} COMPONENT
476                    ${RUNTIME_COMPONENT_NAME})
477        endif()
478        if(MSLITE_ENABLE_CONVERTER)
479            install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION
480                    ${CONVERTER_ROOT_DIR}/include/registry COMPONENT ${RUNTIME_COMPONENT_NAME})
481            install(FILES ${API_HEADER}  DESTINATION ${CONVERTER_ROOT_DIR}/include/api
482                    COMPONENT ${RUNTIME_COMPONENT_NAME})
483            install(FILES ${MINDAPI_BASE_HEADER} DESTINATION ${CONVERTER_ROOT_DIR}/include/mindapi/base
484                    COMPONENT ${RUNTIME_COMPONENT_NAME})
485            install(FILES ${MINDAPI_IR_HEADER} DESTINATION ${CONVERTER_ROOT_DIR}/include/mindapi/ir
486                    COMPONENT ${RUNTIME_COMPONENT_NAME})
487            __install_white_list_ops()
488            install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/schema/
489                    DESTINATION ${CONVERTER_ROOT_DIR}/include/schema
490                    COMPONENT ${RUNTIME_COMPONENT_NAME}
491                    FILES_MATCHING PATTERN "*.h" PATTERN "schema_generated.h" EXCLUDE)
492            install(DIRECTORY ${flatbuffers_INC}/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party
493                    COMPONENT ${RUNTIME_COMPONENT_NAME})
494            install(DIRECTORY ${glog_LIBPATH}/../include/glog/
495                    DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/glog
496                    COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
497            install(DIRECTORY ${TOP_DIR}/third_party/securec/include/
498                    DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/securec
499                    COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
500            install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
501                    COMPONENT ${RUNTIME_COMPONENT_NAME})
502            install(FILES ${BUILD_DIR}/tools/converter/libmindspore_converter.so
503                    DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
504            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin.so
505                    DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
506            install(DIRECTORY ${TOP_DIR}/third_party/proto/ DESTINATION ${CONVERTER_ROOT_DIR}/third_party/proto
507                    COMPONENT ${RUNTIME_COMPONENT_NAME})
508            install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${CONVERTER_ROOT_DIR}/lib
509                    RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
510            install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
511            if(MSLITE_ENABLE_OPENCV)
512                install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.2
513                        DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_core.so.4.5
514                        COMPONENT ${RUNTIME_COMPONENT_NAME})
515                install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.2
516                        DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_imgcodecs.so.4.5
517                        COMPONENT ${RUNTIME_COMPONENT_NAME})
518                install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.2
519                        DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_imgproc.so.4.5
520                        COMPONENT ${RUNTIME_COMPONENT_NAME})
521            endif()
522            if(MSLITE_ENABLE_ACL)
523                set(LITE_ACL_DIR ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/acl)
524                install(FILES ${LITE_ACL_DIR}/mslite_shared_lib/libmslite_shared_lib.so
525                        DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
526                if(MSLITE_ENABLE_RUNTIME_CONVERT)
527                    install(FILES ${LITE_ACL_DIR}/mslite_shared_lib/libmslite_shared_lib.so
528                            DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
529                    install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
530                            RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
531                    install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib
532                            COMPONENT ${RUNTIME_COMPONENT_NAME})
533                endif()
534                install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
535                        COMPONENT ${RUNTIME_COMPONENT_NAME})
536            endif()
537
538            if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)
539                install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so
540                        DESTINATION ${CONVERTER_ROOT_DIR}/providers/SD3403 COMPONENT ${RUNTIME_COMPONENT_NAME})
541                if(MSLITE_ENABLE_TOOLS)
542                    install(TARGETS ${BECHCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR}
543                            COMPONENT ${RUNTIME_COMPONENT_NAME})
544                endif()
545            endif()
546
547            if(MSLITE_ENABLE_RUNTIME_GLOG)
548                install(DIRECTORY ${glog_LIBPATH}/../include/glog/ DESTINATION ${RUNTIME_INC_DIR}/third_party/glog
549                        COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
550                install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${GLOG_DIR}
551                        RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
552            endif()
553            if(MSLITE_ENABLE_RUNTIME_CONVERT)
554                install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin.so
555                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
556                if(MSLITE_ENABLE_OPENCV)
557                    install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.2
558                            DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_core.so.4.5
559                            COMPONENT ${RUNTIME_COMPONENT_NAME})
560                    install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.2
561                            DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_imgcodecs.so.4.5
562                            COMPONENT ${RUNTIME_COMPONENT_NAME})
563                    install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.2
564                            DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_imgproc.so.4.5
565                            COMPONENT ${RUNTIME_COMPONENT_NAME})
566                endif()
567            endif()
568            if((MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)
569                AND MSLITE_ENABLE_GRAPH_KERNEL AND CMAKE_SYSTEM_NAME MATCHES "Linux")
570                if(EXISTS ${BUILD_DIR}/akg)
571                    set(AKG_PATH ${BUILD_DIR}/akg)
572                    file(REMOVE_RECURSE ${AKG_PATH}/build/akg/lib)
573                    install(DIRECTORY  ${AKG_PATH}/build/akg
574                            DESTINATION ${BUILD_DIR}/package/mindspore_lite
575                            COMPONENT ${RUNTIME_COMPONENT_NAME})
576                    install(FILES ${AKG_PATH}/${AKG_PKG_PATH}
577                            DESTINATION ${RUNTIME_PKG_NAME}/tools/akg
578                            COMPONENT ${RUNTIME_COMPONENT_NAME})
579                    install(FILES ${AKG_PATH}/${AKG_PKG_PATH}.sha256
580                            DESTINATION ${RUNTIME_PKG_NAME}/tools/akg
581                            COMPONENT ${RUNTIME_COMPONENT_NAME})
582                    install(FILES ${AKG_PATH}/build/libakg.so
583                            DESTINATION ${BUILD_DIR}/package/mindspore_lite/lib
584                            COMPONENT ${RUNTIME_COMPONENT_NAME})
585                endif()
586            endif()
587        endif()
588    endif()
589    if(MSLITE_ENABLE_TESTCASES)
590        install(FILES ${TOP_DIR}/mindspore/lite/build/test/lite-test DESTINATION ${TEST_CASE_DIR}
591                COMPONENT ${RUNTIME_COMPONENT_NAME})
592        install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/src/ DESTINATION ${TEST_CASE_DIR}
593                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.so")
594        install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/minddata/ DESTINATION ${TEST_CASE_DIR}
595                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.so")
596        install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TEST_CASE_DIR})
597        if(SUPPORT_NPU)
598            install(FILES ${DDK_LIB_PATH}/libhiai.so DESTINATION ${TEST_CASE_DIR}
599                    COMPONENT ${RUNTIME_COMPONENT_NAME})
600            install(FILES ${DDK_LIB_PATH}/libhiai_ir.so DESTINATION ${TEST_CASE_DIR}
601                    COMPONENT ${RUNTIME_COMPONENT_NAME})
602            install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${TEST_CASE_DIR}
603                    COMPONENT ${RUNTIME_COMPONENT_NAME})
604            if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so")
605                install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so
606                        DESTINATION ${TEST_CASE_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
607            endif()
608        endif()
609    endif()
610elseif(PLATFORM_ARM32)
611    if(SUPPORT_NPU)
612        install(FILES ${DDK_LIB_PATH}/libhiai.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
613                COMPONENT ${RUNTIME_COMPONENT_NAME})
614        install(FILES ${DDK_LIB_PATH}/libhiai_ir.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
615                COMPONENT ${RUNTIME_COMPONENT_NAME})
616        install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
617                COMPONENT ${RUNTIME_COMPONENT_NAME})
618        if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so")
619            install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so
620                    DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
621        endif()
622    endif()
623    install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${RUNTIME_INC_DIR}
624            COMPONENT ${RUNTIME_COMPONENT_NAME})
625    install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${RUNTIME_INC_DIR}/registry
626            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "register_kernel_interface.h"
627            PATTERN "register_kernel.h")
628    if(SUPPORT_TRAIN)
629        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.so DESTINATION
630                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
631        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.a DESTINATION
632                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
633    endif()
634    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/model_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
635            COMPONENT ${RUNTIME_COMPONENT_NAME})
636    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
637            COMPONENT ${RUNTIME_COMPONENT_NAME})
638    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_types_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
639            COMPONENT ${RUNTIME_COMPONENT_NAME})
640    if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)
641        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/${MINDSPORE_LITE_EXTENDRT_LIB_NAME}.so
642                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
643        install(FILES ${EXTENDRT_BUILD_DIR}/delegate/graph_executor/litert/${MINDSPORE_GE_LITERT_LIB_NAME}.so
644                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
645        if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
646            install(FILES ${EXECUTOR_BUILD_DIR}/${MINDSPORE_LITE_EXECUTOR_LIB_NAME}.so
647                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
648        endif()
649        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
650                RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
651        install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
652        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/convert/libruntime_convert_plugin.so
653                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
654        if(MSLITE_ENABLE_ACL)
655            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/kernel/ascend/libascend_kernel_plugin.so
656                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
657            if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
658                install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/ascend_ge/libascend_ge_plugin.so
659                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
660            endif()
661            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/cxx_api/llm_engine/libllm_engine_plugin.so
662                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
663            __install_ascend_tbe_and_aicpu()
664            __install_ascend_ascendc()
665        endif()
666        if(MSLITE_GPU_BACKEND STREQUAL tensorrt)
667            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/tensorrt/libtensorrt_plugin.so
668                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
669        endif()
670    else()
671        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
672                COMPONENT ${RUNTIME_COMPONENT_NAME})
673        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
674                COMPONENT ${RUNTIME_COMPONENT_NAME})
675        if(MSLITE_ENABLE_ACL)
676            install(FILES ${TOP_DIR}/mindspore/lite/build/src/litert/kernel/ascend/libascend_kernel_plugin.so
677                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
678        endif()
679    endif()
680    install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
681            COMPONENT ${RUNTIME_COMPONENT_NAME})
682    install(FILES
683            ${TOP_DIR}/mindspore/core/mindapi/base/format.h
684            ${TOP_DIR}/mindspore/core/mindapi/base/type_id.h
685            ${TOP_DIR}/mindspore/core/mindapi/base/types.h
686            DESTINATION ${RUNTIME_INC_DIR}/mindapi/base
687            COMPONENT ${RUNTIME_COMPONENT_NAME})
688    install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
689            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
690    install(DIRECTORY ${TOP_DIR}/include/c_api/ DESTINATION ${RUNTIME_INC_DIR}/c_api
691            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
692    if(ANDROID_NDK_TOOLCHAIN_INCLUDED OR MSLITE_ENABLE_CONVERTER OR TARGET_OHOS_LITE OR TARGET_HIMIX)
693        __install_micro_wrapper()
694    endif()
695    if(MSLITE_ENABLE_TOOLS AND NOT TARGET_OHOS_LITE)
696        if(NOT MSLITE_COMPILE_TWICE)
697            install(TARGETS ${BENCHMARK_NAME} RUNTIME
698                    DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
699            if(TARGET_HIMIX)
700                if(${MSLITE_REGISTRY_DEVICE}  STREQUAL "Hi3516D" OR ${MSLITE_REGISTRY_DEVICE}  STREQUAL "Hi3519A")
701                    install(FILES ${TOP_DIR}/mindspore/lite/build/tools/benchmark/nnie/${MSLITE_NNIE_LIB_NAME}.so
702                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
703                            COMPONENT ${RUNTIME_COMPONENT_NAME})
704                    install(FILES
705                            ${TOP_DIR}/mindspore/lite/build/tools/benchmark/nnie_proposal/${MSLITE_PROPOSAL_LIB_NAME}.so
706                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
707                            COMPONENT ${RUNTIME_COMPONENT_NAME})
708                    install(FILES
709                            ${TOP_DIR}/mindspore/lite/build/nnie_micro/${MICRO_NNIE_LIB_NAME}.so
710                            DESTINATION ${PROVIDERS_LIB_DIR}/${MSLITE_REGISTRY_DEVICE}
711                            COMPONENT ${RUNTIME_COMPONENT_NAME})
712                endif()
713            endif()
714        endif()
715        if(SUPPORT_TRAIN)
716            install(TARGETS ${BENCHMARK_TRAIN_NAME} RUNTIME DESTINATION ${BENCHMARK_TRAIN_ROOT_DIR} COMPONENT
717                    ${RUNTIME_COMPONENT_NAME})
718        endif()
719    endif()
720elseif(WIN32)
721    get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
722    file(GLOB LIB_LIST ${CXX_DIR}/libstdc++-6.dll ${CXX_DIR}/libwinpthread-1.dll
723            ${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_*-1.dll)
724    if(MSLITE_ENABLE_CONVERTER)
725        install(FILES ${TOP_DIR}/build/mindspore/tools/converter/converter_lite/converter_lite.exe
726                DESTINATION ${CONVERTER_ROOT_DIR}/converter COMPONENT ${RUNTIME_COMPONENT_NAME})
727        install(FILES ${TOP_DIR}/build/mindspore/tools/converter/libmindspore_converter.dll
728                DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
729        install(FILES ${LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
730        install(FILES ${TOP_DIR}/build/mindspore/tools/converter/registry/libmslite_converter_plugin.dll
731                DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
732        file(GLOB GLOG_LIB_LIST ${glog_LIBPATH}/../bin/*.dll)
733        install(FILES ${GLOG_LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib
734                COMPONENT ${RUNTIME_COMPONENT_NAME})
735        install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
736        if(MSLITE_ENABLE_OPENCV)
737            file(GLOB_RECURSE OPENCV_LIB_LIST
738                    ${opencv_LIBPATH}/../bin/libopencv_core*
739                    ${opencv_LIBPATH}/../bin/libopencv_imgcodecs*
740                    ${opencv_LIBPATH}/../bin/libopencv_imgproc*
741                    )
742            install(FILES ${OPENCV_LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
743        endif()
744        if(NOT MSVC AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE))
745            __install_micro_wrapper()
746            __install_micro_codegen()
747        endif()
748    endif()
749    if(MSLITE_ENABLE_TOOLS)
750        if(MSVC)
751            install(FILES ${TOP_DIR}/build/mindspore/tools/benchmark/${BENCHMARK_NAME}.exe
752                    DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
753        else()
754            install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR}
755                    COMPONENT ${RUNTIME_COMPONENT_NAME})
756        endif()
757        if(SUPPORT_TRAIN)
758            install(TARGETS ${BENCHMARK_TRAIN_NAME} RUNTIME DESTINATION ${BENCHMARK_TRAIN_ROOT_DIR} COMPONENT
759                    ${RUNTIME_COMPONENT_NAME})
760        endif()
761    endif()
762    if(MSLITE_ENABLE_RUNTIME_GLOG)
763        file(GLOB GLOG_LIB_LIST ${glog_LIBPATH}/../bin/*.dll)
764        install(FILES ${GLOG_LIB_LIST} DESTINATION ${GLOG_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
765    endif()
766    install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${RUNTIME_INC_DIR}
767            COMPONENT ${RUNTIME_COMPONENT_NAME})
768    install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${RUNTIME_INC_DIR}/registry
769            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "register_kernel_interface.h"
770            PATTERN "register_kernel.h")
771    install(FILES ${TOP_DIR}/build/mindspore/schema/model_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
772            COMPONENT ${RUNTIME_COMPONENT_NAME})
773    install(FILES ${TOP_DIR}/build/mindspore/schema/ops_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
774            COMPONENT ${RUNTIME_COMPONENT_NAME})
775    install(FILES ${TOP_DIR}/build/mindspore/schema/ops_types_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
776            COMPONENT ${RUNTIME_COMPONENT_NAME})
777    install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
778            COMPONENT ${RUNTIME_COMPONENT_NAME})
779    install(FILES
780            ${TOP_DIR}/mindspore/core/mindapi/base/format.h
781            ${TOP_DIR}/mindspore/core/mindapi/base/type_id.h
782            ${TOP_DIR}/mindspore/core/mindapi/base/types.h
783            DESTINATION ${RUNTIME_INC_DIR}/mindapi/base
784            COMPONENT ${RUNTIME_COMPONENT_NAME})
785    install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
786            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
787    install(DIRECTORY ${TOP_DIR}/include/c_api/ DESTINATION ${RUNTIME_INC_DIR}/c_api
788            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
789    if(MSVC)
790        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.lib DESTINATION ${RUNTIME_LIB_DIR}
791                COMPONENT ${RUNTIME_COMPONENT_NAME})
792        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll DESTINATION ${RUNTIME_LIB_DIR}
793                COMPONENT ${RUNTIME_COMPONENT_NAME})
794        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll.lib DESTINATION ${RUNTIME_LIB_DIR}
795                COMPONENT ${RUNTIME_COMPONENT_NAME})
796    else()
797        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
798                COMPONENT ${RUNTIME_COMPONENT_NAME})
799        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll.a DESTINATION ${RUNTIME_LIB_DIR}
800                COMPONENT ${RUNTIME_COMPONENT_NAME})
801        install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll DESTINATION ${RUNTIME_LIB_DIR}
802                COMPONENT ${RUNTIME_COMPONENT_NAME})
803        install(FILES ${LIB_LIST} DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
804    endif()
805elseif(PLATFORM_MCU)
806    __install_micro_wrapper()
807    __install_micro_codegen()
808    install(DIRECTORY ${TOP_DIR}/include/c_api/ DESTINATION ${RUNTIME_INC_DIR}/c_api
809            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
810else()
811    install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${RUNTIME_INC_DIR}
812            COMPONENT ${RUNTIME_COMPONENT_NAME})
813    install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${RUNTIME_INC_DIR}/registry
814            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "register_kernel_interface.h"
815            PATTERN "register_kernel.h")
816    if(SUPPORT_TRAIN)
817        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.so DESTINATION
818                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
819        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_TRAIN_LIB_NAME}.a DESTINATION
820                ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
821    endif()
822    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/model_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
823            COMPONENT ${RUNTIME_COMPONENT_NAME})
824    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
825            COMPONENT ${RUNTIME_COMPONENT_NAME})
826    install(FILES ${TOP_DIR}/mindspore/lite/build/schema/ops_types_generated.h DESTINATION ${RUNTIME_INC_DIR}/schema
827            COMPONENT ${RUNTIME_COMPONENT_NAME})
828    install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
829            COMPONENT ${RUNTIME_COMPONENT_NAME})
830    install(FILES
831            ${TOP_DIR}/mindspore/core/mindapi/base/format.h
832            ${TOP_DIR}/mindspore/core/mindapi/base/type_id.h
833            ${TOP_DIR}/mindspore/core/mindapi/base/types.h
834            DESTINATION ${RUNTIME_INC_DIR}/mindapi/base
835            COMPONENT ${RUNTIME_COMPONENT_NAME})
836    install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
837            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
838    install(DIRECTORY ${TOP_DIR}/include/c_api/ DESTINATION ${RUNTIME_INC_DIR}/c_api
839            COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
840    if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)
841        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/${MINDSPORE_LITE_EXTENDRT_LIB_NAME}.so
842                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
843        install(FILES ${EXTENDRT_BUILD_DIR}/delegate/graph_executor/litert/${MINDSPORE_GE_LITERT_LIB_NAME}.so
844                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
845        if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
846            install(FILES ${EXECUTOR_BUILD_DIR}/${MINDSPORE_LITE_EXECUTOR_LIB_NAME}.so
847                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
848        endif()
849        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
850                RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
851        if(MSLITE_DEPS_MKLDNN)
852                install(FILES ${onednn_LIBPATH}/libdnnl.so.2.2 DESTINATION ${DNNL_DIR}
853                        RENAME libdnnl.so.2 COMPONENT ${RUNTIME_COMPONENT_NAME})
854        endif()
855        install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
856        install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/convert/libruntime_convert_plugin.so
857                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
858        if(MSLITE_ENABLE_ACL)
859            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/kernel/ascend/libascend_kernel_plugin.so
860                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
861            if(NOT MSLITE_SIMPLEST_CLOUD_INFERENCE)
862                install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/ascend_ge/libascend_ge_plugin.so
863                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
864            endif()
865            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/cxx_api/llm_engine/libllm_engine_plugin.so
866                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
867            __install_ascend_tbe_and_aicpu()
868            __install_ascend_ascendc()
869            if(MSLITE_ASCEND_TARGET)
870                install(TARGETS ascend_native_plugin
871                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
872                if(TARGET ascend_native_kernels_impl)
873                        install(TARGETS ascend_native_kernels_impl
874                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
875                endif()
876                install(TARGETS hccl_plugin
877                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
878            endif()
879        endif()
880        if(MSLITE_GPU_BACKEND STREQUAL tensorrt)
881            install(FILES ${TOP_DIR}/mindspore/lite/build/src/extendrt/delegate/tensorrt/libtensorrt_plugin.so
882                DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
883            install(FILES ${fast_transformers_LIBPATH}/libtransformer-shared.so DESTINATION ${RUNTIME_LIB_DIR}
884                COMPONENT ${RUNTIME_COMPONENT_NAME})
885        endif()
886    else()
887        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
888                COMPONENT ${RUNTIME_COMPONENT_NAME})
889        install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
890                COMPONENT ${RUNTIME_COMPONENT_NAME})
891        if(MSLITE_ENABLE_ACL)
892            install(FILES ${TOP_DIR}/mindspore/lite/build/src/litert/kernel/ascend/libascend_kernel_plugin.so
893                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
894        endif()
895    endif()
896    if(MSLITE_ENABLE_RUNTIME_GLOG)
897        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${GLOG_DIR} RENAME libmindspore_glog.so.0
898                COMPONENT ${RUNTIME_COMPONENT_NAME})
899        install(DIRECTORY ${glog_LIBPATH}/../include/glog/ DESTINATION ${RUNTIME_INC_DIR}/third_party/glog
900                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
901    endif()
902    if(MSLITE_ENABLE_CONVERTER)
903        install(FILES ${TOP_DIR}/mindspore/lite/include/kernel_interface.h DESTINATION ${CONVERTER_ROOT_DIR}/include
904                COMPONENT ${RUNTIME_COMPONENT_NAME})
905        install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/registry/ DESTINATION ${CONVERTER_ROOT_DIR}/include/registry
906                COMPONENT ${RUNTIME_COMPONENT_NAME})
907        install(FILES ${API_HEADER}  DESTINATION ${CONVERTER_ROOT_DIR}/include/api
908                COMPONENT ${RUNTIME_COMPONENT_NAME})
909        install(FILES ${MINDAPI_BASE_HEADER} DESTINATION ${CONVERTER_ROOT_DIR}/include/mindapi/base
910                COMPONENT ${RUNTIME_COMPONENT_NAME})
911        install(FILES ${MINDAPI_IR_HEADER} DESTINATION ${CONVERTER_ROOT_DIR}/include/mindapi/ir
912                COMPONENT ${RUNTIME_COMPONENT_NAME})
913        __install_white_list_ops()
914        install(DIRECTORY ${TOP_DIR}/mindspore/lite/build/schema/ DESTINATION ${CONVERTER_ROOT_DIR}/include/schema
915                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "schema_generated.h" EXCLUDE)
916        install(DIRECTORY ${flatbuffers_INC}/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party
917                COMPONENT ${RUNTIME_COMPONENT_NAME})
918        install(DIRECTORY ${TOP_DIR}/third_party/proto/ DESTINATION ${CONVERTER_ROOT_DIR}/third_party/proto
919                COMPONENT ${RUNTIME_COMPONENT_NAME})
920        install(DIRECTORY ${glog_LIBPATH}/../include/glog/ DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/glog
921                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
922        install(DIRECTORY ${TOP_DIR}/third_party/securec/include/
923                DESTINATION ${CONVERTER_ROOT_DIR}/include/third_party/securec
924                COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
925        install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
926                COMPONENT ${RUNTIME_COMPONENT_NAME})
927        install(FILES ${BUILD_DIR}/tools/converter/libmindspore_converter.so
928                DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
929        install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin.so
930                DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
931        install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${CONVERTER_ROOT_DIR}/lib
932                RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
933        install(TARGETS mindspore_core DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
934        if(MSLITE_ENABLE_OPENCV)
935            install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.2
936                    DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_core.so.4.5
937                    COMPONENT ${RUNTIME_COMPONENT_NAME})
938            install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.2
939                    DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_imgcodecs.so.4.5
940                    COMPONENT ${RUNTIME_COMPONENT_NAME})
941            install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.2
942                    DESTINATION ${CONVERTER_ROOT_DIR}/lib RENAME libopencv_imgproc.so.4.5
943                    COMPONENT ${RUNTIME_COMPONENT_NAME})
944        endif()
945
946        if(MSLITE_ENABLE_ACL)
947            set(LITE_ACL_DIR ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/acl)
948            install(FILES ${LITE_ACL_DIR}/mslite_shared_lib/libmslite_shared_lib.so
949                    DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
950            if(MSLITE_ENABLE_RUNTIME_CONVERT)
951                install(FILES ${LITE_ACL_DIR}/mslite_shared_lib/libmslite_shared_lib.so
952                        DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
953                install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
954                        RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
955                install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
956            endif()
957            install(FILES ${LITE_ACL_DIR}/libascend_pass_plugin.so DESTINATION ${CONVERTER_ROOT_DIR}/lib
958                    COMPONENT ${RUNTIME_COMPONENT_NAME})
959        endif()
960
961        if(MSLITE_ENABLE_DPICO_ATC_ADAPTER)
962            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/adapter/dpico/libdpico_atc_adapter.so
963                    DESTINATION ${CONVERTER_ROOT_DIR}/providers/SD3403 COMPONENT ${RUNTIME_COMPONENT_NAME})
964            if(MSLITE_ENABLE_TOOLS)
965                install(TARGETS ${BECHCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR}
966                        COMPONENT ${RUNTIME_COMPONENT_NAME})
967            endif()
968        endif()
969
970        if(MSLITE_ENABLE_RUNTIME_GLOG)
971            install(DIRECTORY ${glog_LIBPATH}/../include/glog/ DESTINATION ${RUNTIME_INC_DIR}/third_party/glog
972                    COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
973            install(FILES ${glog_LIBPATH}/${glog_name}
974                    DESTINATION ${GLOG_DIR} RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
975        endif()
976        if(MSLITE_ENABLE_RUNTIME_CONVERT)
977            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/registry/libmslite_converter_plugin.so
978                    DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
979
980            if(MSLITE_ENABLE_OPENCV)
981                install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.2
982                        DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_core.so.4.5
983                        COMPONENT ${RUNTIME_COMPONENT_NAME})
984                install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.2
985                        DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_imgcodecs.so.4.5
986                        COMPONENT ${RUNTIME_COMPONENT_NAME})
987                install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.2
988                        DESTINATION ${RUNTIME_LIB_DIR} RENAME libopencv_imgproc.so.4.5
989                        COMPONENT ${RUNTIME_COMPONENT_NAME})
990            endif()
991        endif()
992        if(NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE))
993            __install_micro_wrapper()
994            __install_micro_codegen()
995        endif()
996    endif()
997    if(MSLITE_ENABLE_TOOLS)
998        if(MSLITE_ENABLE_GRAPH_KERNEL AND CMAKE_SYSTEM_NAME MATCHES "Linux")
999            if(EXISTS ${BUILD_DIR}/akg)
1000                set(AKG_PATH ${BUILD_DIR}/akg)
1001                file(REMOVE_RECURSE ${AKG_PATH}/build/akg/lib)
1002                install(DIRECTORY  ${AKG_PATH}/build/akg
1003                        DESTINATION ${BUILD_DIR}/package/mindspore_lite
1004                        COMPONENT ${RUNTIME_COMPONENT_NAME})
1005                install(FILES ${AKG_PATH}/${AKG_PKG_PATH}
1006                        DESTINATION ${RUNTIME_PKG_NAME}/tools/akg
1007                        COMPONENT ${RUNTIME_COMPONENT_NAME})
1008                install(FILES ${AKG_PATH}/${AKG_PKG_PATH}.sha256
1009                        DESTINATION ${RUNTIME_PKG_NAME}/tools/akg
1010                        COMPONENT ${RUNTIME_COMPONENT_NAME})
1011                install(FILES ${AKG_PATH}/build/libakg.so
1012                        DESTINATION ${BUILD_DIR}/package/mindspore_lite/lib
1013                        COMPONENT ${RUNTIME_COMPONENT_NAME})
1014            endif()
1015        endif()
1016        if(NOT MSLITE_COMPILE_TWICE)
1017            install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR}
1018                    COMPONENT ${RUNTIME_COMPONENT_NAME})
1019        endif()
1020        if(SUPPORT_TRAIN)
1021            install(TARGETS ${BENCHMARK_TRAIN_NAME} RUNTIME DESTINATION ${BENCHMARK_TRAIN_ROOT_DIR} COMPONENT
1022                    ${RUNTIME_COMPONENT_NAME})
1023        endif()
1024        if(NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE))
1025            install(TARGETS cropper RUNTIME DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1026            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/cropper/cropper_mapping_cpu.cfg
1027                DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1028            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/cropper/cropper_mapping_gpu.cfg
1029                DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1030            install(FILES ${TOP_DIR}/mindspore/lite/build/tools/cropper/cropper_mapping_npu.cfg
1031                DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1032            if(SUPPORT_TRAIN)
1033                install(FILES ${TOP_DIR}/mindspore/lite/build/tools/cropper/cropper_mapping_cpu_train.cfg
1034                    DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1035            endif()
1036        endif()
1037    endif()
1038endif()
1039
1040if(MSLITE_ENABLE_KERNEL_EXECUTOR)
1041    install(FILES
1042            ${TOP_DIR}/mindspore/core/ops/auto_generate/gen_lite_ops.h
1043            ${TOP_DIR}/mindspore/core/ops/auto_generate/gen_ops_name.h
1044            ${TOP_DIR}/mindspore/core/ops/base_operator.h
1045            ${TOP_DIR}/mindspore/core/ops/custom.h
1046            ${TOP_DIR}/mindspore/core/ops/conv2d.h
1047            ${TOP_DIR}/mindspore/core/ops/conv2d_transpose.h
1048            ${TOP_DIR}/mindspore/core/ops/max_pool.h
1049            ${TOP_DIR}/mindspore/core/ops/pad.h
1050            ${TOP_DIR}/mindspore/core/ops/topk.h
1051            DESTINATION ${RUNTIME_INC_DIR}/ops
1052            COMPONENT ${RUNTIME_COMPONENT_NAME})
1053    install(FILES
1054            ${TOP_DIR}/mindspore/core/mindapi/base/format.h
1055            ${TOP_DIR}/mindspore/core/mindapi/base/type_id.h
1056            ${TOP_DIR}/mindspore/core/mindapi/base/types.h
1057            ${TOP_DIR}/mindspore/core/mindapi/base/macros.h
1058            ${TOP_DIR}/mindspore/core/mindapi/base/shared_ptr.h
1059            ${TOP_DIR}/mindspore/core/mindapi/base/type_traits.h
1060            ${TOP_DIR}/mindspore/core/mindapi/base/base.h
1061            DESTINATION ${RUNTIME_INC_DIR}/mindapi/base
1062            COMPONENT ${RUNTIME_COMPONENT_NAME})
1063    install(FILES
1064            ${TOP_DIR}/mindspore/core/mindapi/ir/common.h
1065            ${TOP_DIR}/mindspore/core/mindapi/ir/primitive.h
1066            ${TOP_DIR}/mindspore/core/mindapi/ir/value.h
1067            DESTINATION ${RUNTIME_INC_DIR}/mindapi/ir
1068            COMPONENT ${RUNTIME_COMPONENT_NAME})
1069    install(FILES ${TOP_DIR}/mindspore/lite/src/litert/cxx_api/kernel_executor/kernel_executor.h DESTINATION
1070            ${RUNTIME_INC_DIR}/api COMPONENT ${RUNTIME_COMPONENT_NAME})
1071    install(TARGETS kernel_executor DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1072    install(TARGETS mindspore_core DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
1073    install(FILES ${glog_LIBPATH}/${glog_name} DESTINATION ${RUNTIME_LIB_DIR}
1074        RENAME libmindspore_glog.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
1075endif()
1076
1077if(CMAKE_SYSTEM_NAME MATCHES "Windows")
1078    set(CPACK_GENERATOR ZIP)
1079else()
1080    set(CPACK_GENERATOR TGZ)
1081endif()
1082
1083set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
1084set(CPACK_COMPONENTS_ALL ${RUNTIME_COMPONENT_NAME})
1085set(CPACK_PACKAGE_FILE_NAME ${PKG_NAME_PREFIX})
1086
1087if(WIN32)
1088    set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output)
1089else()
1090    set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output/tmp)
1091endif()
1092set(CPACK_PACKAGE_CHECKSUM SHA256)
1093include(CPack)
1094