Unverified Commit cdd0b106 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub
Browse files

Merge pull request #181 from jmirabel/devel

Fix usage of Boost.
parents dc2e397a 3c74a177
......@@ -76,14 +76,14 @@ if(BUILD_PYTHON_INTERFACE)
endif()
# Required dependencies
set(BOOST_COMPONENTS thread date_time system)
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} filesystem unit_test_framework chrono)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem unit_test_framework chrono timer)
if (BUILD_PYTHON_INTERFACE)
FINDPYTHON()
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
set(BOOST_COMPONENTS system python)
search_for_boost()
endif ()
search_for_boost()
# Optional dependencies
ADD_PROJECT_DEPENDENCY(octomap PKG_CONFIG_REQUIRES "octomap >= 1.6")
if(octomap_FOUND)
......@@ -123,7 +123,6 @@ FIND_PACKAGE(assimp REQUIRED)
SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/collision_data.h
include/hpp/fcl/profile.h
include/hpp/fcl/BV/kIOS.h
include/hpp/fcl/BV/BV.h
include/hpp/fcl/BV/RSS.h
......@@ -180,7 +179,6 @@ endif ()
add_subdirectory(test)
pkg_config_append_libs("hpp-fcl")
PKG_CONFIG_APPEND_BOOST_LIBS(thread date_time system)
IF(HPP_FCL_HAVE_OCTOMAP)
# FCL_HAVE_OCTOMAP kept for backward compatibility reasons.
PKG_CONFIG_APPEND_CFLAGS(
......
......@@ -252,7 +252,7 @@ public:
public:
CollisionResult()
: distance_lower_bound (std::numeric_limits<FCL_REAL>::max())
: distance_lower_bound ((std::numeric_limits<FCL_REAL>::max)())
{
}
......@@ -393,7 +393,7 @@ public:
static const int NONE = -1;
DistanceResult(FCL_REAL min_distance_ =
std::numeric_limits<FCL_REAL>::max()):
(std::numeric_limits<FCL_REAL>::max)()):
min_distance(min_distance_), o1(NULL), o2(NULL), b1(NONE), b2(NONE)
{
Vec3f nan (Vec3f::Constant(std::numeric_limits<FCL_REAL>::quiet_NaN()));
......@@ -451,7 +451,7 @@ public:
/// @brief clear the result
void clear()
{
min_distance = std::numeric_limits<FCL_REAL>::max();
min_distance = (std::numeric_limits<FCL_REAL>::max)();
o1 = NULL;
o2 = NULL;
b1 = NONE;
......
......@@ -38,9 +38,6 @@
#ifndef HPP_FCL_DATA_TYPES_H
#define HPP_FCL_DATA_TYPES_H
#include <cstddef>
#include <boost/cstdint.hpp>
#include <Eigen/Core>
#include <Eigen/Geometry>
......@@ -67,10 +64,6 @@ namespace hpp
namespace fcl
{
typedef double FCL_REAL;
typedef boost::uint64_t FCL_INT64;
typedef boost::int64_t FCL_UINT64;
typedef boost::uint32_t FCL_UINT32;
typedef boost::int32_t FCL_INT32;
typedef Eigen::Matrix<FCL_REAL, 3, 1> Vec3f;
typedef Eigen::Matrix<FCL_REAL, 3, 3> Matrix3f;
typedef Eigen::Vector2i support_func_guess_t;
......
......@@ -41,7 +41,6 @@
/// @cond INTERNAL
#include <hpp/fcl/math/transform.h>
#include <boost/math/special_functions/erf.hpp>
namespace hpp
{
......
......@@ -156,7 +156,7 @@ public:
/// @note except for OBB, this method returns the distance.
virtual FCL_REAL BVDistanceLowerBound(int /*b1*/, int /*b2*/) const
{
return std::numeric_limits<FCL_REAL>::max();
return (std::numeric_limits<FCL_REAL>::max)();
}
/// @brief Leaf test between node b1 and b2, if they are both leafs
......
......@@ -50,8 +50,6 @@
#include <hpp/fcl/narrowphase/narrowphase.h>
#include <hpp/fcl/internal/traversal.h>
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
#include <limits>
#include <vector>
#include <cassert>
......
......@@ -100,7 +100,7 @@ namespace fcl
if(contact_points) *contact_points = tf1.transform(w0 - epa.normal*(epa.depth *0.5));
return true;
}
distance_lower_bound = -std::numeric_limits<FCL_REAL>::max();
distance_lower_bound = -(std::numeric_limits<FCL_REAL>::max)();
// EPA failed but we know there is a collision so we should
return true;
}
......@@ -172,7 +172,7 @@ namespace fcl
p1 = p2 = tf1.transform(w0 - epa.normal*(epa.depth *0.5));
assert (distance <= 1e-6);
} else {
distance = -std::numeric_limits<FCL_REAL>::max();
distance = -(std::numeric_limits<FCL_REAL>::max)();
gjk.getClosestPoints (shape, w0, w1);
p1 = p2 = tf1.transform (w0);
}
......@@ -274,14 +274,14 @@ namespace fcl
Vec3f w0, w1;
epa.getClosestPoints (shape, w0, w1);
assert (epa.depth >= -eps);
distance = std::min (0., -epa.depth);
distance = (std::min) (0., -epa.depth);
// TODO should be
// normal = tf1.getRotation() * epa.normal;
normal = tf2.getRotation() * epa.normal;
p1 = p2 = tf1.transform(w0 - epa.normal*(epa.depth *0.5));
return false;
}
distance = -std::numeric_limits<FCL_REAL>::max();
distance = -(std::numeric_limits<FCL_REAL>::max)();
gjk.getClosestPoints (shape, p1, p2);
p1 = p2 = tf1.transform (p1);
}
......
......@@ -219,7 +219,7 @@ void Convex<PolygonT>::fillNeighbors()
unsigned int* p_nneighbors = nneighbors_;
for (int i = 0; i < num_points; ++i) {
Neighbors& n = neighbors[i];
if (nneighbors[i].size() >= std::numeric_limits<unsigned char>::max())
if (nneighbors[i].size() >= (std::numeric_limits<unsigned char>::max)())
throw std::logic_error ("Too many neighbors.");
n.count_ = (unsigned char)nneighbors[i].size();
n.n_ = p_nneighbors;
......
......@@ -98,7 +98,7 @@ SET(${LIBRARY_NAME}_SOURCES
)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} SYSTEM PRIVATE "${Boost_INCLUDE_DIRS}" ${PYTHON_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}")
IF(WIN32)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PYTHON_LIBRARY})
......@@ -113,8 +113,10 @@ IF(ENABLE_DOXYGEN_AUTODOC)
ENDIF()
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${BOOST_system_LIBRARY})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC eigenpy::eigenpy)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC
${PROJECT_NAME}
eigenpy::eigenpy
Boost::system)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
PREFIX ""
......
......@@ -68,7 +68,6 @@ set(${LIBRARY_NAME}_SOURCES
intersect.cpp
math/transform.cpp
traversal/traversal_recurse.cpp
profile.cpp
distance.cpp
BVH/BVH_utility.cpp
BVH/BV_fitter.cpp
......@@ -158,13 +157,7 @@ ADD_HEADER_GROUP(PROJECT_HEADERS_FULL_PATH)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
PUBLIC
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_CHRONO_LIBRARY} # Required on Windows. Don't know why.
# Boost::thread
# Boost::date_time
# Boost::system
Boost::boost
)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
......@@ -183,7 +176,6 @@ endif()
target_include_directories(${LIBRARY_NAME}
SYSTEM PUBLIC
${EIGEN3_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
)
target_include_directories(${LIBRARY_NAME}
SYSTEM PRIVATE
......
......@@ -39,7 +39,7 @@
#include <iostream>
#include <limits>
#include <vector>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/special_functions/fpclassify.hpp> // isnan.
#include <hpp/fcl/internal/tools.h>
namespace hpp
......
......@@ -38,7 +38,6 @@
#include <hpp/fcl/narrowphase/narrowphase.h>
#include <vector>
#include <boost/math/constants/constants.hpp>
#include <hpp/fcl/shape/geometric_shapes_utility.h>
#include <hpp/fcl/internal/intersect.h>
......
......@@ -5,8 +5,10 @@ macro(add_fcl_test test_name source)
target_link_libraries(${test_name}
PUBLIC
hpp-fcl
${Boost_LIBRARIES}
Boost::unit_test_framework
Boost::chrono
Boost::filesystem
Boost::timer
utility
)
target_compile_options(${test_name} PRIVATE "-Wno-c99-extensions")
......@@ -63,8 +65,8 @@ ENDIF()
target_link_libraries(test-benchmark
PUBLIC
utility
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
Boost::chrono
Boost::filesystem
${PROJECT_NAME}
)
......
......@@ -38,9 +38,7 @@
#include <cmath>
#define BOOST_TEST_MODULE FCL_BOX_BOX
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps))
......
......@@ -37,9 +37,7 @@
#define BOOST_TEST_MODULE FCL_BROADPHASE
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#include <hpp/fcl/config.h>
#include <hpp/fcl/broadphase/broadphase.h>
......
......@@ -36,9 +36,7 @@
#define BOOST_TEST_MODULE FCL_BVH_MODELS
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#include <boost/filesystem.hpp>
#include "fcl_resources/config.h"
......
......@@ -36,9 +36,7 @@
#define BOOST_TEST_MODULE FCL_GEOMETRIC_SHAPES
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps))
......
......@@ -36,9 +36,7 @@
#define BOOST_TEST_MODULE FCL_GEOMETRIC_SHAPES
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps))
......
......@@ -36,9 +36,7 @@
/** \author Karsten Knese <Karsten.Knese@googlemail.com> */
#define BOOST_TEST_MODULE FCL_CAPSULE_CAPSULE
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#define CHECK_CLOSE_TO_0(x, eps) BOOST_CHECK_CLOSE ((x + 1.0), (1.0), (eps))
......
......@@ -40,12 +40,9 @@
#include <boost/chrono/chrono_io.hpp>
#define BOOST_TEST_MODULE FCL_COLLISION
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/utility/binary.hpp>
#include <boost/test/included/unit_test.hpp>
#include <fstream>
#include <boost/filesystem.hpp>
#include <boost/assign/list_of.hpp>
#include <hpp/fcl/collision.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment