Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't search default paths when looking for numpy
cmakes find_path() function looks first in system directories and then
in the directories listed by PATHS.  So if there are numpy includes in
/usr/include they will be found first which can break the build.

One way to fix this could be to use HINTS instead of PATHS which will be
searched before the system paths. But in this case we know which
directory we want as we got it from python so let's just skip all other
paths and just look there by adding NO_DEFAULT_PATH.
  • Loading branch information
daritter committed Mar 22, 2017
commit 2ba92da9fac9370c4b39caf66b6a94bebd859afc
3 changes: 2 additions & 1 deletion cmake/modules/FindNumPy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ if("${_VER_CHECK}" STREQUAL "")
return()
endif()

find_path(NUMPY_INCLUDE_DIR numpy/numpyconfig.h PATHS ${_numpy_include_path})
# we already know where it should be so don't search default paths as well.
find_path(NUMPY_INCLUDE_DIR numpy/numpyconfig.h PATHS ${_numpy_include_path} NO_DEFAULT_PATH)
if(NUMPY_INCLUDE_DIR)
set(NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR})
endif()
Expand Down