diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 767d1336c..7dbcea7bc 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -122,12 +122,13 @@ if(NOT CPACK_PACKAGE_VERSION) endif() endif() +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") if (ZENOHC_CUSTOM_TARGET) string(REPLACE "-" ";" CUSTOM_TARGET_LIST ${ZENOHC_CUSTOM_TARGET}) - list(GET CUSTOM_TARGET_LIST 3 TARGET) - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-${TARGET}") -else() - set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") + if (list(LENGTH CUSTOM_TARGET_LIST) == 4) + list(GET CUSTOM_TARGET_LIST 3 TARGET) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}-${TARGET}") + endif() endif() if(NOT DEBARCH)