-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCMakeLists.txt
121 lines (103 loc) · 3 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.5)
project(nvblox_rviz_plugin)
# Default to C++14 or we get hella warnings.
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -O3)
endif()
# Default to release build
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
message( STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
## This setting causes Qt's "MOC" generation to happen automatically.
set(CMAKE_AUTOMOC ON)
find_package(catkin REQUIRED COMPONENTS
rviz
pluginlib
nvblox_msgs
std_msgs
geometry_msgs
)
# QT5
find_package(Qt5 COMPONENTS Widgets REQUIRED)
catkin_package(
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
Qt5::Widgets
CATKIN_DEPENDS
rviz
pluginlib
nvblox_msgs
std_msgs
geometry_msgs
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${QT_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)
#############
# LIBRARIES #
#############
add_library(${PROJECT_NAME} SHARED
include/nvblox_rviz_plugin/nvblox_hash_utils.h
include/nvblox_rviz_plugin/nvblox_mesh_display.h
include/nvblox_rviz_plugin/nvblox_mesh_visual.h
src/nvblox_mesh_display.cpp
src/nvblox_mesh_visual.cpp
)
add_dependencies(${PROJECT_NAME}
${catkin_EXPORTED_TARGETS}
)
target_include_directories(${PROJECT_NAME} PUBLIC
${catkin_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} PUBLIC
Qt5::Widgets
${catkin_LIBRARIES}
)
##########
# EXPORT #
##########
# prevent pluginlib from using boost
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
install(
FILES plugins_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icons"
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(
DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
INCLUDES DESTINATION include/${PROJECT_NAME}/
)