From 70e6ef4b7b49f052c00fa033d6d06bfaa772ae27 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 22 Aug 2022 21:47:08 +0200 Subject: [PATCH] Avoid redundant definition of appstream file path --- cmake/modules/AppTarget.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/modules/AppTarget.cmake b/cmake/modules/AppTarget.cmake index 66681c8..28c37b7 100644 --- a/cmake/modules/AppTarget.cmake +++ b/cmake/modules/AppTarget.cmake @@ -270,11 +270,14 @@ function (add_desktop_file) # add indentation of two additional spaces string(REGEX REPLACE "\n([^$])" "\n \\1" META_APP_APPDATA_BODY "${META_APP_APPDATA_BODY}") endif () + # create appstream desktop file from template - configure_file("${APP_APPSTREAM_TEMPLATE_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/resources/${META_ID}.appdata.xml" @ONLY) + set(APPSTREAM_FILE "${CMAKE_CURRENT_BINARY_DIR}/resources/${META_ID}.appdata.xml") + configure_file("${APP_APPSTREAM_TEMPLATE_FILE}" "${APPSTREAM_FILE}" @ONLY) + # add install for the appstream file install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/resources/${META_ID}.appdata.xml" + FILES "${APPSTREAM_FILE}" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" COMPONENT appimage) endfunction ()