forked from Kinovarobotics/ros_kortex_vision
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
90 lines (76 loc) · 2.01 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
cmake_minimum_required(VERSION 3.14)
project(kinova_vision)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra)
endif()
# Ament System Dependencies
find_package(ament_cmake REQUIRED)
find_package(camera_calibration_parsers REQUIRED)
find_package(camera_info_manager REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(image_transport REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_cmake
camera_calibration_parsers
camera_info_manager
cv_bridge
image_transport
rclcpp
rclcpp_components
sensor_msgs
tf2
tf2_ros
)
# Other Dependencies
find_package(PkgConfig)
pkg_check_modules(GSTREAMER REQUIRED
gstreamer-1.0
gstreamer-app-1.0
)
# Define targets
include_directories(include)
include_directories(${GSTREAMER_INCLUDE_DIRS})
add_library(${PROJECT_NAME} SHARED src/vision.cpp)
ament_target_dependencies(${PROJECT_NAME}
${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(${PROJECT_NAME}
"${GSTREAMER_LIBRARIES}")
add_executable(${PROJECT_NAME}_node src/vision_node.cpp)
ament_target_dependencies(${PROJECT_NAME}_node
${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(${PROJECT_NAME}_node ${PROJECT_NAME})
# Install directives
install(TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
)
install(TARGETS ${PROJECT_NAME}_node
ARCHIVE DESTINATION lib/${PROJECT_NAME}
LIBRARY DESTINATION lib/${PROJECT_NAME}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME}
)
# Include additional settings if needed
set(CMAKE_CXX_FLAGS "-fpermissive")
## EXPORTS
ament_export_include_directories(
include
)
ament_export_libraries(
${PROJECT_NAME}
)
ament_export_dependencies(
)
ament_package()