Skip to content
Snippets Groups Projects
Commit 7dd67496 authored by Lukas Bulwahn's avatar Lukas Bulwahn Committed by GitHub
Browse files

Merge pull request #449 from rojkov/geometric-shapes

Drop cmake tweaks in recipes depending on Octomap
parents 45ff6a3b 03ab6d41
No related branches found
No related tags found
No related merge requests found
From 52bb65e7c64765265578109fddba5a189eaec6bf Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Wed, 25 Jan 2017 14:15:14 +0200
Subject: [PATCH] Add Findoctomap module
octomap's authors use absolute paths in the cmake module they
ship together with the package. This makes the module unusable
in cross-compilation environments or requires additional
tweaking (e.g. see https://github.com/bmwcarit/meta-ros/blob/43bd17e8839f4078351895eca361804f19efb13c/recipes-ros/octomap-ros/octomap-ros_0.4.0.bb#L16)
This patch overrides the module in order to ease octomap's
usage in cross-compilation environments.
Upstream-Status: Submitted [https://github.com/ros/cmake_modules/pull/43]
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
cmake/Modules/Findoctomap.cmake | 74 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 cmake/Modules/Findoctomap.cmake
diff --git a/cmake/Modules/Findoctomap.cmake b/cmake/Modules/Findoctomap.cmake
new file mode 100644
index 0000000..1fee377
--- /dev/null
+++ b/cmake/Modules/Findoctomap.cmake
@@ -0,0 +1,74 @@
+##################################################################################################
+#
+# CMake script for finding Octomap.
+#
+# Input variables:
+#
+# - Octomap_ROOT_DIR (optional): When specified, header files and libraries will be searched for in
+# ${Octomap_ROOT_DIR}/include
+# ${Octomap_ROOT_DIR}/libs
+# respectively, and the default CMake search order will be ignored. When unspecified, the default
+# CMake search order is used.
+# This variable can be specified either as a CMake or environment variable. If both are set,
+# preference is given to the CMake variable.
+# Use this variable for finding packages installed in a nonstandard location, or for enforcing
+# that one of multiple package installations is picked up.
+#
+#
+# Cache variables (not intended to be used in CMakeLists.txt files)
+#
+# - Octomap_INCLUDE_DIR: Absolute path to package headers.
+# - Octomap_LIBRARY: Absolute path to library.
+#
+#
+# Output variables:
+#
+# - Octomap_FOUND: Boolean that indicates if the package was found
+# - Otomap_INCLUDE_DIRS: Paths to the necessary header files
+# - Octomap_LIBRARIES: Package libraries
+#
+#
+# Example usage:
+#
+# find_package(Octomap)
+# if(NOT Octomap_FOUND)
+# # Error handling
+# endif()
+# ...
+# include_directories(${Octomap_INCLUDE_DIRS} ...)
+# ...
+# target_link_libraries(my_target ${Octomap_LIBRARIES})
+#
+##################################################################################################
+
+# Get package location hint from environment variable (if any)
+if(NOT Octomap_ROOT_DIR AND DEFINED ENV{Octomap_ROOT_DIR})
+ set(Octomap_ROOT_DIR "$ENV{Octomap_ROOT_DIR}" CACHE PATH
+ "Octomap base directory location (optional, used for nonstandard installation paths)")
+endif()
+
+# Search path for nonstandard package locations
+if(Octomap_ROOT_DIR)
+ set(Octomap_INCLUDE_PATH PATHS "${Octomap_ROOT_DIR}/include" NO_DEFAULT_PATH)
+ set(Octomap_LIBRARY_PATH PATHS "${Octomap_ROOT_DIR}/lib" NO_DEFAULT_PATH)
+endif()
+
+# Find headers and libraries
+find_path(Octomap_INCLUDE_DIR NAMES octomap.h PATH_SUFFIXES "octomap" ${Octomap_INCLUDE_PATH})
+find_library(Octomap_LIBRARY NAMES octomap PATH_SUFFIXES "octomap" ${Octomap_LIBRARY_PATH})
+
+mark_as_advanced(Octomap_INCLUDE_DIR
+ Octomap_LIBRARY)
+
+# Output variables generation
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(octomap DEFAULT_MSG Octomap_LIBRARY
+ Octomap_INCLUDE_DIR)
+
+set(Octomap_FOUND ${OCTOMAP_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
+#unset(OCTOMAP_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
+
+if(Octomap_FOUND)
+ set(OCTOMAP_INCLUDE_DIRS ${Octomap_INCLUDE_DIR})
+ set(OCTOMAP_LIBRARIES ${Octomap_LIBRARY})
+endif()
--
2.7.4
......@@ -4,7 +4,9 @@ SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://package.xml;beginline=9;endline=9;md5=d566ef916e9dedc494f5f793a6690ba5"
SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz \
file://0001-Add-Findoctomap-module.patch \
"
SRC_URI[md5sum] = "c3c2057e022976d89bddd857da028746"
SRC_URI[sha256sum] = "4f9358aab07cdc5455ee0545e6791a47687b6e5f4b8fe11481c168968105b8cb"
......
From 77e184e32b19bfd7ee64d3344bcff0a28eccbb4e Mon Sep 17 00:00:00 2001
From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Date: Wed, 28 Sep 2016 10:25:02 +0200
Subject: [PATCH] address gcc6 build error (backport for 0.4.4)
With gcc6, compiling fails with `stdlib.h: No such file or directory`,
as including '-isystem /usr/include' breaks with gcc6, cf.,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129.
This commit addresses this issue for this package in the same way
it was addressed in various other ROS packages. A list of related
commits and pull requests is at:
https://github.com/ros/rosdistro/issues/12783
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Upstream-Status: Accepted [https://github.com/ros-planning/geometric_shapes/commit/7a0af36bb67c0718373f6bbac31959e8356cda92]
The content of commit 7a0af36bb67c0718373f6bbac31959e8356cda92 has been
manually backported for version 0.4.4, and resulted in this patch.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ae6b09..145d7a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,7 @@ if (HAVE_QHULL_2011)
endif()
include_directories(include)
-include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${ASSIMP_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS})
+include_directories(${EIGEN_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${ASSIMP_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS})
include_directories(${catkin_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS})
link_directories(${catkin_LIBRARY_DIRS} ${console_bridge_LIBRARY_DIRS} ${ASSIMP_LIBRARY_DIRS})
--
2.5.5
......@@ -6,10 +6,8 @@ LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=5ee5b8b046ae4
DEPENDS = "boost shape-msgs shape-tools octomap assimp libeigen qhull console-bridge random-numbers eigen-stl-containers resource-retriever"
SRC_URI = "https://github.com/ros-planning/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
SRC_URI[md5sum] = "f684af3e76eb37b4c0153527162d73dc"
SRC_URI[sha256sum] = "4d600890b72d0b20b2fbcc9ded06464a37c871317445ec32d3858bd719b0aa02"
SRC_URI += "file://0001-address-gcc6-build-error-backport-for-0.4.4.patch"
SRC_URI[md5sum] = "2a11cd903e581f4e9cef57551e3f284b"
SRC_URI[sha256sum] = "dc3e826930642d6a2e47e8847550c680d03649fa90ca521fa752ff01bd3b697c"
S = "${WORKDIR}/${ROS_SP}"
......
From f356c90e28477b6b5ec16e9941cd536eaf987186 Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Wed, 25 Jan 2017 15:41:00 +0200
Subject: [PATCH] Add build dep on cmake_modules
The cmake module shipped with the octomap package uses absolute paths
that break cross-compilation builds and require additional tweaking
(e.g. see https://github.com/bmwcarit/meta-ros/blob/43bd17e8839f4078351895eca361804f19efb13c/recipes-ros/octomap-ros/octomap-ros_0.4.0.bb#L16)
This patch makes octomap_ros use the cmake module provided by ROS's
cmake_modules package to avoid such tweaks.
Upstream-Status: Submitted [https://github.com/OctoMap/octomap_ros/pull/6]
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
CMakeLists.txt | 2 +-
package.xml | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e86728..a91f6a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(octomap_ros)
-find_package(catkin REQUIRED COMPONENTS sensor_msgs tf octomap_msgs)
+find_package(catkin REQUIRED COMPONENTS cmake_modules sensor_msgs tf octomap_msgs)
find_package(octomap REQUIRED)
catkin_package(
diff --git a/package.xml b/package.xml
index 69e0883..ab8f51d 100644
--- a/package.xml
+++ b/package.xml
@@ -15,6 +15,7 @@
<buildtool_depend>catkin</buildtool_depend>
<build_depend>catkin</build_depend>
+ <build_depend>cmake_modules</build_depend>
<build_depend>octomap_msgs</build_depend>
<build_depend>octomap</build_depend>
<build_depend>sensor_msgs</build_depend>
--
2.7.4
......@@ -3,19 +3,14 @@ SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=d566ef916e9dedc494f5f793a6690ba5"
DEPENDS = "octomap-msgs octomap pcl-ros sensor-msgs tf"
DEPENDS = "cmake-modules octomap-msgs octomap pcl-ros sensor-msgs tf"
SRC_URI = "https://github.com/OctoMap/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
SRC_URI = "https://github.com/OctoMap/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz \
file://0001-Add-build-dep-on-cmake_modules.patch \
"
SRC_URI[md5sum] = "4cd3fd7f2f94567ab6d37ee0ae756573"
SRC_URI[sha256sum] = "6f4f90bbfe88c8314a406cfe70f0c4388d4d2d85a461d90911b2e6bf738ed153"
S = "${WORKDIR}/${ROS_SP}"
inherit catkin
do_configure_append() {
sed -i -e 's: /usr/lib/liboctomap.so: ${STAGING_LIBDIR}/liboctomap.so:g' \
-e 's: /usr/lib/liboctomath.so: ${STAGING_LIBDIR}/liboctomath.so:g' \
${B}/CMakeFiles/octomap_ros.dir/build.make
sed -i -e 's:-L\/opt\/ros\/indigo\/lib::g' ${B}/CMakeFiles/octomap_ros.dir/link.txt
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment