From 1bc27fe3f64d7311ac4439c8dfbfd79df015b0c5 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Wed, 10 Jan 2018 15:03:54 +0100 Subject: [PATCH] [CMake] Add flags related to Octomap in pkg-config file --- CMakeLists.txt | 13 +++--- include/hpp/fcl/config-fcl.hh.in | 43 ------------------- include/hpp/fcl/math/tools.h | 1 - include/hpp/fcl/math/vec_3f.h | 1 - include/hpp/fcl/mesh_loader/assimp.h | 2 - .../hpp/fcl/traversal/traversal_node_setup.h | 1 - test/test_fcl_eigen.cpp | 1 - 7 files changed, 8 insertions(+), 54 deletions(-) delete mode 100644 include/hpp/fcl/config-fcl.hh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c138749..fde0df47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ if (OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS) else() message(STATUS "FCL does not use Octomap") endif() +add_definitions (-DFCL_HAVE_OCTOMAP=${FCL_HAVE_OCTOMAP}) ADD_REQUIRED_DEPENDENCY("assimp >= 2.0") if(ASSIMP_FOUND) if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150") @@ -172,10 +173,12 @@ PKG_CONFIG_APPEND_BOOST_LIBS(thread date_time filesystem system) IF(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) PKG_CONFIG_APPEND_CFLAGS("-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES") ENDIF(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) +PKG_CONFIG_APPEND_CFLAGS("-DFCL_HAVE_OCTOMAP=${FCL_HAVE_OCTOMAP}") +IF(FCL_HAVE_OCTOMAP) + PKG_CONFIG_APPEND_CFLAGS( + "-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} \ + -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} \ + -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}") +ENDIF(FCL_HAVE_OCTOMAP) -config_files(include/hpp/fcl/config-fcl.hh) -install(FILES ${PROJECT_BINARY_DIR}/include/hpp/fcl/config-fcl.hh - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hpp/fcl - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - ) setup_project_finalize() diff --git a/include/hpp/fcl/config-fcl.hh.in b/include/hpp/fcl/config-fcl.hh.in deleted file mode 100644 index 8ef4c803..00000000 --- a/include/hpp/fcl/config-fcl.hh.in +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Software License Agreement (BSD License) - * - * Copyright (c) 2012, Willow Garage, Inc. - * 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. - * * Neither the name of Willow Garage, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 OWNER 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. - */ - -#ifndef FCL_CONFIG_FCL_HH -# define FCL_CONFIG_FCL_HH - -# include "config.h" - -#cmakedefine01 FCL_HAVE_OCTOMAP - -#endif // FCL_CONFIG_FCL_HH - diff --git a/include/hpp/fcl/math/tools.h b/include/hpp/fcl/math/tools.h index 23a4f18d..3628e384 100644 --- a/include/hpp/fcl/math/tools.h +++ b/include/hpp/fcl/math/tools.h @@ -40,7 +40,6 @@ #include <hpp/fcl/deprecated.hh> #include <hpp/fcl/config.hh> -#include <hpp/fcl/config-fcl.hh> #include <Eigen/Dense> #include <Eigen/Geometry> diff --git a/include/hpp/fcl/math/vec_3f.h b/include/hpp/fcl/math/vec_3f.h index 862219e1..a3568f87 100644 --- a/include/hpp/fcl/math/vec_3f.h +++ b/include/hpp/fcl/math/vec_3f.h @@ -38,7 +38,6 @@ #ifndef FCL_VEC_3F_H #define FCL_VEC_3F_H -#include <hpp/fcl/config-fcl.hh> #include <hpp/fcl/data_types.h> #include <Eigen/Core> diff --git a/include/hpp/fcl/mesh_loader/assimp.h b/include/hpp/fcl/mesh_loader/assimp.h index 134d0b5a..37bf7df6 100644 --- a/include/hpp/fcl/mesh_loader/assimp.h +++ b/include/hpp/fcl/mesh_loader/assimp.h @@ -37,8 +37,6 @@ #ifndef FCL_MESH_LOADER_ASSIMP_H #define FCL_MESH_LOADER_ASSIMP_H -#include <hpp/fcl/config-fcl.hh> - #ifdef FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES #include <assimp/DefaultLogger.hpp> #include <assimp/IOStream.hpp> diff --git a/include/hpp/fcl/traversal/traversal_node_setup.h b/include/hpp/fcl/traversal/traversal_node_setup.h index b169fa8e..bcde2941 100644 --- a/include/hpp/fcl/traversal/traversal_node_setup.h +++ b/include/hpp/fcl/traversal/traversal_node_setup.h @@ -39,7 +39,6 @@ #ifndef FCL_TRAVERSAL_NODE_SETUP_H #define FCL_TRAVERSAL_NODE_SETUP_H -#include <hpp/fcl/config-fcl.hh> #include <hpp/fcl/traversal/traversal_node_bvhs.h> #include <hpp/fcl/traversal/traversal_node_shapes.h> #include <hpp/fcl/traversal/traversal_node_bvh_shape.h> diff --git a/test/test_fcl_eigen.cpp b/test/test_fcl_eigen.cpp index a2eb13cb..66c5f791 100644 --- a/test/test_fcl_eigen.cpp +++ b/test/test_fcl_eigen.cpp @@ -38,7 +38,6 @@ #include <boost/test/unit_test.hpp> #include <boost/utility/binary.hpp> -#include <hpp/fcl/config-fcl.hh> #include <hpp/fcl/eigen/vec_3fx.h> using namespace fcl; -- GitLab