From bb1ae2f79b80737b50464b3116294245951c7a7a Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Sat, 25 Feb 2023 18:10:28 +0800 Subject: [PATCH] refactor cmake codes that supported since cmake3.21 Signed-off-by: zhoufeng --- cmake/package_plugin.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/package_plugin.cmake b/cmake/package_plugin.cmake index 65c8c5d68e7..e45ca525df3 100644 --- a/cmake/package_plugin.cmake +++ b/cmake/package_plugin.cmake @@ -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)