Skip to content

Commit 0a9a8aa

Browse files
Merge pull request #226 from FloatingArrayDesign/dev
v2.3.3
2 parents c3af129 + c4f9d98 commit 0a9a8aa

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.10)
22
set(MOORDYN_MAJOR_VERSION 2)
33
set(MOORDYN_MINOR_VERSION 3)
4-
set(MOORDYN_PATCH_VERSION 2)
4+
set(MOORDYN_PATCH_VERSION 3)
55
set(MOORDYN_VERSION ${MOORDYN_MAJOR_VERSION}.${MOORDYN_MINOR_VERSION})
66
project(Moordyn VERSION ${MOORDYN_VERSION})
77

wrappers/python/wheels.github/set_version.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,24 @@
2828
"""
2929

3030
# Read the version from the CMakeLists.txt
31-
version = ""
31+
version = []
3232
with open('CMakeLists.txt', 'r') as f:
3333
txt = f.read()
3434
for name in ('MAJOR', 'MINOR', 'PATCH'):
3535
prefix = 'set(MOORDYN_{}_VERSION '.format(name)
3636
subtxt = txt[txt.find(prefix) + len(prefix):]
3737
subtxt = subtxt[:subtxt.find(')\n')]
38-
version = version + subtxt + '.'
39-
version = version[:-1]
38+
version += subtxt
4039

4140

42-
with open('pyproject.toml', 'r') as f:
43-
txt = f.read()
41+
for fname in ('pyproject.toml', 'setup.py'):
42+
with open(fname, 'r') as f:
43+
txt = f.read()
4444

45-
txt = txt.replace(r"${MOORDYN_VERSION}", version)
45+
for i, name in enumerate(('MAJOR', 'MINOR', 'PATCH')):
46+
txt = txt.replace(r"${MOORDYN_" + name + r"_VERSION}", version[i])
47+
txt = txt.replace(r"${MOORDYN_VERSION}",
48+
version[0] + "." + version[1] + "." + version[2])
4649

47-
with open('pyproject.toml', 'w') as f:
48-
f.write(txt)
50+
with open(fname, 'w') as f:
51+
f.write(txt)

wrappers/python/wheels.github/setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def arefiles(files):
9090
elif platform.system() == "Darwin":
9191
# To avoid errors with std::filesystem::path
9292
extra_compile_args.append("-mmacosx-version-min=10.15")
93-
definitions = [('MoorDyn_EXPORTS', '1'),]
93+
definitions = [('MoorDyn_EXPORTS', '1'),
94+
('MOORDYN_MAJOR_VERSION', '${MOORDYN_MAJOR_VERSION}'),
95+
('MOORDYN_MINOR_VERSION', '${MOORDYN_MINOR_VERSION}'),
96+
('MOORDYN_PATCH_VERSION', '${MOORDYN_PATCH_VERSION}')]
9497
include_dirs = [MOORDYN_PATH, "vtk/include/vtk-" + vtk_version]
9598
if platform.system() == "Windows":
9699
extra_link_args = [

0 commit comments

Comments
 (0)