-
Notifications
You must be signed in to change notification settings - Fork 0
/
OLDCMakeLists.txt
108 lines (83 loc) · 2.81 KB
/
OLDCMakeLists.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.5)
project(rviz_ground_image)
# set(CMAKE_CXX_FLAGS "-Wl,--no-undefined")
# 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()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_rendering REQUIRED)
find_package(rviz_default_plugins REQUIRED)
find_package(rviz_ogre_vendor REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets Core)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
set(CMAKE_AUTOMOC ON)
set(ground_image_rviz_plugin_headers
include/rviz_ground_image/ground_image_display.hpp
include/rviz_ground_image/static_ground_image.hpp
)
foreach(header "${ground_image_rviz_plugin_headers}")
qt5_wrap_cpp(ground_image_rviz_plugin_headers_moc_files "${header}")
endforeach()
set(ground_image_rviz_plugin_source_files
src/ground_image_display.cpp
src/static_ground_image.cpp
src/utils/static_image_texture.cpp include/rviz_ground_image/utils/static_image_texture.hpp)
add_library(rviz_ground_image SHARED
${ground_image_rviz_plugin_source_files}
${ground_image_rviz_plugin_headers_moc_files}
)
include_directories(
include
)
target_link_libraries(rviz_ground_image PUBLIC
rviz_ogre_vendor::OgreMain
rviz_ogre_vendor::OgreOverlay
rviz_common::rviz_common
rviz_rendering::rviz_rendering
rviz_default_plugins::rviz_default_plugins
)
target_include_directories(rviz_ground_image PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
${Qt5Widgets_INCLUDE_DIRS}
)
target_compile_definitions(rviz_ground_image PRIVATE "GROUND_IMAGE_BUILDING_LIBRARY")
target_compile_definitions(rviz_ground_image PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
ament_target_dependencies(${PROJECT_NAME}
PUBLIC
rclcpp
rviz_common
rviz_rendering
pluginlib
)
install(TARGETS rviz_ground_image
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/
DESTINATION include/
)
install(FILES plugin_description.xml
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)
ament_export_libraries(rviz_ground_image)
ament_export_targets(export_${PROJECT_NAME})
ament_package()