Skip to content

Commit

Permalink
add version to MSVC package
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
  • Loading branch information
Ho-Ro committed Dec 17, 2023
1 parent d9a62fe commit 814886e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CMakeListsMSVC.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,24 @@ if (GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# unstable release?
string(FIND ${VERSION} "unstable" REGULAR)
if( ${REGULAR} ) # not unstable
set( PACKAGE_VERSION ${VERSION} ) # x.y.z
else() # unstable
# add commit hash to version
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --long --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set( PACKAGE_VERSION "${VERSION}-unstable" ) # "x.y.z-p-gxxxxxxx-unstable"
endif()
endif()
message(STATUS "VERSION: ${VERSION}")

message(STATUS "VERSION: ${VERSION}")
message(STATUS "PACKAGE_VERSION: ${PACKAGE_VERSION}")

# Use CPack to make tgz/deb/rpm/zip installer packages
include(cmake/CPackInfos.cmake)
Expand Down

0 comments on commit 814886e

Please sign in to comment.