aboutsummaryrefslogtreecommitdiff
path: root/ports/tensorpipe/support-pybind11.patch
blob: 7a87cd285f4adcfec255c61405edf853b6211431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff --git a/tensorpipe/python/CMakeLists.txt b/tensorpipe/python/CMakeLists.txt
index 41958dd..02562b4 100644
--- a/tensorpipe/python/CMakeLists.txt
+++ b/tensorpipe/python/CMakeLists.txt
@@ -4,13 +4,17 @@
 # This source code is licensed under the BSD-style license found in the
 # LICENSE file in the root directory of this source tree.
 
-if(NOT (COMMAND pybind11_add_module))
-  add_subdirectory(
-    ${PROJECT_SOURCE_DIR}/third_party/pybind11
-    ${PROJECT_BINARY_DIR}/third_party/pybind11
-    EXCLUDE_FROM_ALL)
-endif()
+find_package(pybind11 CONFIG REQUIRED)
 
-set(PYBIND11_CPP_STANDARD -std=c++14)
 pybind11_add_module(pytensorpipe tensorpipe.cc)
-target_link_libraries(pytensorpipe PRIVATE tensorpipe)
+set_target_properties(pytensorpipe
+PROPERTIES
+  CXX_STANDARD 14
+)
+target_link_libraries(pytensorpipe PRIVATE tensorpipe pybind11::module)
+
+install(TARGETS pytensorpipe
+        EXPORT tensorpipeTargets
+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})