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 f221134
Showing 1 changed file with 13 additions and 5 deletions.
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 f221134

Please sign in to comment.