octomap: upgrade to 1.8.0

Also backport a patch improving generation of config.cmake
files. This makes octomap libraries relocatable which is
required for successful cross-compilation builds.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
This commit is contained in:
Dmitry Rozhkov 2017-02-01 14:43:57 +02:00
parent 7dd67496c5
commit 6239ae221a
2 changed files with 128 additions and 3 deletions

View File

@ -0,0 +1,123 @@
From 64f9a20cf201936acdfdad40cbd6ee372ff2d9cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Javier=20V=2E=20G=C3=B3mez?= <engjotauve@gmail.com>
Date: Mon, 2 May 2016 22:20:21 +0200
Subject: [PATCH] Improve the generation of config.cmake and version.cmake
files
Improve the generation of config.cmake and version.cmake files, relocatable via CONFIGURE_PACKAGE_CONFIG_FILE. Upgrades the Travis build farm requirements to Ubuntu Trusty.
Upstream-Status: Backported
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
CMakeLists.txt | 32 +++++++++++++++++++++++---------
octomap-config-version.cmake.in | 11 -----------
octomap-config.cmake.in | 14 ++++++--------
3 files changed, 29 insertions(+), 28 deletions(-)
delete mode 100644 octomap/octomap-config-version.cmake.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fcafca1..1ba3417 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT( octomap )
ENABLE_TESTING()
@@ -103,11 +103,18 @@ ENDIF()
# not used right now (export depends?)
#set(OCTOMAP_CMAKE_DIR "${PROJECT_BINARY_DIR}")
-configure_file(octomap-config.cmake.in
- "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config.cmake" @ONLY)
-configure_file(octomap-config-version.cmake.in
- "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config-version.cmake" @ONLY)
+include(CMakePackageConfigHelpers)
+CONFIGURE_PACKAGE_CONFIG_FILE(
+ octomap-config.cmake.in
+ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config.cmake"
+ PATH_VARS OCTOMAP_INCLUDE_DIRS OCTOMAP_LIB_DIR
+ INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/octomap)
+
+WRITE_BASIC_PACKAGE_VERSION_FILE(
+ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cmake/octomap/octomap-config-version.cmake"
+ VERSION ${OCTOMAP_VERSION}
+ COMPATIBILITY AnyNewerVersion)
# Create a octomap-config.cmake file for the use from the install tree
# and install it
@@ -115,10 +122,17 @@ set(OCTOMAP_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include")
set(OCTOMAP_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
#set(OCTOMAP_CMAKE_DIR "${INSTALL_DATA_DIR}/FooBar/CMake")
-configure_file(octomap-config.cmake.in
- "${PROJECT_BINARY_DIR}/InstallFiles/octomap-config.cmake" @ONLY)
-configure_file(octomap-config-version.cmake.in
- "${PROJECT_BINARY_DIR}/InstallFiles/octomap-config-version.cmake" @ONLY)
+CONFIGURE_PACKAGE_CONFIG_FILE(
+ octomap-config.cmake.in
+ "${PROJECT_BINARY_DIR}/InstallFiles/octomap-config.cmake"
+ PATH_VARS OCTOMAP_INCLUDE_DIRS OCTOMAP_LIB_DIR
+ INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/octomap)
+
+WRITE_BASIC_PACKAGE_VERSION_FILE(
+ ${PROJECT_BINARY_DIR}/InstallFiles/octomap-config-version.cmake
+ VERSION ${OCTOMAP_VERSION}
+ COMPATIBILITY AnyNewerVersion)
+
install(FILES
"${PROJECT_BINARY_DIR}/InstallFiles/octomap-config.cmake"
"${PROJECT_BINARY_DIR}/InstallFiles/octomap-config-version.cmake"
diff --git a/octomap-config-version.cmake.in b/octomap-config-version.cmake.in
deleted file mode 100644
index c1a1173..0000000
--- a/octomap-config-version.cmake.in
+++ /dev/null
@@ -1,11 +0,0 @@
-set(PACKAGE_VERSION "@OCTOMAP_VERSION@")
-
-# Check whether the requested PACKAGE_FIND_VERSION is compatible
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
- set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else()
- set(PACKAGE_VERSION_COMPATIBLE TRUE)
- if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
- set(PACKAGE_VERSION_EXACT TRUE)
- endif()
-endif()
\ No newline at end of file
diff --git a/octomap-config.cmake.in b/octomap-config.cmake.in
index 2f5ba8c..5ab5dee 100644
--- a/octomap-config.cmake.in
+++ b/octomap-config.cmake.in
@@ -17,18 +17,16 @@
# LINK_DIRECTORIES with this path is NOT needed.
# - OCTOMAP_INCLUDE_DIRS : The OctoMap include directories.
#
-# Based on the example CMake Tutorial
-# http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
-# and OpenCVConfig.cmake.in from OpenCV
# ===================================================================================
-
-set(OCTOMAP_INCLUDE_DIRS "@OCTOMAP_INCLUDE_DIRS@")
-set(OCTOMAP_LIBRARY_DIRS "@OCTOMAP_LIB_DIR@")
+@PACKAGE_INIT@
+
+set(OCTOMAP_INCLUDE_DIRS "@PACKAGE_OCTOMAP_INCLUDE_DIRS@")
+set(OCTOMAP_LIBRARY_DIRS "@PACKAGE_OCTOMAP_LIB_DIR@")
# Set library names
set(OCTOMAP_LIBRARIES
- "@OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@"
- "@OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@"
+ "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMAP_LIBRARY@"
+ "@PACKAGE_OCTOMAP_LIB_DIR@/@OCTOMATH_LIBRARY@"
)
--
2.7.4

View File

@ -3,9 +3,11 @@ SECTION = "devel"
LICENSE = "BSD" LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9b0e1f01a68f441eeaf7b5e18812d3c8" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9b0e1f01a68f441eeaf7b5e18812d3c8"
SRC_URI = "https://github.com/OctoMap/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz" SRC_URI = "https://github.com/OctoMap/${BPN}/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
SRC_URI[md5sum] = "3cba6c41544c89a8b51610bdec610f00" file://0001-Improve-the-generation-of-config.cmake-and-version.c.patch \
SRC_URI[sha256sum] = "3383ee9c6b18577c860d747369c84814058e2a9413f7d482846b1e02ce76f0f7" "
SRC_URI[md5sum] = "e341c3ef92c978cc0261158bbafbf46a"
SRC_URI[sha256sum] = "158f66af55bb660a2aa7d0a00c60c9e5320f6594bd0924748af1471d315d5633"
S = "${WORKDIR}/${BP}/${BPN}" S = "${WORKDIR}/${BP}/${BPN}"