File: FindNUMPY.cmake

package info (click to toggle)
coda 2.21.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,320 kB
  • sloc: ansic: 125,785; javascript: 6,732; java: 2,391; yacc: 1,007; python: 872; makefile: 615; lex: 204; sh: 99; fortran: 60; xml: 5
file content (14 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Find the Python numpy module development files for CODA
#
# This module defines:
#
# - NUMPY_FOUND - if the numpy module was found
# - NUMPY_INCLUDE_DIR - where to find numpy/ndarrayobject.h etc.
#

execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; import os; p = [p for p in sys.path if os.path.exists(os.path.join(p, 'numpy'))]; sys.stdout.write(os.path.join(p[0], 'numpy') if len(p) > 0 else '')" OUTPUT_VARIABLE NUMPY_INSTALL_PREFIX)

find_path(NUMPY_INCLUDE_DIR numpy/ndarrayobject.h PATHS "${NUMPY_INSTALL_PREFIX}/core/include" NO_DEFAULT_PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NUMPY DEFAULT_MSG NUMPY_INCLUDE_DIR)