2020-08-18 21:01:18 +08:00
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
|
2020-12-14 20:42:42 +08:00
|
|
|
set(RUNTIME_PKG_NAME ${MAIN_DIR}-${RUNTIME_COMPONENT_NAME})
|
2020-10-23 09:18:55 +08:00
|
|
|
|
2021-03-12 16:42:55 +08:00
|
|
|
set(CODEGEN_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/codegen)
|
|
|
|
set(CONVERTER_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/converter)
|
|
|
|
set(CROPPER_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/cropper)
|
2020-08-18 21:01:18 +08:00
|
|
|
|
2021-03-12 16:42:55 +08:00
|
|
|
if(SUPPORT_TRAIN)
|
|
|
|
set(RUNTIME_DIR ${RUNTIME_PKG_NAME}/train)
|
|
|
|
set(RUNTIME_INC_DIR ${RUNTIME_PKG_NAME}/train/include)
|
|
|
|
set(RUNTIME_LIB_DIR ${RUNTIME_PKG_NAME}/train/lib)
|
|
|
|
set(MIND_DATA_INC_DIR ${RUNTIME_PKG_NAME}/train/minddata/include)
|
|
|
|
set(MIND_DATA_LIB_DIR ${RUNTIME_PKG_NAME}/train/minddata/lib)
|
|
|
|
set(TURBO_DIR ${RUNTIME_PKG_NAME}/train/minddata/third_party/libjpeg-turbo)
|
2021-03-31 19:13:38 +08:00
|
|
|
set(MINDSPORE_LITE_LIB_NAME libmindspore-lite-train)
|
|
|
|
set(BENCHMARK_NAME benchmark_train)
|
|
|
|
set(BENCHMARK_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/benchmark_train)
|
2021-03-12 16:42:55 +08:00
|
|
|
else()
|
|
|
|
set(RUNTIME_DIR ${RUNTIME_PKG_NAME}/inference)
|
|
|
|
set(RUNTIME_INC_DIR ${RUNTIME_PKG_NAME}/inference/include)
|
|
|
|
set(RUNTIME_LIB_DIR ${RUNTIME_PKG_NAME}/inference/lib)
|
|
|
|
set(MIND_DATA_INC_DIR ${RUNTIME_PKG_NAME}/inference/minddata/include)
|
|
|
|
set(MIND_DATA_LIB_DIR ${RUNTIME_PKG_NAME}/inference/minddata/lib)
|
|
|
|
set(TURBO_DIR ${RUNTIME_PKG_NAME}/inference/minddata/third_party/libjpeg-turbo)
|
2021-03-31 19:13:38 +08:00
|
|
|
set(MINDSPORE_LITE_LIB_NAME libmindspore-lite)
|
|
|
|
set(BENCHMARK_NAME benchmark)
|
|
|
|
set(BENCHMARK_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/benchmark)
|
2021-03-12 16:42:55 +08:00
|
|
|
endif()
|
2020-08-18 21:01:18 +08:00
|
|
|
|
2021-02-02 11:15:58 +08:00
|
|
|
if(BUILD_MINDDATA STREQUAL "full")
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/liteapi/include/ DESTINATION
|
2021-04-02 14:44:52 +08:00
|
|
|
${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
|
|
|
|
if(PLATFORM_ARM64)
|
|
|
|
file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so)
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so
|
2021-04-02 14:44:52 +08:00
|
|
|
DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
elseif(PLATFORM_ARM32)
|
|
|
|
file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so)
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION
|
2021-04-02 14:44:52 +08:00
|
|
|
${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
else()
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION
|
2021-04-02 14:44:52 +08:00
|
|
|
${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib
|
2021-04-02 14:44:52 +08:00
|
|
|
RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib
|
2021-04-02 14:44:52 +08:00
|
|
|
RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-02-02 11:15:58 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(BUILD_MINDDATA STREQUAL "wrapper")
|
2021-01-14 19:21:29 +08:00
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/ DESTINATION ${MIND_DATA_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "vision.h" EXCLUDE)
|
|
|
|
if(PLATFORM_ARM64)
|
2020-12-11 10:48:03 +08:00
|
|
|
file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so)
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2020-12-14 20:42:42 +08:00
|
|
|
install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
elseif(PLATFORM_ARM32)
|
2020-12-11 10:48:03 +08:00
|
|
|
file(GLOB JPEGTURBO_LIB_LIST ${jpeg_turbo_LIBPATH}/*.so)
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2020-12-14 20:42:42 +08:00
|
|
|
install(FILES ${JPEGTURBO_LIB_LIST} DESTINATION ${TURBO_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
else()
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-04-02 14:44:52 +08:00
|
|
|
install(FILES ${jpeg_turbo_LIBPATH}/libjpeg.so.62.3.0 DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${jpeg_turbo_LIBPATH}/libturbojpeg.so.0.2.0 DESTINATION ${TURBO_DIR}/lib RENAME libturbojpeg.so.0
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-08-18 21:01:18 +08:00
|
|
|
|
2021-01-14 19:21:29 +08:00
|
|
|
if(BUILD_MINDDATA STREQUAL "lite")
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/include/ DESTINATION ${MIND_DATA_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
if(PLATFORM_ARM64)
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so DESTINATION ${TURBO_DIR}/lib
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so DESTINATION ${TURBO_DIR}/lib
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
elseif(PLATFORM_ARM32)
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so DESTINATION ${TURBO_DIR}/lib
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so DESTINATION ${TURBO_DIR}/lib
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
else()
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libjpeg.so.62.3.0
|
|
|
|
DESTINATION ${TURBO_DIR}/lib RENAME libjpeg.so.62 COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/third_party/libjpeg-turbo/lib/libturbojpeg.so.0.2.0
|
|
|
|
DESTINATION ${TURBO_DIR}/lib RENAME libturbojpeg.so.0 COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-08-25 18:13:32 +08:00
|
|
|
|
2021-01-14 19:21:29 +08:00
|
|
|
if(BUILD_MINDDATA STREQUAL "lite_cv")
|
|
|
|
if(PLATFORM_ARM64)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
|
|
|
|
DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so
|
|
|
|
DESTINATION ${MIND_DATA_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
elseif(PLATFORM_ARM32)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
|
|
|
|
DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
else()
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv
|
|
|
|
DESTINATION ${MIND_DATA_INC_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/minddata/libminddata-lite.so DESTINATION ${MIND_DATA_LIB_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-08-25 18:13:32 +08:00
|
|
|
|
2021-03-12 16:42:55 +08:00
|
|
|
if(WIN32)
|
|
|
|
install(FILES ${TOP_DIR}/build/.commit_id DESTINATION ${RUNTIME_PKG_NAME}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
else()
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/.commit_id DESTINATION ${RUNTIME_PKG_NAME}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-12 16:42:55 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(PLATFORM_ARM64)
|
2021-01-14 19:21:29 +08:00
|
|
|
if(SUPPORT_NPU)
|
2021-03-12 16:42:55 +08:00
|
|
|
install(FILES ${DDK_LIB_PATH}/libhiai.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-12 16:42:55 +08:00
|
|
|
install(FILES ${DDK_LIB_PATH}/libhiai_ir.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-12 16:42:55 +08:00
|
|
|
install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2020-12-07 18:50:07 +08:00
|
|
|
endif()
|
2021-01-14 19:21:29 +08:00
|
|
|
if(SUPPORT_TRAIN)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
else()
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
|
|
|
endif()
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-26 17:06:34 +08:00
|
|
|
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
|
2021-03-18 21:01:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
|
2021-04-08 16:02:36 +08:00
|
|
|
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
|
2021-04-02 14:44:52 +08:00
|
|
|
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
if(ENABLE_TOOLS)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
|
|
|
elseif(PLATFORM_ARM32)
|
|
|
|
if(SUPPORT_TRAIN)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
else()
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
|
|
|
endif()
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-26 17:06:34 +08:00
|
|
|
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
|
2021-03-18 21:01:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
|
2021-04-08 16:02:36 +08:00
|
|
|
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
|
2021-04-02 14:44:52 +08:00
|
|
|
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
if(ENABLE_TOOLS)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
|
|
|
elseif(WIN32)
|
2020-08-24 15:47:32 +08:00
|
|
|
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
|
2021-01-14 19:21:29 +08:00
|
|
|
file(GLOB LIB_LIST ${CXX_DIR}/libstdc++-6.dll ${CXX_DIR}/libwinpthread-1.dll
|
2021-04-19 09:23:19 +08:00
|
|
|
${CXX_DIR}/libssp-0.dll ${CXX_DIR}/libgcc_s_*-1.dll)
|
2021-01-14 19:21:29 +08:00
|
|
|
if(ENABLE_CONVERTER)
|
2021-03-12 16:42:55 +08:00
|
|
|
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${LIB_LIST} DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/build/mindspore/tools/converter/mindspore_core/gvar/libmindspore_gvar.dll
|
2021-03-12 16:42:55 +08:00
|
|
|
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(FILES ${glog_LIBPATH}/../bin/libglog.dll DESTINATION ${CONVERTER_ROOT_DIR}/lib
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(TARGETS codegen RUNTIME DESTINATION ${CODEGEN_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
|
|
|
if(ENABLE_TOOLS)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
2021-03-12 16:42:55 +08:00
|
|
|
install(FILES ${LIB_LIST} DESTINATION ${RUNTIME_LIB_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(DIRECTORY ${flatbuffers_INC} DESTINATION ${RUNTIME_INC_DIR}/third_party/
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
if(SUPPORT_TRAIN)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
else()
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
|
|
|
endif()
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
|
2021-03-18 21:01:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
2021-03-12 16:42:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll.a DESTINATION ${RUNTIME_LIB_DIR}
|
2021-03-12 16:42:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/build/mindspore/src/${MINDSPORE_LITE_LIB_NAME}.dll DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-12 16:42:55 +08:00
|
|
|
else()
|
2021-01-14 19:21:29 +08:00
|
|
|
if(SUPPORT_TRAIN)
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
else()
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/include/ DESTINATION ${RUNTIME_INC_DIR}
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "train*" EXCLUDE)
|
|
|
|
endif()
|
|
|
|
install(FILES ${TOP_DIR}/mindspore/core/ir/dtype/type_id.h DESTINATION ${RUNTIME_INC_DIR}/ir/dtype
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-26 17:06:34 +08:00
|
|
|
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
|
2021-03-18 21:01:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.so DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-31 19:13:38 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/src/${MINDSPORE_LITE_LIB_NAME}.a DESTINATION ${RUNTIME_LIB_DIR}
|
2021-01-14 19:21:29 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
if(ENABLE_CONVERTER)
|
2021-03-12 16:42:55 +08:00
|
|
|
install(TARGETS converter_lite RUNTIME DESTINATION ${CONVERTER_ROOT_DIR}/converter
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/converter/mindspore_core/gvar/libmindspore_gvar.so
|
2021-03-12 16:42:55 +08:00
|
|
|
DESTINATION ${CONVERTER_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${glog_LIBPATH}/libglog.so.0.4.0
|
2021-03-12 16:42:55 +08:00
|
|
|
DESTINATION ${CONVERTER_ROOT_DIR}/third_party/glog/lib RENAME libglog.so.0
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-04-08 16:02:36 +08:00
|
|
|
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
|
2021-04-02 14:44:52 +08:00
|
|
|
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
2021-04-08 16:02:36 +08:00
|
|
|
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
|
2021-04-02 14:44:52 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
set(MICRO_CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis/CMSIS)
|
|
|
|
install(DIRECTORY ${MICRO_CMSIS_DIR}/Core/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/Core
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(DIRECTORY ${MICRO_CMSIS_DIR}/DSP/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/DSP
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(DIRECTORY ${MICRO_CMSIS_DIR}/NN/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/NN
|
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
|
|
|
|
install(TARGETS cmsis_nn ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/third_party/lib
|
2021-03-12 16:42:55 +08:00
|
|
|
COMPONENT ${RUNTIME_COMPONENT_NAME})
|
|
|
|
install(TARGETS codegen RUNTIME DESTINATION ${CODEGEN_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
|
|
|
if(ENABLE_TOOLS)
|
2021-03-31 19:13:38 +08:00
|
|
|
install(TARGETS ${BENCHMARK_NAME} RUNTIME DESTINATION ${BENCHMARK_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-03-12 16:42:55 +08:00
|
|
|
install(TARGETS cropper RUNTIME DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
install(FILES ${TOP_DIR}/mindspore/lite/build/tools/cropper/cropper_mapping_cpu.cfg
|
2021-03-12 16:42:55 +08:00
|
|
|
DESTINATION ${CROPPER_ROOT_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME})
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2020-08-18 21:01:18 +08:00
|
|
|
|
2021-01-14 19:21:29 +08:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
2020-08-24 15:47:32 +08:00
|
|
|
set(CPACK_GENERATOR ZIP)
|
2021-01-14 19:21:29 +08:00
|
|
|
else()
|
2020-08-24 15:47:32 +08:00
|
|
|
set(CPACK_GENERATOR TGZ)
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
2021-03-12 16:42:55 +08:00
|
|
|
|
2020-08-18 21:01:18 +08:00
|
|
|
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
2021-03-12 16:42:55 +08:00
|
|
|
set(CPACK_COMPONENTS_ALL ${RUNTIME_COMPONENT_NAME})
|
2020-08-18 21:01:18 +08:00
|
|
|
set(CPACK_PACKAGE_FILE_NAME ${MAIN_DIR})
|
2021-03-12 16:42:55 +08:00
|
|
|
|
2021-01-14 19:21:29 +08:00
|
|
|
if(WIN32)
|
2020-08-26 14:13:58 +08:00
|
|
|
set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output)
|
2021-01-14 19:21:29 +08:00
|
|
|
else()
|
2020-08-26 14:13:58 +08:00
|
|
|
set(CPACK_PACKAGE_DIRECTORY ${TOP_DIR}/output/tmp)
|
2021-01-14 19:21:29 +08:00
|
|
|
endif()
|
2020-08-18 21:01:18 +08:00
|
|
|
set(CPACK_PACKAGE_CHECKSUM SHA256)
|
2020-09-01 09:49:35 +08:00
|
|
|
include(CPack)
|