Skip to content

Commit

Permalink
redo get version from version.h
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeJarre committed Mar 13, 2024
1 parent b06d8d4 commit 4a8f90e
Show file tree
Hide file tree
Showing 28 changed files with 148 additions and 59 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/libpinmame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
revision: ${{ steps.version.outputs.revision }}
sha: ${{ steps.version.outputs.sha }}
sha7: ${{ steps.version.outputs.sha7 }}
tag: ${{ steps.version.outputs.tag }}
steps:
Expand All @@ -26,11 +27,14 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}-${REVISION}-${SHA7}"
TAG="${VERSION}.${VERSION_REV}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pinmame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
revision: ${{ steps.version.outputs.revision }}
sha: ${{ steps.version.outputs.sha }}
sha7: ${{ steps.version.outputs.sha7 }}
tag: ${{ steps.version.outputs.tag }}
steps:
Expand All @@ -26,12 +27,17 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA7="${GITHUB_SHA::7}"
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pinmame32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
revision: ${{ steps.version.outputs.revision }}
sha: ${{ steps.version.outputs.sha }}
sha7: ${{ steps.version.outputs.sha7 }}
tag: ${{ steps.version.outputs.tag }}
steps:
Expand All @@ -26,12 +27,17 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA7="${GITHUB_SHA::7}"
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..${{ steps.sha.outputs.sha }} --count)
SHA="${GITHUB_SHA}"
echo "tag=${VERSION}-${REVISION}-${{ steps.sha.outputs.sha7 }}" >> $GITHUB_OUTPUT
prerelease:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/vpinmame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
name: Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
revision: ${{ steps.version.outputs.revision }}
sha: ${{ steps.version.outputs.sha }}
sha7: ${{ steps.version.outputs.sha7 }}
tag: ${{ steps.version.outputs.tag }}
steps:
Expand All @@ -25,11 +27,17 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA7="${GITHUB_SHA::7}"
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/xpinmame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ jobs:
fetch-depth: 0
- id: version
run: |
VERSION=$(grep -Eo "[0-9\.]+" src/version.c | head -1)
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion checklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Important steps to take before a release:
- check the date, year and version in all .txt files!
(bugs.txt, license.txt (and its copy LICENSE), pinmame.txt (and its derived README.md), visual pinmame.txt, whatsnew.txt, whatsnewVPM.txt)
- remove the DEBUG define in the makefile (which is probably not there anyway)!
- edit "src/version.c" for the correct version number
- edit "src/version.h" for the correct version number
- edit "src/ui/PinMAME32.rc" for the correct version number and copyright years
- edit "src/win32com/VPinMAME.cpp" for the expiration date (=next desired release date) (currently: none)
- edit "src/win32com/VPinMAME.rc" for the correct version number, copyright years and build (MinDependency)
Expand Down
6 changes: 4 additions & 2 deletions cmake/instvpm/CMakeLists_win-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})
set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(instvpm VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/instvpm/CMakeLists_win-x86.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(instvpm VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_android-arm64-v8a.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 30)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_ios-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ cmake_minimum_required(VERSION 3.16)

set(CMAKE_SYSTEM_NAME iOS)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_linux-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_osx-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ cmake_minimum_required(VERSION 3.16)
option(BUILD_SHARED "Build shared library" ON)
option(BUILD_STATIC "Build static library" ON)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_osx-x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ cmake_minimum_required(VERSION 3.16)
option(BUILD_SHARED "Build shared library" ON)
option(BUILD_STATIC "Build static library" ON)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_tvos-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ cmake_minimum_required(VERSION 3.16)

set(CMAKE_SYSTEM_NAME tvOS)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_win-arm64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_win-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/libpinmame/CMakeLists_win-x86.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/pinmame/CMakeLists_win-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/pinmame/CMakeLists_win-x86.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/pinmame32/CMakeLists_win-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame32 VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/pinmame32/CMakeLists_win-x86.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(pinmame32 VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/vpinmame/CMakeLists_win-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(vpinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/vpinmame/CMakeLists_win-x86.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(vpinmame VERSION ${PROJECT_VERSION})

Expand Down
7 changes: 5 additions & 2 deletions cmake/xpinmame/CMakeLists_linux-x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.16)

file(READ src/version.c version)
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${version})
file(READ src/version.h version)
string(REGEX MATCH "#define VERSION_MAJOR +([0-9]+).*#define VERSION_MINOR +([0-9]+).*#define VERSION_REV +([0-9]+)" _ ${version})

set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
message("PROJECT_VERSION=${PROJECT_VERSION}")

project(xpinmame VERSION ${PROJECT_VERSION})

Expand Down
Loading

0 comments on commit 4a8f90e

Please sign in to comment.