Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra version information to avrdude output #1927

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ include(FindPackageMessage)
include(GNUInstallDirs)

set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}")
set(AVRDUDE_FULL_VERSION ${CMAKE_PROJECT_VERSION})
set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}${EXTRA_VERSION_SUFFIX}")

# =====================================
# Get Git commit info
Expand Down Expand Up @@ -91,7 +91,7 @@ if(Git_FOUND)

# If the commit is not tagged, include the date and commit hash in the full version string.
if(NOT GIT_COMMIT_HASH STREQUAL GIT_TAG_HASH)
set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}-${GIT_COMMIT_DATE} (${GIT_COMMIT_HASH})")
set(AVRDUDE_FULL_VERSION "${CMAKE_PROJECT_VERSION}-${GIT_COMMIT_DATE}${EXTRA_VERSION_SUFFIX} (${GIT_COMMIT_HASH})")
endif()
endif()

Expand Down Expand Up @@ -373,6 +373,7 @@ if (DEBUG_CMAKE)
message(STATUS "CMAKE_FIND_ROOT_PATH: ${CMAKE_FIND_ROOT_PATH}")
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
message(STATUS "CONFIG_DIR: ${CONFIG_DIR}")
message(STATUS "EXTRA_VERSION_SUFFIX: ${EXTRA_VERSION_SUFFIX}")
message(STATUS "AVRDUDE_FULL_VERSION: ${AVRDUDE_FULL_VERSION}")
message(STATUS "USE_EXTERNAL_LIBS: ${USE_EXTERNAL_LIBS}")
message(STATUS "USE_LIBUSBWIN32: ${USE_LIBUSBWIN32}")
Expand Down
6 changes: 4 additions & 2 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ AC_MSG_RESULT([$PACKAGE_VERSION])
dnl Compose the full version message mirroring the cmake one, inform
dnl about it and pass it on to avrdude.conf and the "avrdude -?"
dnl version message
AC_ARG_VAR([EXTRA_VERSION_SUFFIX],
[extra version information to be appended to the version])
AC_MSG_CHECKING([versioninfo derived AVRDUDE_FULL_VERSION])
if test "x$GIT_COMMIT_HASH" = "x$GIT_TAG_HASH"; then
AVRDUDE_FULL_VERSION="$PACKAGE_VERSION"
AVRDUDE_FULL_VERSION="$PACKAGE_VERSION$EXTRA_VERSION_SUFFIX"
else
AVRDUDE_FULL_VERSION="$PACKAGE_VERSION ($GIT_COMMIT_HASH)"
AVRDUDE_FULL_VERSION="$PACKAGE_VERSION$EXTRA_VERSION_SUFFIX ($GIT_COMMIT_HASH)"
fi
AC_MSG_RESULT([$AVRDUDE_FULL_VERSION])
AC_DEFINE_UNQUOTED([AVRDUDE_FULL_VERSION], ["$AVRDUDE_FULL_VERSION"],
Expand Down
Loading