Created
December 15, 2018 17:14
-
-
Save npetrenko/5b382cf5c795d6bca8196bdc7ada8d18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.13) | |
project(np_test) | |
execute_process( | |
COMMAND "python3" -c "import numpy; print(numpy.get_include(), end='')" | |
OUTPUT_VARIABLE NUMPY_INCLUDE_DIRS | |
RESULT_VARIABLE NUMPY_NOTFOUND) | |
find_package(PythonLibs 3 REQUIRED) | |
if (NUMPY_NOTFOUND) | |
message(STATUS "Numpy not found") | |
exit() | |
endif() | |
add_library(nptest SHARED py.cpp) | |
target_include_directories(nptest PUBLIC ${NUMPY_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment