-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
91 lines (74 loc) · 2.93 KB
/
CMakeLists.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 2.8)
# Set the project name
project(home-security)
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Use package config to locate GStreamer
find_package(PkgConfig)
pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-app-1.0>=1.4
gstreamer-rtsp-server-1.0=1.13.91)
message("-- GST_LIBRARY_DIRS: ${GST_LIBRARY_DIRS}")
message("-- GST_INCLUDE_DIRS: ${GST_INCLUDE_DIRS}")
message("-- GST_CFLAGS: ${GST_CFLAGS}")
message("-- GST_LIBRARIES: ${GST_LIBRARIES}")
# - target_include_directories with ${GST_INCLUDE_DIRS}
# - target_compile_options with ${GST_CFLAGS}
# - target_link_libraries with ${GST_LIBRARIES}
# Find jetson and cuda packages
find_package(jetson-utils REQUIRED)
find_package(jetson-inference REQUIRED)
find_package(CUDA REQUIRED)
message("-- CUDA version: ${CUDA_VERSION}")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-O3
-gencode arch=compute_53,code=sm_53
-gencode arch=compute_62,code=sm_62
)
if(CUDA_VERSION_MAJOR GREATER 9)
message("-- CUDA ${CUDA_VERSION_MAJOR} detected, enabling SM_72")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_72,code=sm_72
)
# OpenCV used for findHomography() and decomposeHomography()
# OpenCV version >= 3.0.0 required for decomposeHomography()
find_package(OpenCV 3.0.0 COMPONENTS core calib3d REQUIRED)
endif()
message("-- CUDA_NVCC_FLAGS: ${CUDA_NVCC_FLAGS}")
# Find cURL
find_package(CURL REQUIRED)
message("-- CURL_INCLUDE_DIR: ${CURL_INCLUDE_DIR}")
message("-- CURL_LIBRARIES: ${CURL_LIBRARIES}")
# Adding glib library
pkg_check_modules(GLIB REQUIRED glib-2.0>=2.23)
#include_directories(${GLIB_INCLUDE_DIRS})
#link_directories(${GLIB_LIBRARY_DIRS})
#message("-- GLIB_INCLUDE_DIRS: ${GLIB_INCLUDE_DIRS}")
#message("-- GLIB_LIBRARY_DIRS: ${GLIB_LIBRARY_DIRS}")
#message("-- GLIB_LIBRARIES : ${GLIB_LIBRARIES}")
# Adding gobject library
pkg_check_modules(GOBJECT REQUIRED gobject-2.0>=2.23)
#include_directories(${GOBJECT_INCLUDE_DIRS})
#link_directories(${GOBJECT_LIBRARY_DIRS})
#message("-- GOBJECT_INCLUDE_DIRS: ${GOBJECT_INCLUDE_DIRS}")
#message("-- GOBJECT_LIBRARY_DIRS: ${GOBJECT_LIBRARY_DIRS}")
#message("-- GOBJECT_LIBRARIES : ${GOBJECT_LIBRARIES}")
# Include
#include_directories( ${CUDA_INCLUDE_DIRS} )
include_directories( ${GST_INCLUDE_DIRS} )
include_directories( ${CURL_INCLUDE_DIR} )
file(GLOB home-securitySources *.cxx)
file(GLOB home-securityIncludes *.h)
# Compile the home-security program
cuda_add_executable(home-security ${home-securitySources})
#add_executable(home-security ${home-securitySources})
# Link home-security to the jetson-inference library
target_link_libraries(home-security jetson-inference jetson-utils curl ${GOBJECT_LIBRARIES} ${GST_LIBRARIES})
install(TARGETS home-security DESTINATION bin)