Skip to content

Commit dc55d1e

Browse files
committed
use python to copy mutation data
1 parent 3e30b1c commit dc55d1e

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

SU2_PY/copy_directory.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python
2+
# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md)
3+
4+
import sys
5+
import os
6+
import shutil
7+
8+
if __name__ == "__main__":
9+
src = os.path.abspath(sys.argv[1])
10+
dst = os.path.abspath(sys.argv[2])
11+
shutil.copytree(src, dst)

meson.build

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ if get_option('enable-mpp')
238238
cmake_opts = cmake.subproject_options()
239239
cmake_opts.set_override_option('warning_level', '0')
240240
cmake_opts.add_cmake_defines({
241-
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
241+
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
242242
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
243243
})
244244
cmake_opts.set_install(get_option('install-mpp'))
@@ -249,8 +249,11 @@ if get_option('enable-mpp')
249249
su2_cpp_args += '-DHAVE_MPP'
250250

251251
if get_option('install-mpp')
252-
run_command('cp', '-r', join_paths(meson.source_root(), '/subprojects/Mutationpp/data'),
253-
join_paths(get_option('prefix'), '/mpp-data'), check: true)
252+
py = find_program('python3', 'python')
253+
p = run_command(py, 'SU2_PY/copy_directory.py', 'subprojects/Mutationpp/data', join_paths(get_option('prefix'), 'mpp-data'))
254+
if p.returncode() != 0
255+
error(p.stderr())
256+
endif
254257
endif
255258
endif
256259

@@ -261,7 +264,7 @@ if get_option('enable-coolprop')
261264
cmake_opts.set_override_option('warning_level', '0')
262265
cmake_opts.add_cmake_defines({
263266
'COOLPROP_STATIC_LIBRARY': true,
264-
'CMAKE_MAKE_PROGRAM': meson.source_root() + '/ninja',
267+
'CMAKE_MAKE_PROGRAM': join_paths(meson.project_source_root(), 'ninja'),
265268
'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'
266269
})
267270
coolprop_subproj = cmake.subproject('CoolProp', options: cmake_opts)

0 commit comments

Comments
 (0)