refactor cmake codes that supported since cmake3.21

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2023-02-25 18:10:28 +08:00
parent 7af0370e78
commit bb1ae2f79b
1 changed files with 5 additions and 6 deletions

View File

@ -114,12 +114,11 @@ if(ENABLE_AKG AND CMAKE_SYSTEM_NAME MATCHES "Linux")
endif()
if(ENABLE_SYM_FILE)
set(CPACK_CUSTOM_INSTALL_VARIABLES)
list(APPEND CPACK_CUSTOM_INSTALL_VARIABLES MS_PACK_ROOT_DIR=${CPACK_PACKAGE_DIRECTORY})
list(APPEND CPACK_CUSTOM_INSTALL_VARIABLES
MS_INSTALL_DIR=${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/${CMAKE_HOST_SYSTEM_NAME}/${CPACK_GENERATOR})
list(APPEND CPACK_CUSTOM_INSTALL_VARIABLES MS_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME})
install(SCRIPT ${CMAKE_SOURCE_DIR}/cmake/plugin_debuginfo_script.cmake)
install(CODE "\
execute_process(COMMAND ${CMAKE_COMMAND} -DMS_PACK_ROOT_DIR=${CPACK_PACKAGE_DIRECTORY} \
-DMS_INSTALL_DIR=${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/${CMAKE_HOST_SYSTEM_NAME}/${CPACK_GENERATOR} \
-DMS_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} -P${CMAKE_SOURCE_DIR}/cmake/plugin_debuginfo_script.cmake)"
)
endif()
include(CPack)