blob: f6cf4425551c344556a7e7e9efda702acd37e05c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
diff --git a/python/bindings/CMakeLists.txt b/python/bindings/CMakeLists.txt
index f2233cf..3252313 100644
--- a/python/bindings/CMakeLists.txt
+++ b/python/bindings/CMakeLists.txt
@@ -5,6 +5,22 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
+# Find the Python interpreter
+find_package(Python REQUIRED COMPONENTS Interpreter)
+
+# Execute Python to get the NumPy include directory
+execute_process(
+ COMMAND ${Python_EXECUTABLE} -c "import numpy; print(numpy.get_include())"
+ OUTPUT_VARIABLE NUMPY_INCLUDE_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+# Print the path to verify it works during configuration
+message(STATUS "NumPy include directory: ${NUMPY_INCLUDE_DIR}")
+
+# Include the directory globally or link it to your target
+include_directories(${NUMPY_INCLUDE_DIR})
+
GR_PYTHON_CHECK_MODULE_RAW(
"pygccxml"
"import pygccxml"
|