From ad3fcbe7cfd0e48c452db639493ad0a3827ecf94 Mon Sep 17 00:00:00 2001 From: Eric Norige <127622562+eanorige@users.noreply.github.com> Date: Thu, 15 Feb 2024 08:35:37 -0800 Subject: [PATCH] Auto-configure python path for cmake (#29) --- pysv/compile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pysv/compile.py b/pysv/compile.py index d76f424..a0e3cd2 100644 --- a/pysv/compile.py +++ b/pysv/compile.py @@ -4,6 +4,7 @@ import shutil import platform import filecmp +import sys def compile_lib(func_defs, cwd, lib_name="pysv", pretty_print=True, release_build=False, clean_up_build=False, @@ -61,6 +62,8 @@ def compile_lib(func_defs, cwd, lib_name="pysv", pretty_print=True, release_buil cmake_args.append("-DCMAKE_BUILD_TYPE=" + build_type) # add header definition cmake_args.append("-DDPI_HEADER_DIR=" + vlstd_path) + # tell cmake where to find python (in case it's not in the system path) + cmake_args.append("-DPYTHON_EXECUTABLE=" + sys.executable) subprocess.check_call(["cmake"] + cmake_args + [".."], cwd=build_dir) # built it!