-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
66 lines (50 loc) · 1.52 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
cmake_minimum_required(VERSION 3.25)
project(viam-csi
VERSION 0.0.2
DESCRIPTION "viam module for csi cameras"
)
set(CMAKE_CXX_STANDARD 14)
set(GNU_LIB_PATH /usr/lib/aarch64-linux-gnu)
set(GNU_INCLUDE_PATH /usr/include/aarch64-linux-gnu)
set(LOCAL_LIB_PATH /usr/local/lib)
set(LOCAL_INCLUDE_PATH /usr/local/include)
enable_testing()
find_package(GTest REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(viam-cpp-sdk CONFIG REQUIRED)
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0 gstreamer-app-1.0 gstreamer-base-1.0)
include_directories(
${GLIB_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
${GNU_INCLUDE_PATH}
${LOCAL_INCLUDE_PATH}
)
link_directories(
${GLIB_LIBRARY_DIRS}
${GSTREAMER_LIBRARY_DIRS}
${GNU_LIB_PATH}
${LOCAL_LIB_PATH}
)
# Main executable
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME}
${GSTREAMER_LIBRARIES}
viam-cpp-sdk::viamsdk
)
install(TARGETS ${PROJECT_NAME} DESTINATION usr/local/bin)
# Test executable
add_executable(${PROJECT_NAME}_test test/test_csi_camera.cpp)
target_link_libraries(${PROJECT_NAME}_test
${GSTREAMER_LIBRARIES}
GTest::GTest
GTest::Main
viam-cpp-sdk::viamsdk
)
# Add the test as a target
add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test)
# Perf executable
add_executable(${PROJECT_NAME}_perf test/test_sdk_perf.cpp)
target_link_libraries(${PROJECT_NAME}_perf
${GSTREAMER_LIBRARIES}
viam-cpp-sdk::viamsdk
)