Skip to content

Commit 0c86ca2

Browse files
robUx4jbkempf
authored andcommitted
CMake: get the release version from the meson file
1 parent ecaf986 commit 0c86ca2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
cmake_minimum_required(VERSION 3.23)
22

3-
project(spatialaudio VERSION 0.4.0)
3+
# Get the version from the meson file
4+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/meson.build CONTENT)
5+
string(REGEX MATCH " version : '([0-9]+).([0-9]+).([0-9]+)'" VERSION_REGEX "${CONTENT}")
6+
set(MESON_RELEASE_VERSION_MAJOR ${CMAKE_MATCH_1})
7+
set(MESON_RELEASE_VERSION_MINOR ${CMAKE_MATCH_2})
8+
set(MESON_RELEASE_VERSION_PATCH ${CMAKE_MATCH_3})
9+
10+
project(spatialaudio VERSION ${MESON_RELEASE_VERSION_MAJOR}.${MESON_RELEASE_VERSION_MINOR}.${MESON_RELEASE_VERSION_PATCH})
411

512
# Options
613
option(BUILD_SHARED_LIBS "Build shared instead of static libraries" ON)

0 commit comments

Comments
 (0)