You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
55 lines
1.7 KiB
cmake_minimum_required(VERSION 3.12) |
|
project(detection_app) |
|
|
|
# C++20 |
|
set(CMAKE_CXX_STANDARD 20) |
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
# Warning option |
|
set(COMPILE_OPTIONS -Wall) |
|
|
|
# Aviod 5045 Warning |
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd5045") |
|
|
|
# HailoRT Path |
|
set(CMAKE_PREFIX_PATH "C:/Program Files/HailoRT/lib/") |
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) |
|
set(HAILORT_INCLUDE "C:/Users/mm930/Documents/hailort/hailort/libhailort/include") |
|
# set(HAILORT_LIB "C:/Users/mm930/Documents/hailort/build/hailort/libhailort/src/Release/libhailort.dll") |
|
|
|
# OpenCV Path |
|
set(OpenCV_INCLUDE_DIRS "C:/Users/mm930/OneDrive/桌面/lilin/Hailo/Infer/opencv/sources/include") |
|
|
|
# Search package |
|
find_package(Threads REQUIRED) |
|
find_package(HailoRT 4.19.0 REQUIRED) |
|
find_package(OpenCV REQUIRED) |
|
|
|
# include path |
|
include_directories(${OpenCV_INCLUDE_DIRS}) |
|
include_directories(${HAILORT_INCLUDE}) |
|
|
|
# print OpenCV path |
|
message(STATUS "Found OpenCV: " ${OpenCV_INCLUDE_DIRS}) |
|
|
|
file(GLOB SOURCES ./*.cpp) |
|
include_directories(${CMAKE_SOURCE_DIR}/include) |
|
add_executable(detection_app ${SOURCES} "VideoToAI.hpp" "VideoToAI.cpp") |
|
include_directories(C:/Users/mm930/OneDrive/Documents/opencv/opencv_contrib/modules/xfeatures2d/include) |
|
|
|
# Set compile option |
|
target_compile_options(detection_app PRIVATE ${COMPILE_OPTIONS}) |
|
|
|
# Library |
|
target_link_libraries(detection_app |
|
HailoRT::libhailort |
|
${HAILORT_LIB} |
|
${CMAKE_THREAD_LIBS_INIT} |
|
${OpenCV_LIBRARIES} |
|
) |
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") |
|
add_compile_options(/W0) |
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") |
|
add_compile_options(-w) |
|
endif() |
|
|
|
|