Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danielduberg committed Mar 2, 2020
1 parent dad39a5 commit 8373b2c
Show file tree
Hide file tree
Showing 9 changed files with 1,582 additions and 0 deletions.
87 changes: 87 additions & 0 deletions ufomap_rviz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
cmake_minimum_required(VERSION 2.8.3)
project(ufomap_rviz_plugin)

set(CMAKE_CXX_STANDARD 17)

find_package(catkin REQUIRED COMPONENTS
roscpp
rviz
ufomap_msgs
ufomap_ros
)

find_package(ufomap REQUIRED)

## This setting causes Qt's "MOC" generation to happen automatically.
set(CMAKE_AUTOMOC ON)

## This plugin includes Qt widgets, so we must include Qt.
## We will use the version that rviz used so they are compatible.
if(rviz_QT_VERSION VERSION_LESS "5")
# Should be error
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
## pull in all required include dirs, define QT_LIBRARIES, etc.
include(${QT_USE_FILE})
else()
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets)
## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
set(QT_LIBRARIES Qt5::Widgets)
endif()

## If you prefer the Qt signals and slots to avoid defining "emit", "slots",
## etc because they can conflict with boost signals, define QT_NO_KEYWORDS here.
# add_definitions(-DQT_NO_KEYWORDS)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp rviz ufomap_msgs
DEPENDS ufomap
)

include_directories(
include
${catkin_INCLUDE_DIRS}
${UFOMAP_INCLUDE_DIRS}
)

link_directories(
${catkin_LIBRARY_DIRS}
${UFOMAP_LIBRARY_DIRS}
)

QT5_WRAP_CPP(MOC_FILES
include/ufomap_rviz_plugin/octree_base_display.h
include/ufomap_rviz_plugin/octree_display.h
include/ufomap_rviz_plugin/octree_rgb_display.h
OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED -DBOOST_LEXICAL_CAST_INCLUDED
)

add_library(${PROJECT_NAME}
# src/octree_base_display.cpp
src/octree_display.cpp
src/octree_rgb_display.cpp
${MOC_FILES}
)

target_link_libraries(${PROJECT_NAME}
${QT_LIBRARIES}
${UFOMAP_LIBRARIES}
${catkin_LIBRARIES}
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(FILES plugin_description.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
Loading

0 comments on commit 8373b2c

Please sign in to comment.