Skip to content

Commit

Permalink
Project version now read from last git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
faressc committed Jul 16, 2024
1 parent e777c22 commit d3ea078
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main
# This is needed otherwise the github.ref is not set with ref/tags/v...
tags:
- 'v*.*.*'
- '*.*.*'

# When pushing new commits, cancel any running builds on that branch
concurrency:
Expand Down
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ endif()

cmake_minimum_required(VERSION 3.15)

set (PROJECT_NAME seamless-plugin-suite)
set (PROJECT_NAME "seamless-plugin-suite")

# The top-level CMakeLists.txt file for a project must contain a literal, direct call to the
# `project()` command. `project()` sets up some helpful variables that describe source/binary
# directories, and the current project version. This is a standard CMake command.
execute_process(COMMAND git describe --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE)

project (${PROJECT_NAME} VERSION 0.0.4)
execute_process(COMMAND git describe --tags --abbrev=0
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE)

message(STATUS "Project version: ${PROJECT_VERSION_FULL}")

project(${PROJECT_NAME} VERSION ${PROJECT_VERSION_SHORT})

# Sets the cpp language minimum
set(CMAKE_CXX_STANDARD 20)
Expand Down

0 comments on commit d3ea078

Please sign in to comment.