-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathCMakeLists.txt
95 lines (77 loc) · 2.22 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
91
92
93
94
95
################################################
## Generate symbols for IDE indexer (VSCode)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
add_definitions(-Werror=return-type)
option(LINK_SHARED_ZED "Link with the ZED SDK shared executable" ON)
if(NOT LINK_SHARED_ZED AND MSVC)
message(FATAL_ERROR "LINK_SHARED_ZED OFF : ZED SDK static libraries not available on Windows")
endif()
set(SOURCES
gstzedsrc.cpp
)
set(HEADERS
gstzedsrc.h
)
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${ZED_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
link_directories(${ZED_LIBRARY_DIR})
link_directories(${CUDA_LIBRARY_DIRS})
link_directories(${LIBRARY_INSTALL_DIR})
set(libname gstzedsrc)
message( " * ${libname} plugin added")
add_library(${libname} MODULE
${SOURCES}
${HEADERS}
)
if(UNIX)
message(" ${libname}: OS Unix")
add_definitions(-std=c++11 -Wno-deprecated-declarations -Wno-write-strings)
endif(UNIX)
if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
message(" ${libname}: Debug mode")
add_definitions(-g)
else()
message(" ${libname}: Release mode")
add_definitions(-O2)
endif()
SET(ZED_LIBS
${ZED_LIBRARIES}
${CUDA_CUDA_LIBRARY}
${CUDA_CUDART_LIBRARY}
${CUDA_NPP_LIBRARIES_ZED}
)
add_dependencies (${libname} gstzedmeta)
if (WIN32)
target_link_libraries (${libname} LINK_PUBLIC
${GLIB2_LIBRARIES}
${GOBJECT_LIBRARIES}
${GSTREAMER_LIBRARY}
${GSTREAMER_BASE_LIBRARY}
${GSTREAMER_VIDEO_LIBRARY}
gstzedmeta
${ZED_LIBS}
)
else()
target_link_libraries (${libname} LINK_PUBLIC
${GLIB2_LIBRARIES}
${GOBJECT_LIBRARIES}
${GSTREAMER_LIBRARY}
${GSTREAMER_BASE_LIBRARY}
${GSTREAMER_VIDEO_LIBRARY}
${ZED_LIBS}
${CMAKE_CURRENT_BINARY_DIR}/../gst-zed-meta/libgstzedmeta.so
)
endif()
if (WIN32)
install (FILES $<TARGET_PDB_FILE:${libname}> DESTINATION ${PDB_INSTALL_DIR} COMPONENT pdb OPTIONAL)
endif ()
install(TARGETS ${libname} LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})