Skip to content

Commit

Permalink
generate release information for metainfo file from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch authored and patrickelectric committed Oct 21, 2023
1 parent b149ed2 commit 187f43f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,13 @@ install(
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/
RENAME org.mavlink.qgroundcontrol.png
)
configure_file(
${CMAKE_SOURCE_DIR}/deploy/org.mavlink.qgroundcontrol.metainfo.xml.in
${CMAKE_BINARY_DIR}/metainfo/org.mavlink.qgroundcontrol.metainfo.xml
@ONLY
)
install(
FILES ${CMAKE_SOURCE_DIR}/deploy/org.mavlink.qgroundcontrol.metainfo.xml
FILES ${CMAKE_BINARY_DIR}/metainfo/org.mavlink.qgroundcontrol.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo/
)

Expand Down
10 changes: 10 additions & 0 deletions cmake/Git.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE APP_VERSION_STR
OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE REL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)

execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%aI ${REL_VERSION}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE REL_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

<content_rating type="oars-1.1" />

<releases>
<release date="@REL_DATE@" version="@REL_VERSION@"/>
</releases>

<launchable type="desktop-id">org.mavlink.qgroundcontrol.desktop</launchable>
<screenshots>
<screenshot type="default">
Expand Down

0 comments on commit 187f43f

Please sign in to comment.