Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 29855be1 authored by TAVERNIER Vincent's avatar TAVERNIER Vincent
Browse files

Parse version from changelog

parent 425387be
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,10 @@ include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
# Load lib version from debian/substvars
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/debian/substvars DEBIAN_SUBSTVARS)
string(REGEX MATCH "version=[0-9]+\\.[0-9]+\\.[0-9]+" DEBIAN_SUBSTVARS_VERSION_FIELD ${DEBIAN_SUBSTVARS})
string(REGEX REPLACE "^version=(.*)$" "\\1" ST_VERSION ${DEBIAN_SUBSTVARS_VERSION_FIELD})
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/debian/changelog DEBIAN_CHANGELOG
REGEX "^libshadertoy \\(.*\\) ")
list(GET DEBIAN_CHANGELOG 0 DEBIAN_CHANGELOG_HEAD)
string(REGEX REPLACE "^.*\\(([0-9]+\\.[0-9]+\\.[0-9]+)-.*\\).*$" "\\1" ST_VERSION ${DEBIAN_CHANGELOG_HEAD})
# Parse the version string into major, minor and patch
string(REPLACE "." ";" ST_VERSION_LIST ${ST_VERSION})
......
......@@ -4,7 +4,7 @@
LIBDIRECTORY="$(pwd)"
# Grab the current version number from the rules file
LIBVERSION=$(awk -F= 'BEGIN {ORS=""} /version/ {print $2}' "$LIBDIRECTORY/debian/substvars")
LIBVERSION=$(head -n 1 debian/changelog | awk '{gsub("[()]","",$2); print $2}')
echo "[==== BUILDING v$LIBVERSION ====]" >&2
......
version=0.1.4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment