-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
70 lines (59 loc) · 1.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
cmake_minimum_required(VERSION 3.5)
project(basler_ros2)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
#---ROS packages---#
find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(rclcpp REQUIRED)
find_package(image_transport REQUIRED)
find_package(std_msgs REQUIRED)
find_package(camera_calibration_parsers REQUIRED)
#---ROS packages---#
#---Pylon---#
find_package(Pylon QUIET)
if (NOT ${Pylon_FOUND})
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindPylon.cmake")
endif()
if (NOT ${Pylon_FOUND})
message(FATAL "Unable to find Basler Pylon SDK.")
endif()
#---Pylon---#
#---YAML---#
find_package(yaml-cpp)
#---YAML---#
add_executable(basler_node
src/main.cpp
src/BaslerNode.cpp)
target_include_directories(basler_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${Pylon_INCLUDE_DIRS})
target_link_libraries(basler_node
${Pylon_LIBRARIES}
${YAML_CPP_LIBRARIES})
ament_target_dependencies(basler_node
rclcpp
image_transport
camera_calibration_parsers
std_msgs
ament_index_cpp)
install(TARGETS basler_node
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
install(DIRECTORY config
DESTINATION share/${PROJECT_NAME}/
)
ament_package()