-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (37 loc) · 1.04 KB
/
Copy pathCMakeLists.txt
File metadata and controls
46 lines (37 loc) · 1.04 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.10)
project(MobileNetClassification)
add_compile_options(-fPIC -std=c++14 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -s -pie)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0 -Dgoogle=mindxsdk_private)
# 确保环境变量存在
if(NOT DEFINED ENV{MX_SDK_HOME})
message(FATAL_ERROR "MX_SDK_HOME environment variable is not set")
endif()
set(MX_SDK_HOME $ENV{MX_SDK_HOME})
find_package(SQLite3 REQUIRED)
# 包含路径
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${MX_SDK_HOME}/include
${MX_SDK_HOME}/opensource/include
${MX_SDK_HOME}/opensource/include/opencv4
)
# 库路径
link_directories(
${MX_SDK_HOME}/lib
${MX_SDK_HOME}/opensource/lib
)
file(GLOB_RECURSE SRC_FILES "src/*.cpp")
add_executable(sample ${SRC_FILES})
set_target_properties(sample PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/wheatCore"
)
# 链接库
target_link_libraries(sample
mxbase
glog
opencv_world
mosquittopp
mosquitto
pthread
SQLite::SQLite3
)