编译单个项目

cmake_minimum_required (VERSION 3.5)
project (demo)

set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
aux_source_directory (src SRC_LIST)
include_directories (include)

#这里是库头文件
include_directories (${PROJECT_SOURCE_DIR}/openvino/inc)
include_directories (${PROJECT_SOURCE_DIR}/opencv/inc)
include_directories (${PROJECT_SOURCE_DIR}/opencv/inc/opencv2)


#这里是库路径
link_directories({PROJECT_SOURCE_DIR}/openvino/lib/intel64/Release)
link_directories({PROJECT_SOURCE_DIR}/opencv/lib)

add_executable (main ${SRC_LIST})

# 常见错误(链接库)
target_link_libraries (main opencv_calib3d440 opencv_core440  opencv_dnn440  opencv_features2d440  opencv_flann440  opencv_gapi440  opencv_highgui440  opencv_imgcodecs440  opencv_imgproc440  opencv_ml440  opencv_objdetect440  opencv_photo440  opencv_stitching440  opencv_video440  opencv_videoio440  inference_engine  inference_engine_c_api  inference_engine_ir_reader  inference_engine_legacy  inference_engine_lp_transformations  inference_engine_onnx_reader  inference_engine_preproc  inference_engine_transformations )

你可能感兴趣的:(编译单个项目)