Skip to content

Commit 2baf233

Browse files
authored
Merge pull request #166 from mmomtchev/project-version-from-file
get the project version from a `VERSION` file
2 parents a74a1da + c40bf39 commit 2baf233

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
cmake_minimum_required (VERSION 3.19)
22

3-
# Declare here
4-
set (AVCPP_VERSION 3.0.1)
3+
# Declare the version version.txt
4+
file(READ "VERSION.txt" AVCPP_VERSION)
5+
string(STRIP "${AVCPP_VERSION}" AVCPP_VERSION)
56

67
if(NOT DEFINED PROJECT_NAME)
78
set(AVCPP_NOT_SUBPROJECT ON)

VERSION.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.2

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project(
66
'c_std=c11',
77
'cpp_std=c++20'
88
],
9-
version: '2.4.0',
9+
version: files('VERSION.txt'),
1010
)
1111

1212
subdir('src/avcpp')

src/avcpp/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if meson.project_name() == ''
77
'c_std=c11',
88
'cpp_std=c++20'
99
],
10-
version: '2.4.0',
10+
version: files('VERSION.txt'),
1111
)
1212
endif
1313

0 commit comments

Comments
 (0)