Skip to content

Commit

Permalink
Merge pull request #2389 from esteve/cross_compiling
Browse files Browse the repository at this point in the history
Support passing Numpy_INCLUDE_DIRS externally
  • Loading branch information
k-okada authored Jan 28, 2019
2 parents f4fed09 + 29a7704 commit 5784fde
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Get Numpy include directories
execute_process(
COMMAND python -c "import sys, numpy; sys.stdout.write(numpy.get_include())"
OUTPUT_VARIABLE Numpy_INCLUDE_DIRS
RESULT_VARIABLE retcode)
if(NOT ${retcode} EQUAL 0)
message(FATAL_ERROR "Failed to get Numpy include dirs by numpy.get_include(). Exit code: ${retcode}")
if(NOT DEFINED Numpy_INCLUDE_DIRS)
# Get Numpy include directories
execute_process(
COMMAND python -c "import sys, numpy; sys.stdout.write(numpy.get_include())"
OUTPUT_VARIABLE Numpy_INCLUDE_DIRS
RESULT_VARIABLE retcode)
if(NOT ${retcode} EQUAL 0)
message(FATAL_ERROR "Failed to get Numpy include dirs by numpy.get_include(). Exit code: ${retcode}")
endif()
endif()
# Compile nms.pyx
include_directories(${Numpy_INCLUDE_DIRS})
Expand Down

0 comments on commit 5784fde

Please sign in to comment.