Remove use of google_library and google_test. (#234)

* Fixes Dockerfile.indigo copying.
master
Damon Kohler 2016-12-20 16:20:27 +01:00 committed by GitHub
parent 0b4fa3d5b1
commit 58069b0033
7 changed files with 148 additions and 230 deletions

View File

@ -22,7 +22,6 @@ cache:
- /home/travis/docker/ - /home/travis/docker/
env: env:
matrix:
- ROS_RELEASE=indigo DOCKER_CACHE_FILE=/home/travis/docker/indigo-cache.tar.gz - ROS_RELEASE=indigo DOCKER_CACHE_FILE=/home/travis/docker/indigo-cache.tar.gz
- ROS_RELEASE=kinetic DOCKER_CACHE_FILE=/home/travis/docker/kinetic-cache.tar.gz - ROS_RELEASE=kinetic DOCKER_CACHE_FILE=/home/travis/docker/kinetic-cache.tar.gz

View File

@ -46,19 +46,19 @@ RUN cartographer_ros/scripts/install.sh --pkg ceres-solver
RUN cartographer_ros/scripts/install.sh --pkg cartographer && \ RUN cartographer_ros/scripts/install.sh --pkg cartographer && \
cartographer_ros/scripts/install.sh --pkg cartographer --make-args test cartographer_ros/scripts/install.sh --pkg cartographer --make-args test
COPY cartographer_ros_msgs catkin_ws/src/cartographer_ros/ COPY cartographer_ros_msgs catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs && \ RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs && \
cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs \ cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs \
--catkin-make-args run_tests && \ --catkin-make-args run_tests && \
cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros_msgs cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros_msgs
COPY cartographer_ros catkin_ws/src/cartographer_ros/ COPY cartographer_ros catkin_ws/src/cartographer_ros/cartographer_ros/
RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros && \ RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros && \
cartographer_ros/scripts/install.sh --pkg cartographer_ros \ cartographer_ros/scripts/install.sh --pkg cartographer_ros \
--catkin-make-args run_tests && \ --catkin-make-args run_tests && \
cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros
COPY cartographer_rviz catkin_ws/src/cartographer_ros/ COPY cartographer_rviz catkin_ws/src/cartographer_ros/cartographer_rviz/
RUN cartographer_ros/scripts/install.sh --pkg cartographer_rviz && \ RUN cartographer_ros/scripts/install.sh --pkg cartographer_rviz && \
cartographer_ros/scripts/install.sh --pkg cartographer_rviz \ cartographer_ros/scripts/install.sh --pkg cartographer_rviz \
--catkin-make-args run_tests && \ --catkin-make-args run_tests && \

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
cmake_minimum_required(VERSION 2.8.3) cmake_minimum_required(VERSION 2.8.12) # Ships with Ubuntu 14.04 (Trusty)
project(cartographer_ros) project(cartographer_ros)
@ -44,6 +44,7 @@ find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})
include(FindPkgConfig) include(FindPkgConfig)
pkg_search_module(YAMLCPP REQUIRED yaml-cpp>=0.5.1) pkg_search_module(YAMLCPP REQUIRED yaml-cpp>=0.5.1)
find_package(LuaGoogle REQUIRED)
find_package(PCL REQUIRED COMPONENTS common io) find_package(PCL REQUIRED COMPONENTS common io)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system iostreams) find_package(Boost REQUIRED COMPONENTS system iostreams)
@ -59,10 +60,18 @@ include_directories(
${urdfdom_headers_INCLUDE_DIRS} ${urdfdom_headers_INCLUDE_DIRS}
) )
# Override Catkin's GTest configuration to use GMock.
set(GTEST_FOUND TRUE)
set(GTEST_INCLUDE_DIRS ${GMOCK_INCLUDE_DIRS})
set(GTEST_LIBRARIES ${GMOCK_LIBRARIES})
catkin_package( catkin_package(
CATKIN_DEPENDS CATKIN_DEPENDS
${PACKAGE_DEPENDENCIES} ${PACKAGE_DEPENDENCIES}
DEPENDS DEPENDS
# TODO(damonkohler): This should be here but causes Catkin to abort because
# protobuf specifies a library '-lpthread' instead of just 'pthread'.
# CARTOGRAPHER
YAMLCPP YAMLCPP
PCL PCL
EIGEN3 EIGEN3
@ -72,14 +81,86 @@ catkin_package(
LIBRARIES ${PROJECT_NAME} LIBRARIES ${PROJECT_NAME}
) )
SET(ALL_LIBRARIES "" CACHE INTERNAL "ALL_LIBRARIES") file(GLOB_RECURSE ALL_SRCS "*.cc" "*.h")
file(GLOB_RECURSE ALL_TESTS "*_test.cc")
file(GLOB_RECURSE ALL_EXECUTABLES "*_main.cc")
list(REMOVE_ITEM ALL_SRCS ${ALL_TESTS})
list(REMOVE_ITEM ALL_SRCS ${ALL_EXECUTABLES})
add_library(${PROJECT_NAME} ${ALL_SRCS})
add_subdirectory("cartographer_ros") add_subdirectory("cartographer_ros")
google_combined_library(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS})
SRCS "${ALL_LIBRARIES}" target_link_libraries(${PROJECT_NAME} PUBLIC ${CARTOGRAPHER_LIBRARIES})
# YAML
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${YAMLCPP_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${YAMLCPP_LIBRARIES})
# Lua
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${LUA_INCLUDE_DIR})
# PCL
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${PCL_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${PCL_LIBRARIES})
foreach(DEFINITION ${PCL_DEFINITIONS})
set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${DEFINITION}")
endforeach()
# Eigen
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${EIGEN3_INCLUDE_DIR}")
# Boost
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${Boost_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES})
# Catkin
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${catkin_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
# Add the binary directory first, so that port.h is included after it has
# been generated.
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
) )
set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(configuration_files_test "cartographer_ros/configuration_files_test.cc")
# catkin_add_gtest uses a plain (i.e. no PUBLIC/PRIVATE/INTERFACE) call to
# target_link_libraries. That forces us to do the same.
target_include_directories(configuration_files_test SYSTEM PUBLIC ${LUA_INCLUDE_DIR})
target_link_libraries(configuration_files_test ${LUA_LIBRARIES})
target_include_directories(configuration_files_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(configuration_files_test ${catkin_LIBRARIES})
add_dependencies(configuration_files_test ${catkin_EXPORTED_TARGETS})
target_include_directories(configuration_files_test SYSTEM PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS})
target_link_libraries(configuration_files_test ${CARTOGRAPHER_LIBRARIES})
target_link_libraries(configuration_files_test ${PROJECT_NAME})
set_target_properties(configuration_files_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
catkin_add_gtest(time_conversion_test "cartographer_ros/time_conversion_test.cc")
# catkin_add_gtest uses a plain (i.e. no PUBLIC/PRIVATE/INTERFACE) call to
# target_link_libraries. That forces us to do the same.
target_include_directories(time_conversion_test SYSTEM PUBLIC ${LUA_INCLUDE_DIR})
target_link_libraries(time_conversion_test ${LUA_LIBRARIES})
target_include_directories(time_conversion_test SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(time_conversion_test ${catkin_LIBRARIES})
add_dependencies(time_conversion_test ${catkin_EXPORTED_TARGETS})
target_include_directories(time_conversion_test SYSTEM PUBLIC ${CARTOGRAPHER_INCLUDE_DIRS})
target_link_libraries(time_conversion_test ${CARTOGRAPHER_LIBRARIES})
target_link_libraries(time_conversion_test ${PROJECT_NAME})
set_target_properties(time_conversion_test PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
endif()
install(DIRECTORY launch urdf configuration_files install(DIRECTORY launch urdf configuration_files
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
) )
@ -93,3 +174,16 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
) )
# Install source headers.
file(GLOB_RECURSE hdrs "*.h")
foreach(HDR ${hdrs})
file(RELATIVE_PATH REL_FIL ${CMAKE_SOURCE_DIR} ${HDR})
get_filename_component(INSTALL_DIR ${REL_FIL} DIRECTORY)
install(
FILES
${HDR}
DESTINATION
include/${INSTALL_DIR}
)
endforeach()

View File

@ -1,186 +1,25 @@
google_library(assets_writer # Copyright 2016 The Cartographer Authors
USES_CARTOGRAPHER #
SRCS # Licensed under the Apache License, Version 2.0 (the "License");
assets_writer.cc # you may not use this file except in compliance with the License.
HDRS # You may obtain a copy of the License at
assets_writer.h #
DEPENDS # http://www.apache.org/licenses/LICENSE-2.0
map_writer #
node_options # Unless required by applicable law or agreed to in writing, software
occupancy_grid # 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
google_library(bag_reader # limitations under the License.
USES_CARTOGRAPHER
USES_GLOG
SRCS
bag_reader.cc
HDRS
bag_reader.h
)
google_library(map_builder_bridge
USES_CARTOGRAPHER
SRCS
map_builder_bridge.cc
HDRS
map_builder_bridge.h
DEPENDS
assets_writer
msg_conversion
node_options
occupancy_grid
sensor_bridge
tf_bridge
)
google_library(map_writer
USES_GLOG
USES_YAMLCPP
SRCS
map_writer.cc
HDRS
map_writer.h
)
google_library(msg_conversion
USES_CARTOGRAPHER
USES_GLOG
USES_PCL
SRCS
msg_conversion.cc
HDRS
msg_conversion.h
DEPENDS
time_conversion
)
google_library(node
USES_CARTOGRAPHER
USES_EIGEN
USES_GLOG
SRCS
node.cc
HDRS
node.h
DEPENDS
map_builder_bridge
msg_conversion
node_options
sensor_bridge
tf_bridge
time_conversion
)
google_library(node_options
USES_CARTOGRAPHER
USES_GLOG
SRCS
node_options.cc
HDRS
node_options.h
DEPENDS
sensor_bridge
)
google_library(occupancy_grid
USES_CARTOGRAPHER
USES_GLOG
SRCS
occupancy_grid.cc
HDRS
occupancy_grid.h
DEPENDS
node_options
time_conversion
)
google_library(ros_log_sink
USES_GLOG
SRCS
ros_log_sink.cc
HDRS
ros_log_sink.h
)
google_library(sensor_bridge
USES_CARTOGRAPHER
SRCS
sensor_bridge.cc
HDRS
sensor_bridge.h
DEPENDS
msg_conversion
tf_bridge
time_conversion
)
google_library(tf_bridge
USES_CARTOGRAPHER
SRCS
tf_bridge.cc
HDRS
tf_bridge.h
DEPENDS
msg_conversion
time_conversion
)
google_library(time_conversion
USES_CARTOGRAPHER
SRCS
time_conversion.cc
HDRS
time_conversion.h
)
google_library(urdf_reader
USES_CARTOGRAPHER
SRCS
urdf_reader.cc
HDRS
urdf_reader.h
DEPENDS
msg_conversion
)
google_test(configuration_files_test
USES_CARTOGRAPHER
SRCS
configuration_files_test.cc
DEPENDS
node_options
)
google_test(time_conversion_test
USES_CARTOGRAPHER
SRCS
time_conversion_test.cc
DEPENDS
time_conversion
)
google_binary(cartographer_assets_writer google_binary(cartographer_assets_writer
USES_CARTOGRAPHER
USES_GFLAGS
USES_GLOG
SRCS SRCS
assets_writer_main.cc assets_writer_main.cc
DEPENDS
bag_reader
msg_conversion
time_conversion
urdf_reader
) )
google_binary(cartographer_node google_binary(cartographer_node
USES_CARTOGRAPHER
USES_GFLAGS
SRCS SRCS
node_main.cc node_main.cc
DEPENDS
node
ros_log_sink
) )
install(TARGETS cartographer_node install(TARGETS cartographer_node
@ -196,15 +35,8 @@ install(TARGETS cartographer_assets_writer
) )
google_binary(cartographer_offline_node google_binary(cartographer_offline_node
USES_CARTOGRAPHER
USES_GFLAGS
SRCS SRCS
offline_node_main.cc offline_node_main.cc
DEPENDS
bag_reader
node
ros_log_sink
urdf_reader
) )
install(TARGETS cartographer_offline_node install(TARGETS cartographer_offline_node

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8.12) # Ships with Ubuntu 14.04 (Trusty)
project(cartographer_rviz) project(cartographer_rviz)
@ -29,6 +29,7 @@ find_package(cartographer REQUIRED)
include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake") include("${CARTOGRAPHER_CMAKE_DIR}/functions.cmake")
google_initialize_cartographer_project() google_initialize_cartographer_project()
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system iostreams) find_package(Boost REQUIRED COMPONENTS system iostreams)
find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES}) find_package(catkin REQUIRED COMPONENTS ${PACKAGE_DEPENDENCIES})
@ -39,6 +40,11 @@ catkin_package(
INCLUDE_DIRS "." INCLUDE_DIRS "."
) )
file(GLOB_RECURSE ALL_SRCS "*.cc" "*.h")
message(${ALL_SRCS})
add_library(${PROJECT_NAME} ${ALL_SRCS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${QT_LIBRARIES})
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
if(rviz_QT_VERSION VERSION_LESS "5") if(rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
@ -55,26 +61,31 @@ else()
endif() endif()
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_NO_KEYWORDS)
SET(ALL_LIBRARIES "" CACHE INTERNAL "ALL_LIBRARIES") # Add the binary directory first, so that port.h is included after it has
# been generated.
add_subdirectory("cartographer_rviz") target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
# Create an empty file for the shared library we require for RViz. $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
set(DUMMY_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/empty.cc) $<INSTALL_INTERFACE:include>
add_custom_command(
OUTPUT ${DUMMY_SOURCE}
COMMAND cmake -E touch ${DUMMY_SOURCE}
DEPENDS ${ARG_SRCS}
)
add_library(cartographer_rviz_submaps_visualization ${DUMMY_SOURCE})
target_link_libraries(cartographer_rviz_submaps_visualization
${QT_LIBRARIES}
"-Wl,--whole-archive"
${ALL_LIBRARIES}
"-Wl,--no-whole-archive"
) )
install(TARGETS cartographer_rviz_submaps_visualization target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${EIGEN3_INCLUDE_DIR}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${EIGEN3_LIBRARIES})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${Boost_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${catkin_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${catkin_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}

View File

@ -1,18 +0,0 @@
google_library(drawable_submap
USES_CARTOGRAPHER
USES_EIGEN
SRCS
drawable_submap.cc
HDRS
drawable_submap.h
)
google_library(submaps_display
USES_CARTOGRAPHER
SRCS
submaps_display.cc
HDRS
submaps_display.h
DEPENDS
drawable_submap
)

View File

@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
--> -->
<library path="lib/libcartographer_rviz_submaps_visualization"> <library path="lib/libcartographer_rviz">
<class name="Submaps" <class name="Submaps"
type="cartographer_rviz::SubmapsDisplay" type="cartographer_rviz::SubmapsDisplay"
base_class_type="rviz::Display"> base_class_type="rviz::Display">