Skip to content

CPack: Restore support for 0-valued version components

In !2020 (merged) we did not account for the value of CMAKE_PROJECT_VERSION_{MAJOR,MINOR,PATCH} having 0. Fix the logic to distinguish between unprovided version components and 0 components.

While at it, add a test case covering the behavior described in the documentation by the original commit. The number of version components in the package name should match those provided to the project() command VERSION option.

Fixes: #18199 (closed)

Merge request reports