Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove zero padding from version #377

Merged
merged 1 commit into from
Jul 10, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Removed
- Remove parallel from target options [#347](https://github.com/greenbone/gvm-libs/pull/347)
- Remove zero padding from version [#377](https://github.com/greenbone/gvm-libs/pull/377)

[20.08]: https://github.com/greenbone/gvm-libs/compare/gvm-libs-11.0...gvm-libs-20.08

Expand Down
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,14 @@ if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
endif (EXISTS "${CMAKE_SOURCE_DIR}/.git/")
endif (NOT CMAKE_BUILD_TYPE MATCHES "Release")

# Add padding zero for minor version
string(LENGTH ${PROJECT_VERSION_MINOR} PROJECT_VERSION_MINOR_LENGTH)
if (${PROJECT_VERSION_MINOR_LENGTH} GREATER 1)
set (PROJECT_VERSION_MINOR_STRING "${PROJECT_VERSION_MINOR}")
else (${PROJECT_VERSION_MINOR_LENGTH} GREATER 1)
set (PROJECT_VERSION_MINOR_STRING "0${PROJECT_VERSION_MINOR}")
endif (${PROJECT_VERSION_MINOR_LENGTH} GREATER 1)

# If a patch version is not defined, assume a pre-release
if (DEFINED PROJECT_VERSION_PATCH AND NOT PROJECT_VERSION_PATCH STREQUAL "")
set (PROJECT_VERSION_SUFFIX ".${PROJECT_VERSION_PATCH}")
else (DEFINED PROJECT_VERSION_PATCH AND NOT PROJECT_VERSION_PATCH STREQUAL "")
set (PROJECT_VERSION_SUFFIX "+beta1")
endif (DEFINED PROJECT_VERSION_PATCH AND NOT PROJECT_VERSION_PATCH STREQUAL "")

set (PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR_STRING}${PROJECT_VERSION_SUFFIX}${GIT_REVISION}")
set (PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}${PROJECT_VERSION_SUFFIX}${GIT_REVISION}")

## CPack configuration

Expand Down