|
| 1 | +set(APP_NAME depthai_app) |
| 2 | + |
| 3 | +set(dldt_dir ../../shared/3rdparty/dldt) |
| 4 | + |
| 5 | +cmake_minimum_required(VERSION 2.8.12) |
| 6 | + |
| 7 | +project(${APP_NAME}) |
| 8 | + |
| 9 | + |
| 10 | +add_definitions(-D__PC__) |
| 11 | +add_definitions(-DUSE_USB_VSC) # for XLink communication |
| 12 | +# add_definitions(-DXLINK_USB_DATA_TIMEOUT=0) |
| 13 | +# add_definitions(-DXLINK_COMMON_TIMEOUT_MSEC=0) |
| 14 | + |
| 15 | +if(CMAKE_COMPILER_IS_GNUCXX) |
| 16 | + set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}") |
| 17 | + message(STATUS "optional:-std=c++17") |
| 18 | +endif(CMAKE_COMPILER_IS_GNUCXX) |
| 19 | + |
| 20 | + |
| 21 | +# find_package(OpenCV REQUIRED ) |
| 22 | +# find_package(PythonLibs 3 REQUIRED) |
| 23 | + |
| 24 | +include(${dldt_dir}/inference-engine/thirdparty/movidius/XLink/XLink.cmake) |
| 25 | + |
| 26 | +include_directories( |
| 27 | + ./ |
| 28 | + ../core/ |
| 29 | + ../../shared/ |
| 30 | + ${XLINK_INCLUDE_DIRECTORIES} |
| 31 | +) |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +# if(DEFINED BUILD_FOR_PYTHON) |
| 36 | +# message("building for python") |
| 37 | +# add_subdirectory(pybind11) |
| 38 | +# pybind11_add_module( |
| 39 | +# ${APP_NAME} |
| 40 | +# wrapper.cpp |
| 41 | +# program_raw_options.cpp |
| 42 | +# ../core/pipeline/host_pipeline.cpp |
| 43 | +# ../../shared/xlink/xlink_wrapper.cpp |
| 44 | +# ${XLINK_SOURCES} |
| 45 | +# ) |
| 46 | +# else(DEFINED BUILD_FOR_PYTHON) |
| 47 | + message("building for direct") |
| 48 | + add_executable( ${APP_NAME} |
| 49 | + main.cpp |
| 50 | + program_raw_options.cpp |
| 51 | + ../../shared/logger/logs_writer.cpp |
| 52 | + ../../host/core/3rdparty/loguru/loguru.cpp |
| 53 | + ../../shared/general/data_writer.cpp |
| 54 | + ../../shared/json_helper.cpp |
| 55 | + host_logs_writer.cpp |
| 56 | + ../core/pipeline/host_pipeline.cpp |
| 57 | + ../core/pipeline/host_pipeline_config.cpp |
| 58 | + ../core/pipeline/cnn_host_pipeline.cpp |
| 59 | + ../../shared/stream/stream_info.cpp |
| 60 | + ../../shared/xlink/xlink_wrapper.cpp |
| 61 | + ../core/types.cpp |
| 62 | + ../core/host_json_helper.cpp |
| 63 | + ../core/host_data_reader.cpp |
| 64 | + ../core/host_data_reader.cpp |
| 65 | + ../core/disparity_stream_post_processor.cpp |
| 66 | + ../../shared/disparity_luts.cpp |
| 67 | + ${XLINK_SOURCES} |
| 68 | + ) |
| 69 | +# endif(DEFINED BUILD_FOR_PYTHON) |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +# nlohman JSON |
| 74 | +set(nlohmann_json_DIR ../../shared/3rdparty/json) |
| 75 | + |
| 76 | +include_directories(${nlohmann_json_DIR}/include/) |
| 77 | +set(JSON_BuildTests OFF CACHE INTERNAL "") |
| 78 | +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${nlohmann_json_DIR} ${CMAKE_CURRENT_BINARY_DIR}/json) |
| 79 | + |
| 80 | + |
| 81 | +# nlohman JSON validator |
| 82 | +set(BUILD_TESTS OFF CACHE INTERNAL "") |
| 83 | +set(BUILD_EXAMPLES OFF CACHE INTERNAL "") |
| 84 | + |
| 85 | +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../shared/3rdparty/json-schema-validator/ ${CMAKE_CURRENT_BINARY_DIR}/json-schema-validator) |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +# for commit hash |
| 90 | +# TODO: maybe we shoud add it into another .cmake and than include here? |
| 91 | +find_package(Git) |
| 92 | + |
| 93 | +set(commit_version "unknown") |
| 94 | + |
| 95 | +if(GIT_FOUND) |
| 96 | + execute_process( |
| 97 | + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD |
| 98 | + WORKING_DIRECTORY "${local_dir}" |
| 99 | + OUTPUT_VARIABLE commit_version |
| 100 | + ERROR_QUIET |
| 101 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
| 102 | + ) |
| 103 | +else() |
| 104 | + message(STATUS "GIT module not found") |
| 105 | +endif() |
| 106 | + |
| 107 | +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../shared/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/../../shared/version.hpp @ONLY) |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | +# link libraries |
| 112 | +target_link_libraries( |
| 113 | + ${APP_NAME} |
| 114 | + PRIVATE |
| 115 | + -lusb-1.0 |
| 116 | + -lpthread |
| 117 | + -ldl |
| 118 | + nlohmann_json::nlohmann_json |
| 119 | + nlohmann_json_schema_validator |
| 120 | +) |
0 commit comments