Enable adding as a CMake subproject (#262)
Add support for building libcartographer in the same project Support adding as a CMake subproject by using the PROJECT_*_DIR variables instead of the absolute CMAKE_*_DIR variables. Resolve a signed-unsigned comparison compiler warning Fix comment typomaster
parent
f7057fc5a3
commit
02044fc86a
|
@ -122,8 +122,8 @@ add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
|
||||||
# Add the binary directory first, so that port.h is included after it has
|
# Add the binary directory first, so that port.h is included after it has
|
||||||
# been generated.
|
# been generated.
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ install(TARGETS ${PROJECT_NAME}
|
||||||
# Install source headers.
|
# Install source headers.
|
||||||
file(GLOB_RECURSE HDRS "*.h")
|
file(GLOB_RECURSE HDRS "*.h")
|
||||||
foreach(HDR ${HDRS})
|
foreach(HDR ${HDRS})
|
||||||
file(RELATIVE_PATH REL_FIL ${CMAKE_SOURCE_DIR} ${HDR})
|
file(RELATIVE_PATH REL_FIL ${PROJECT_SOURCE_DIR} ${HDR})
|
||||||
get_filename_component(INSTALL_DIR ${REL_FIL} DIRECTORY)
|
get_filename_component(INSTALL_DIR ${REL_FIL} DIRECTORY)
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace {
|
||||||
|
|
||||||
namespace carto = ::cartographer;
|
namespace carto = ::cartographer;
|
||||||
|
|
||||||
// Writes an occupany grid.
|
// Writes an occupancy grid.
|
||||||
void Write2DAssets(const std::vector<::cartographer::mapping::TrajectoryNode>&
|
void Write2DAssets(const std::vector<::cartographer::mapping::TrajectoryNode>&
|
||||||
trajectory_nodes,
|
trajectory_nodes,
|
||||||
const NodeOptions& options, const std::string& stem) {
|
const NodeOptions& options, const std::string& stem) {
|
||||||
|
|
|
@ -117,7 +117,7 @@ void HandleMessage(
|
||||||
ToPointCloudWithIntensities(message);
|
ToPointCloudWithIntensities(message);
|
||||||
CHECK(point_cloud.intensities.size() == point_cloud.points.size());
|
CHECK(point_cloud.intensities.size() == point_cloud.points.size());
|
||||||
|
|
||||||
for (int i = 0; i < point_cloud.points.size(); ++i) {
|
for (size_t i = 0; i < point_cloud.points.size(); ++i) {
|
||||||
batch->points.push_back(sensor_to_map * point_cloud.points[i]);
|
batch->points.push_back(sensor_to_map * point_cloud.points[i]);
|
||||||
batch->intensities.push_back(point_cloud.intensities[i]);
|
batch->intensities.push_back(point_cloud.intensities[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,8 +63,8 @@ add_definitions(-DQT_NO_KEYWORDS)
|
||||||
# Add the binary directory first, so that port.h is included after it has
|
# Add the binary directory first, so that port.h is included after it has
|
||||||
# been generated.
|
# been generated.
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue