aboutsummaryrefslogtreecommitdiffstats
path: root/host/python/CMakeLists.txt
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-02-04 16:00:16 +0100
committerMartin Braun <martin.braun@ettus.com>2019-02-22 16:56:52 -0800
commit692ddc71b17196487dcad982836e074cab9a0f25 (patch)
treecf76abf577dde6128e03561c52d9c31dca302026 /host/python/CMakeLists.txt
parent51bbf548c9b442d0b53b6c8de5f89403de274424 (diff)
downloaduhd-692ddc71b17196487dcad982836e074cab9a0f25.tar.gz
uhd-692ddc71b17196487dcad982836e074cab9a0f25.tar.bz2
uhd-692ddc71b17196487dcad982836e074cab9a0f25.zip
python: Replace Boost.Python with PyBind11
This does not change the Python API itself, but it is still a significant change. Most importantly, it removes the dependency on Boost.Python.
Diffstat (limited to 'host/python/CMakeLists.txt')
-rw-r--r--host/python/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt
index 07791de55..ec2c80fd4 100644
--- a/host/python/CMakeLists.txt
+++ b/host/python/CMakeLists.txt
@@ -16,6 +16,14 @@ PYTHON_CHECK_MODULE(
# Get include dirs
include_directories(${PYTHON_INCLUDE_DIRS})
+set(PYBIND11_INCLUDE_DIR
+ "${CMAKE_SOURCE_DIR}/lib/deps/pybind11/include"
+ CACHE
+ STRING
+ "Location of PyBind11 includes"
+)
+message(STATUS "${PYBIND11_INCLUDE_DIR}")
+include_directories(${PYBIND11_INCLUDE_DIR})
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from __future__ import print_function\ntry:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass"
@@ -26,9 +34,10 @@ add_library(pyuhd SHARED pyuhd.cpp)
target_include_directories(pyuhd PUBLIC
${PYTHON_NUMPY_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/lib
+ ${PYBIND11_INCLUDE_DIR}
)
-target_link_libraries(pyuhd ${BOOST_PYTHON_LIBRARY} ${Boost_LIBRARIES} ${PYTHON_LIBRARY} uhd)
+target_link_libraries(pyuhd ${Boost_LIBRARIES} ${PYTHON_LIBRARY} uhd)
# Copy pyuhd library to the staging directory
if(WIN32)
set(PYUHD_LIBRARY_NAME libpyuhd.pyd)