File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 3
3
4
4
cmake_minimum_required (VERSION 3.17)
5
5
6
- project (
7
- tuv-x
8
- VERSION 0.12.0
9
- LANGUAGES Fortran CXX C
10
- )
6
+ # project and version must be on the same line so that the docs can extract it
7
+ project (tuv-x VERSION 0.12.0 LANGUAGES Fortran CXX C)
11
8
12
9
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
13
10
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} ;${PROJECT_SOURCE_DIR} /cmake" )
Original file line number Diff line number Diff line change 13
13
import os
14
14
import sys
15
15
import datetime
16
+ import re
16
17
sys .path .insert (0 , os .path .abspath ('.' ))
17
18
18
19
from generate_logo import make_logo
25
26
26
27
suffix = os .getenv ("SWITCHER_SUFFIX" , "" )
27
28
28
- # The full version, including alpha/beta/rc tags
29
- release = f'v0.12.0{ suffix } '
29
+ # the suffix is required. This is controlled by the dockerfile that builds the docs
30
+ regex = r'project\(.*VERSION\s+(\d+\.\d+\.\d+)'
31
+ version = '0.0.0'
32
+ # read the version from the cmake files
33
+ with open (f'../../CMakeLists.txt' , 'r' ) as f :
34
+ for line in f :
35
+ match = re .match (regex , line )
36
+ if match :
37
+ version = match .group (1 )
38
+ release = f'v{ version } { suffix } '
30
39
31
40
32
41
# -- General configuration ---------------------------------------------------
You can’t perform that action at this time.
0 commit comments