-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
164 lines (146 loc) · 4.63 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
###############################################################################
# CMakeLists.txt
#
# Copyright (c) 2016 Cogent Embedded Inc. ALL RIGHTS RESERVED.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
##############################################################################
cmake_minimum_required (VERSION 3.0)
project("smartcamera-sv" C)
# search for additional CMake modules
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR include CACHE PATH "Installation directory for headers")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
find_package(Cairo REQUIRED)
find_package(Pango REQUIRED)
find_package(EGL REQUIRED)
find_package(GLIB REQUIRED COMPONENTS gobject gmodule gthread gio)
find_package(GStreamer REQUIRED COMPONENTS
gstreamer-allocators
gstreamer-app
gstreamer-video
)
find_package(OpenGLES2 REQUIRED)
find_package(Wayland REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Spnav QUIET)
#pkg_check_modules (MMNGRBUF REQUIRED mmngrbuf-user-module)
#pkg_check_modules (MMNGR REQUIRED mmngr-user-module)
#pkg_check_modules (SPNAV REQUIRED libspnav)
pkg_check_modules (WAYLAND REQUIRED wayland-client)
pkg_check_modules (MEDIACTRL REQUIRED libmediactl-v4l2)
pkg_check_modules (PNG REQUIRED libpng)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib)
include_directories(
${GLIB_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS}
${Z_INCLUDE_DIRS}
${OPENGLES2_INCLUDE_DIRS}
${EGL_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER-APP_INCLUDE_DIRS}
${GSTREAMER-RTP_INCLUDE_DIRS}
${GSTREAMER-PBUTILS_INCLUDE_DIRS}
${GSTREAMER-VIDEO_INCLUDE_DIRS}
${GSTREAMER-ALLOCATOR_INCLUDE_DIRS}
)
# ...common libraries
set(COMMON_LIBRARIES
"pthread"
"dl"
"z"
"m"
)
set(GLIB_LIBRARIES
"gobject-2.0"
"glib-2.0"
"gmodule-2.0"
"gthread-2.0"
)
set(GSTREAMER_ALL_LIBRARIES
${GSTREAMER_LIBRARIES}
${GSTREAMER-APP_LIBRARIES}
${GSTREAMER-RTP_LIBRARIES}
${GSTREAMER-PNUTILS_LIBRARIES}
${GSTREAMER-VIDEO_LIBRARIES}
${GSTREAMER-ALLOCATOR_LIBRARIES}
)
set(VSPM_LIBRARIES "vspm")
set(MMNGR_LIBRARIES "mmngr" "mmngrbuf")
set(SPNAV_LIBRARIES "spnav")
# ...specify include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# ...add sources
file(GLOB APP_C_SRC
"utest/utest-common.c"
"utest/utest-display.c"
"utest/utest-vsink.c"
"utest/utest-vin.c"
"utest/utest-imr.c"
"utest/utest-mesh.c"
"utest/utest-meta.c"
"utest/utest-imr-sv.c"
"utest/utest-imr-gui.c"
"utest/utest-png.c"
"utest/utest-bmp.c"
"utest/utest-car.c"
"utest/utest-compositor.c"
"utest/utest-sc.c"
"utest/utest-config.c"
"utest/utest-main.c"
"utest/utest-mesh.c"
)
add_executable(sc ${APP_C_SRC})
target_link_libraries(sc
${COMMON_LIBRARIES}
${GLIB_LIBRARIES}
${PANGO_LIBRARIES}
"pangocairo-1.0"
${GSTREAMER_LIBRARIES}
${GSTREAMER_ALLOCATORS_LIBRARIES}
${GSTREAMER_APP_LIBRARIES}
${GSTREAMER_BASE_LIBRARIES}
${GSTREAMER_VIDEO_LIBRARIES}
${EGL_LIBRARIES}
${WAYLAND_LIBRARIES}
${CAIRO_LIBRARIES}
${MMNGR_LIBRARIES}
${MMNGRBUF_LIBRARIES}
${VSPM_LIBRARIES}
${PNG_LIBRARIES}
${SPNAV_LIBRARIES}
${OPENGLES2_LIBRARIES}
${CMAKE_CURRENT_SOURCE_DIR}/prebuilt/libwvobjparse.a
"sv"
"drivermonitor"
"mmngr"
"mmngrbuf"
"m"
)
set_target_properties(sc PROPERTIES SKIP_BUILD_RPATH ON)
install(TARGETS sc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
message(STATUS "Installation directory: ${CMAKE_INSTALL_BINDIR}")