summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-03-02 14:52:12 (GMT)
committerBrad King <brad.king@kitware.com>2019-03-04 13:28:21 (GMT)
commit8e3358336dba2af42279c16a277116fc8fdfb826 (patch)
tree36973a9bdf0dc6bdbf0e823f72a40485091bf0e9
parent20a41aa589d4418f9ac46fc8c0402162d1d82873 (diff)
downloadCMake-8e3358336dba2af42279c16a277116fc8fdfb826.zip
CMake-8e3358336dba2af42279c16a277116fc8fdfb826.tar.gz
CMake-8e3358336dba2af42279c16a277116fc8fdfb826.tar.bz2
FindPython: Fix NumPy component include directory
Update the component added by commit 513e77550d (FindPython: Introduce NumPy component, 2018-12-12, v3.14.0-rc1~95^2). The `numpy/` sub-directory should not be part of the include directory. It should be part of the `#include` line.
-rw-r--r--Modules/FindPython/Support.cmake3
-rw-r--r--Tests/FindPython/NumPy/arraytest.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 0138b04..ef8272c 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -1140,9 +1140,8 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT _${_PYTHON_PREFIX}_RESULT)
find_path(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
- NAMES arrayobject.h numpyconfig.h
+ NAMES "numpy/arrayobject.h" "numpy/numpyconfig.h"
HINTS "${_${_PYTHON_PREFIX}_NumPy_PATH}"
- PATH_SUFFIXES numpy
NO_DEFAULT_PATH)
endif()
if(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
diff --git a/Tests/FindPython/NumPy/arraytest.c b/Tests/FindPython/NumPy/arraytest.c
index 135877d..db259e5 100644
--- a/Tests/FindPython/NumPy/arraytest.c
+++ b/Tests/FindPython/NumPy/arraytest.c
@@ -1,7 +1,7 @@
#include "Python.h"
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include "arrayobject.h"
+#include "numpy/arrayobject.h"
#include <math.h>