forked from husarion/zed_cpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
76 lines (62 loc) · 1.64 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
cmake_minimum_required(VERSION 3.1)
project(zed_cpu)
add_compile_options(-std=c++17)
add_definitions(-DSENSORS_MOD_AVAILABLE)
add_definitions(-DVIDEO_MOD_AVAILABLE)
# Raspberry Pi 4 - OS 64bit
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
add_compile_options(-mtune=cortex-a72 -mcpu=cortex-a72)
add_definitions(-DEMBEDDED_ARM)
endif()
# Raspberry Pi 4 - OS 32bit
if(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l")
add_compile_options(-mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -mtune=cortex-a72)
add_definitions(-DEMBEDDED_ARM)
endif()
list(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_SOURCE_DIR}/cmake")
find_package(catkin REQUIRED COMPONENTS
camera_info_manager
cv_bridge
image_transport
roscpp
sensor_msgs
std_msgs
)
find_package(HIDAPI REQUIRED)
find_package(LIBUSB 1 REQUIRED)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
${HIDAPI_INCLUDE_DIRS}
${LibUSB_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include/zed_cpu
)
add_library(zed_lib
src/zed_lib/videocapture.cpp
src/zed_lib/sensorcapture.cpp
)
target_link_libraries(zed_lib
${OpenCV_LIBS}
${LibUSB_LIBRARIES}
${HIDAPI_LIBRARIES}
)
add_executable(zed_node
src/main.cpp src/zed_cpu.cpp
)
target_link_libraries(zed_node
zed_lib
${catkin_LIBRARIES}
${PROJECT_SOURCE_DIR}/include/zed_cpu
)
install(TARGETS
zed_lib zed_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)