From ab4b2c68a49d7248886429e8eb082e2890acc389 Mon Sep 17 00:00:00 2001 From: bruneton Date: Thu, 29 Aug 2013 12:19:09 +0000 Subject: [PATCH] CMake: minor: documenting NumPy detection. --- .../cmake_files/FindSalomePython.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/adm_local_without_kernel/cmake_files/FindSalomePython.cmake b/adm_local_without_kernel/cmake_files/FindSalomePython.cmake index c74ae64bd..d1ef5532a 100644 --- a/adm_local_without_kernel/cmake_files/FindSalomePython.cmake +++ b/adm_local_without_kernel/cmake_files/FindSalomePython.cmake @@ -24,7 +24,12 @@ # !! 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 @@ -136,7 +141,9 @@ IF (SALOMEPYTHON_FOUND) 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) @@ -144,9 +151,9 @@ IF (SALOMEPYTHON_FOUND) 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 -- 2.39.2