Permalink
Browse files

wrappers/python: fix numpy include path for cmake build too

Signed-off-by: Hector Martin <hector@marcansoft.com>
  • Loading branch information...
1 parent 371ee04 commit 4e1be4eceaefdd2fa3e2fab9989a2450938bae93 @marcan marcan committed Nov 10, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 wrappers/python/CMakeLists.txt
@@ -12,6 +12,11 @@ execute_process(COMMAND
${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}')"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+# Figure out numpy include path
+execute_process(COMMAND
+ ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.get_include()"
+ OUTPUT_VARIABLE NUMPY_INCLUDE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
+
# How to Cython the .pyx file
add_custom_command(OUTPUT freenect.c
COMMAND ${CYTHON_EXECUTABLE} -o freenect.c "${CMAKE_CURRENT_SOURCE_DIR}/freenect.pyx")
@@ -24,7 +29,7 @@ set_target_properties(cython_freenect PROPERTIES
OUTPUT_NAME "freenect"
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(cython_freenect freenect_sync)
-include_directories(${PYTHON_INCLUDE_PATH} ../c_sync/)
+include_directories(${PYTHON_INCLUDE_PATH} ../c_sync/ ${NUMPY_INCLUDE_PATH})
# Install the extension
install(TARGETS cython_freenect

0 comments on commit 4e1be4e

Please sign in to comment.