-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
31 lines (27 loc) · 1.21 KB
/
CMakeLists.txt
File metadata and controls
31 lines (27 loc) · 1.21 KB
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
31
project(python_from_cpp_examples)
cmake_minimum_required(VERSION 3.10)
## function: dai_add_example(example_name example_src enable_test use_pcl)
## function: dai_set_example_test_labels(example_name ...)
dai_add_example(build_only_pipeline_from_cpp build_only_pipeline_from_cpp.cpp OFF OFF)
target_link_libraries(build_only_pipeline_from_cpp PRIVATE depthai-embed
pybind11::pybind11
pybind11::module
pybind11::embed)
dai_add_example(run_pipeline_from_cpp run_pipeline_from_cpp.cpp OFF OFF)
target_link_libraries(run_pipeline_from_cpp PRIVATE depthai-embed
pybind11::pybind11
pybind11::module
pybind11::embed)
# Copy Python file to the same directory as the executable
add_custom_command(TARGET build_only_pipeline_from_cpp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/build_pipeline.py
$<TARGET_FILE_DIR:build_only_pipeline_from_cpp>/build_pipeline.py
COMMENT "Copying Python script to build directory"
)
add_custom_command(TARGET run_pipeline_from_cpp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/build_pipeline.py
$<TARGET_FILE_DIR:run_pipeline_from_cpp>/build_pipeline.py
COMMENT "Copying Python script to build directory"
)