forked from blacksoul000/rviz_satellite
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
72 lines (56 loc) · 2.12 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
cmake_minimum_required(VERSION 3.5)
project(rviz_satellite)
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 -Wunused)
endif()
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_default_plugins REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(pluginlib REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Network Concurrent Widgets REQUIRED)
add_library(${PROJECT_NAME} SHARED
src/aerialmap_display.cpp
src/field.cpp
src/tile.cpp
src/tile_client.cpp
src/tile_object.cpp
)
target_compile_options(
${PROJECT_NAME}
PUBLIC
"-DRVIZ_SATELLITE_VERSION=\"${rviz_satellite_VERSION}\"")
target_include_directories(${PROJECT_NAME} PRIVATE src)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Network Qt5::Concurrent Qt5::Widgets)
# prevent pluginlib from using boost
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
set_property(TARGET ${PROJECT_NAME} PROPERTY AUTOMOC ON)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(test_field test/test_field.cpp)
target_link_libraries(test_field ${PROJECT_NAME})
target_include_directories(test_field PRIVATE src)
endif()
ament_target_dependencies(${PROJECT_NAME} rclcpp pluginlib rviz_common rviz_default_plugins sensor_msgs tf2_ros)
ament_export_dependencies(rclcpp pluginlib rviz_common rviz_default_plugins sensor_msgs tf2_ros)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icons"
DESTINATION "share/${PROJECT_NAME}")
install(DIRECTORY launch
DESTINATION "share/${PROJECT_NAME}")
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)
ament_package()