# !! Please read the generic detection procedure in SalomeMacros.cmake !!
#
# The interpreter is found first, and if OK, the corresponding libraries are searched.
-# We ensure the version of the libraries matches the one of the interpreter.
+# We ensure the version of the libraries matches the one of the interpreter.
+#
+# We also look for an installation of NumPy, and if found the following variables are set
+# NUMPY_INCLUDE_DIR - NumPy header location
+# NUMPY_DEFINITIONS - compiler flag
+# and are automatically appended to PYTHON_INCLUDE_DIRS (and PYTHON_DEFINITIONS resp.)
#
# 1. Load environment or any previously detected Python
ENDIF()
# 6. Specifics
-
+ #
+
+ # NumPy detection
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET )
IF(NUMPY_INCLUDE_DIR)
SET(NUMPY_FOUND TRUE)
IF(NUMPY_FOUND)
SET(PYTHON_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})
SET(PYTHON_DEFINITIONS "${PYTHON_DEFINITIONS} -DWITH_NUMPY")
- MESSAGE(STATUS "numpy found : ${NUMPY_INCLUDE_DIR}")
+ MESSAGE(STATUS "NumPy found : ${NUMPY_INCLUDE_DIR}")
ELSE(NUMPY_FOUND)
- MESSAGE(STATUS "numpy not found")
+ MESSAGE(STATUS "NumPy not found.")
ENDIF(NUMPY_FOUND)
## None here