diff --git a/src/gt4py/next/otf/compilation/build_systems/cmake_lists.py b/src/gt4py/next/otf/compilation/build_systems/cmake_lists.py index 0533adac81..23c80793c7 100644 --- a/src/gt4py/next/otf/compilation/build_systems/cmake_lists.py +++ b/src/gt4py/next/otf/compilation/build_systems/cmake_lists.py @@ -88,9 +88,15 @@ def visit_FindDependency(self, dep: FindDependency) -> str: # Instead, design this to be extensible (refer to ADR-0016). match dep.name: case "nanobind": + import sys + import nanobind - py = "find_package(Python COMPONENTS Interpreter Development REQUIRED)" + py = f""" + set(Python_EXECUTABLE {sys.executable}) + + find_package(Python COMPONENTS Interpreter Development REQUIRED) + """ nb = f"find_package(nanobind CONFIG REQUIRED PATHS {nanobind.cmake_dir()} NO_DEFAULT_PATHS)" return py + "\n" + nb case "gridtools_cpu" | "gridtools_gpu":