-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
71 lines (56 loc) · 1.65 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
cmake_minimum_required(VERSION 3.16)
set(LIB_NAME event_emin_ros)
project(${LIB_NAME} LANGUAGES CXX)
# C++ version
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# CXX flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -march=native -mtune=native")
# Dependencies
# catkin
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs sensor_msgs dvs_msgs
cv_bridge
message_generation
message_filters
)
# Eigen
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
# OpenCV
find_package(OpenCV REQUIRED)
# Messages
add_message_files(
FILES
Vars.msg
)
generate_messages(
DEPENDENCIES
std_msgs dvs_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${LIB_NAME}
CATKIN_DEPENDS roscpp std_msgs sensor_msgs dvs_msgs cv_bridge message_runtime message_filters
DEPENDS OpenCV
)
add_subdirectory(EventEMin)
include_directories(include EventEMin/include ${catkin_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS})
add_library(${LIB_NAME}
src/event_emin_ros.cpp
)
add_dependencies(${LIB_NAME} ${${LIB_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${LIB_NAME} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
# Function to add new executable nodes
function(add_new_node ARG)
add_executable(${ARG}_node src/${ARG}_node.cpp)
set_target_properties(${ARG}_node PROPERTIES OUTPUT_NAME ${ARG} PREFIX "")
add_dependencies(${ARG}_node ${${LIB_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${ARG}_node ${LIB_NAME})
endfunction()
add_new_node(affinity)
add_new_node(isometry)
add_new_node(rotation)
add_new_node(similarity)
add_new_node(translation2d)