2016-09-20 16:30:21 +08:00
|
|
|
# Copyright 2016 The Cartographer Authors
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(cartographer_rviz)
|
|
|
|
|
|
|
|
set(PACKAGE_DEPENDENCIES
|
|
|
|
cartographer_ros_msgs
|
|
|
|
eigen_conversions
|
|
|
|
roscpp
|
|
|
|
rviz
|
|
|
|
)
|
|
|
|
|
2016-10-12 23:50:37 +08:00
|
|
|
find_package(Cartographer REQUIRED)
|
|
|
|
include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake")
|
|
|
|
google_initialize_cartographer_project()
|
2016-09-20 16:30:21 +08:00
|
|
|
|
2016-10-12 23:50:37 +08:00
|
|
|
find_package(Boost REQUIRED COMPONENTS system iostreams)
|
2016-09-20 16:30:21 +08:00
|
|
|
find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})
|
|
|
|
|
|
|
|
catkin_package(
|
|
|
|
CATKIN_DEPENDS
|
|
|
|
message_runtime
|
|
|
|
${PACKAGE_DEPENDENCIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
if(rviz_QT_VERSION VERSION_LESS "5")
|
|
|
|
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
|
|
|
|
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
|
|
|
|
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)
|
2016-10-20 00:27:23 +08:00
|
|
|
find_package(Qt5Widgets REQUIRED)
|
2016-09-20 16:30:21 +08:00
|
|
|
set(QT_LIBRARIES Qt5::Widgets)
|
|
|
|
endif()
|
|
|
|
add_definitions(-DQT_NO_KEYWORDS)
|
|
|
|
|
2016-10-12 23:50:37 +08:00
|
|
|
SET(ALL_LIBRARIES "" CACHE INTERNAL "ALL_LIBRARIES")
|
|
|
|
|
|
|
|
add_subdirectory("cartographer_rviz")
|
2016-09-20 16:30:21 +08:00
|
|
|
|
2016-10-12 23:50:37 +08:00
|
|
|
# Create an empty file for the shared library we require for RViz.
|
|
|
|
set(DUMMY_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/empty.cc)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${DUMMY_SOURCE}
|
|
|
|
COMMAND cmake -E touch ${DUMMY_SOURCE}
|
|
|
|
DEPENDS ${ARG_SRCS}
|
2016-09-20 16:30:21 +08:00
|
|
|
)
|
2016-10-12 23:50:37 +08:00
|
|
|
add_library(cartographer_rviz_submaps_visualization ${DUMMY_SOURCE})
|
2016-09-20 16:30:21 +08:00
|
|
|
target_link_libraries(cartographer_rviz_submaps_visualization
|
|
|
|
${QT_LIBRARIES}
|
2016-10-12 23:50:37 +08:00
|
|
|
"-Wl,--whole-archive"
|
|
|
|
${ALL_LIBRARIES}
|
|
|
|
"-Wl,--no-whole-archive"
|
2016-09-20 16:30:21 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS cartographer_rviz_submaps_visualization
|
|
|
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
|
|
|
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
|
|
|
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES rviz_plugin_description.xml
|
|
|
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
|
|
|
|
)
|
|
|
|
|
2016-09-28 20:36:22 +08:00
|
|
|
install(DIRECTORY ogre_media
|
|
|
|
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
|
2016-09-20 16:30:21 +08:00
|
|
|
)
|