Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rock macros #48

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# CMakeLists.txt has to be located in the project folder and cmake has to be
# executed from 'project/build' with 'cmake ../'.
cmake_minimum_required(VERSION 3.0)
project(maps VERSION 0.1)
cmake_minimum_required(VERSION 3.1)
project(maps VERSION 0.1 DESCRIPTION "Standard Maps library")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Rock)
set(BUILD_SHARED_LIBS ON)
include(GNUInstallDirs)

if(COVERAGE)
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand All @@ -29,8 +30,32 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-O1) # without any optimization, code is extreamly slow
endif()

add_definitions(-DNUMERIC_DEPRECATE=1 )

rock_init()
rock_standard_layout()
add_subdirectory(src)

# Export the library interface
install(EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)

# Create and install the version file
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${PROJECT_NAME}-config-version.cmake"
VERSION ${MAPS_VERSION}
COMPATIBILITY SameMajorVersion
)

install(
FILES
${PROJECT_NAME}-config.cmake
${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)

# Install package-manifest
#install(
# FILES package.xml
# DESTINATION ${CMAKE_INSTALL_DIR}/share/${PROJECT_NAME}
#)
2 changes: 1 addition & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<author> Autonomy Team/[email protected]</author>
<maintainer>Anna Born/[email protected]</maintainer>
<maintainer>Sascha Arnold/[email protected]</maintainer>
<license>BSD</license>
<license>BSD-2Clause</license>
<url>http://rock-robotics.org/</url>
<depend package="base/cmake"/>
<depend package="base/types"/>
Expand Down
3 changes: 3 additions & 0 deletions maps-config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
find_package(PkgConfig)

include("${CMAKE_CURRENT_LIST_DIR}/maps-targets.cmake")
46 changes: 46 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
Copyright (c) 2015, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<?xml version="1.0"?>
<package format="2">
<name>maps</name>
<version>0.0.0</version>
<description>Standard Maps library following the IEEE 1873 standard for mapa data representation with extensions (i.e: MLS, 3D, Operators, etc..)</description>
<author email="[email protected]">Autonomy Team</author>
<license>BSD 2-Clause "Simplified" License</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>base-types</depend>
<depend>base-numeric</depend>
<depend>base-boost_serialization</depend>
<depend>"cgal"</depend>
<depend>"gdal"</depend>
<depend>slam/pcl</depend>
<!--depend>"gui-vizkit3d"</depend-->

<export>
<build_type>ament_cmake</build_type>
</export>

</package>

108 changes: 49 additions & 59 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
find_package(Boost REQUIRED COMPONENTS system filesystem serialization)
find_package(CGAL REQUIRED COMPONENTS Core)
find_package(PCL 1.7 REQUIRED COMPONENTS io)
find_package(PkgConfig REQUIRED)
pkg_check_modules(DEPS REQUIRED IMPORTED_TARGET base-types base-logging boost_serialization)

rock_library(maps
SOURCES
set(SOURCES
grid/ElevationMap.cpp
grid/TraversabilityMap3d.cpp
grid/OccupancyGridMap.cpp
Expand All @@ -20,62 +21,51 @@ rock_library(maps
tools/SimpleTraversability.cpp
tools/SimpleTraversabilityRadialLUT.cpp
tools/TraversabilityGrassfire.cpp
HEADERS
LocalMap.hpp
grid/Index.hpp
grid/GridMap.hpp
grid/LevelList.hpp
grid/LayeredGridMap.hpp
grid/MultiLevelGridMap.hpp
grid/ElevationMap.hpp
grid/SurfacePatches.hpp
grid/MLSConfig.hpp
grid/MLSMap.hpp
grid/TraversabilityMap3d.hpp
grid/AccessIterator.hpp
grid/GridAccessInterface.hpp
grid/GridFacade.hpp
grid/VectorGrid.hpp
grid/VectorGridAccess.hpp
grid/DiscreteTree.hpp
grid/VoxelGridMap.hpp
grid/OccupancyGridMapBase.hpp
grid/OccupancyGridMap.hpp
grid/OccupancyConfiguration.hpp
grid/OccupancyPatch.hpp
grid/TraversabilityCell.hpp
grid/TraversabilityClass.hpp
grid/TraversabilityGrid.hpp
grid/TSDFPatch.hpp
grid/TSDFVolumetricMap.hpp
geometric/Point.hpp
geometric/LineSegment.hpp
geometric/GeometricMap.hpp
geometric/ContourMap.hpp
tools/BresenhamLine.hpp
tools/Overlap.hpp
tools/VoxelTraversal.hpp
tools/TSDFSurfaceReconstruction.hpp
tools/TSDFPolygonMeshReconstruction.hpp
tools/TSDF_MLSMapReconstruction.hpp
tools/MarchingCubes.hpp
tools/SurfaceIntersection.hpp
tools/MLSToSlopes.hpp
tools/SimpleTraversability.hpp
tools/SimpleTraversabilityRadialLUT.hpp
tools/TraversabilityGrassfire.hpp
tools/TraversabilityGrassfireConfig.hpp
tools/TraversabilityGrassFireSearchItem.hpp
operations/GridInterpolation.hpp
operations/CoverageMapGeneration.hpp
DEPS_PKGCONFIG
base-types
base-logging
boost_serialization
pcl_io-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}
DEPS_PLAIN
Boost_SYSTEM
Boost_FILESYSTEM
Boost_SERIALIZATION
)

add_library(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME}
PUBLIC
PkgConfig::DEPS
Boost::system
Boost::filesystem
Boost::serialization
${PCL_IO_LIBRARIES}
)

target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${PCL_INCLUDE_DIRS}
)

target_compile_definitions(${PROJECT_NAME}
PUBLIC
NUMERIC_DEPRECATE=1
)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.hpp"
)

install (TARGETS
${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

set(PKGCONFIG_CFLAGS)
set(PKGCONFIG_REQUIRES
base-types
base-logging
boost_serialization
pcl_io-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}
)
configure_file(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
7 changes: 3 additions & 4 deletions src/maps.pc.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: @TARGET_NAME@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Requires: @PKGCONFIG_REQUIRES@
Libs: -L${libdir} -l@TARGET_NAME@ @PKGCONFIG_LIBS@
Cflags: -I${includedir} @PKGCONFIG_CFLAGS@