File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
- ###
2
- #
3
- # Project
4
- # name and version
5
- #
6
- ###
7
- cmake_minimum_required (VERSION 3.12 FATAL_ERROR )
1
+ # The VERSION here is a placeholder; the real version is in the VERSION file.
2
+ set (VERSION 28.0.0 )
8
3
9
- project (cucumber_messages VERSION 27.0.2 LANGUAGES C CXX )
4
+ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /VERSION" )
5
+ file (STRINGS "VERSION" LINES )
6
+ list (GET LINES 0 VERSION )
7
+ endif ()
8
+
9
+ # Crude Semver parsing
10
+ if ("${VERSION} " MATCHES "^([^\\ .]+)\\ .([^\\ .]+)\\ .([^\\ .]+)$" )
11
+ set (VER_MAJOR ${CMAKE_MATCH_1} )
12
+ set (VER_MINOR ${CMAKE_MATCH_2} )
13
+ set (VER_PATCH ${CMAKE_MATCH_3} )
14
+ else ()
15
+ message (FATAL_ERROR "unable to parse version: ${VERSION} " )
16
+ endif ()
17
+
18
+ cmake_minimum_required (VERSION 3.12 FATAL_ERROR )
19
+ project (cucumber_messages VERSION ${VERSION} LANGUAGES C CXX )
10
20
11
21
###
12
22
#
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ set_target_properties(
34
34
cucumber_messages_lib
35
35
PROPERTIES
36
36
CXX_STANDARD 17
37
- VERSION 27.0.2
38
- SOVERSION 27
37
+ VERSION ${VERSION}
38
+ SOVERSION ${VER_MAJOR}
39
39
EXPORT_NAME messages
40
40
OUTPUT_NAME cucumber_messages
41
41
)
You can’t perform that action at this time.
0 commit comments