Unverified Commit f92964cb authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

Merge pull request #56 from jmirabel/namespace_hpp, fix #51

Wrap code into namespace hpp
parents 0627dfaf 83893e1b
......@@ -76,10 +76,10 @@ search_for_boost()
# Optional dependencies
add_optional_dependency("octomap >= 1.6")
if (OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS)
include_directories(${OCTOMAP_INCLUDE_DIRS})
link_directories(${OCTOMAP_LIBRARY_DIRS})
SET(FCL_HAVE_OCTOMAP TRUE)
add_definitions (-DFCL_HAVE_OCTOMAP)
include_directories(${OCTOMAP_INCLUDE_DIRS})
link_directories(${OCTOMAP_LIBRARY_DIRS})
SET(HPP_FCL_HAVE_OCTOMAP TRUE)
add_definitions (-DHPP_FCL_HAVE_OCTOMAP)
string(REPLACE "." ";" VERSION_LIST ${OCTOMAP_VERSION})
list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION)
list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION)
......@@ -87,20 +87,20 @@ if (OCTOMAP_INCLUDE_DIRS AND OCTOMAP_LIBRARY_DIRS)
add_definitions (-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION}
-DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION}
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
message(STATUS "FCL uses Octomap")
message(STATUS "FCL uses Octomap")
else()
SET(FCL_HAVE_OCTOMAP FALSE)
message(STATUS "FCL does not use Octomap")
SET(HPP_FCL_HAVE_OCTOMAP FALSE)
message(STATUS "FCL does not use Octomap")
endif()
ADD_REQUIRED_DEPENDENCY("assimp >= 2.0")
if(ASSIMP_FOUND)
if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150")
add_definitions(-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
SET(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES TRUE)
add_definitions(-DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
SET(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES TRUE)
message(STATUS "Assimp version has unified headers")
else()
SET(WITH_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES FALSE)
SET(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES FALSE)
message(STATUS "Assimp version does not have unified headers")
endif()
endif()
......@@ -108,8 +108,6 @@ endif()
SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/collision_data.h
include/hpp/fcl/profile.h
include/hpp/fcl/exception.h
include/hpp/fcl/deprecated.h
include/hpp/fcl/BV/kIOS.h
include/hpp/fcl/BV/BV.h
include/hpp/fcl/BV/RSS.h
......@@ -162,12 +160,14 @@ endif ()
pkg_config_append_libs("hpp-fcl")
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)
IF(FCL_HAVE_OCTOMAP)
IF(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
# FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES kept for backard compatibility reasons.
PKG_CONFIG_APPEND_CFLAGS("-DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES")
ENDIF(HPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
IF(HPP_FCL_HAVE_OCTOMAP)
# FCL_HAVE_OCTOMAP kept for backward compatibility reasons.
PKG_CONFIG_APPEND_CFLAGS(
"-DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}")
ENDIF(FCL_HAVE_OCTOMAP)
"-DHPP_FCL_HAVE_OCTOMAP -DFCL_HAVE_OCTOMAP -DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION} -DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION} -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}")
ENDIF(HPP_FCL_HAVE_OCTOMAP)
setup_project_finalize()
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-W -Wall -g -Wextra -Wno-missing-field-initializers -Wno-unused-parameter)
endif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-W -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-delete-non-virtual-dtor -Wno-overloaded-virtual -Wno-unknown-pragmas)
endif()
if(MSVC OR MSVC90 OR MSVC10)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1")
endif(MSVC OR MSVC90 OR MSVC10)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(IS_ICPC 1)
else()
set(IS_ICPC 0)
endif()
if(IS_ICPC)
add_definitions(-wd191 -wd411 -wd654 -wd1125 -wd1292 -wd1565 -wd1628 -wd2196)
set(CMAKE_AR "xiar" CACHE STRING "Intel archiver" FORCE)
set(CMAKE_CXX_FLAGS "-pthread" CACHE STRING "Default compile flags" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG"
CACHE STRING "Flags used by the C++ compiler during release builds." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING
"Flags used by the C++ compiler during debug builds." FORCE)
set(CMAKE_LINKER "xild" CACHE STRING "Intel linker" FORCE)
endif(IS_ICPC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
set(IS_XLC 1)
else()
set(IS_XLC 0)
endif()
if(IS_XLC)
add_definitions(-qpic -q64 -qmaxmem=-1)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -q64")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -q64")
endif(IS_XLC)
if((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
add_definitions(-fPIC)
endif((CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC) AND NOT MINGW)
# Set rpath http://www.paraview.org/Wiki/CMake_RPATH_handling
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# no prefix needed for python modules
set(CMAKE_SHARED_MODULE_PREFIX "")
# set the version in a way CMake can use
set(FCL_MAJOR_VERSION 0)
set(FCL_MINOR_VERSION 3)
set(FCL_PATCH_VERSION 2)
set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")
# increment this when we have ABI changes
set(FCL_ABI_VERSION 5)
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
# This file was generated by CMake for @PROJECT_NAME@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: @PROJECT_NAME@
Description: @PKG_DESC@
Version: @FCL_VERSION@
Requires: @PKG_EXTERNAL_DEPS@
Libs: -L${libdir} -lfcl
Cflags: -I${includedir}
......@@ -35,13 +35,15 @@
/** \author Jia Pan */
#ifndef FCL_AABB_H
#define FCL_AABB_H
#ifndef HPP_FCL_AABB_H
#define HPP_FCL_AABB_H
#include <stdexcept>
#include <hpp/fcl/math/vec_3f.h>
#include <hpp/fcl/math/matrix_3f.h>
namespace hpp
{
namespace fcl
{
class CollisionRequest;
......@@ -262,4 +264,6 @@ static inline AABB rotate(const AABB& aabb, const Matrix3f& t)
}
} // namespace hpp
#endif
......@@ -35,8 +35,8 @@
/** \author Jia Pan */
#ifndef FCL_BV_H
#define FCL_BV_H
#ifndef HPP_FCL_BV_H
#define HPP_FCL_BV_H
#include <hpp/fcl/BV/kDOP.h>
......@@ -48,6 +48,8 @@
#include <hpp/fcl/math/transform.h>
/** \brief Main namespace */
namespace hpp
{
namespace fcl
{
......@@ -293,4 +295,6 @@ static inline void convertBV(const BV1& bv1, const Transform3f& tf1, BV2& bv2)
}
} // namespace hpp
#endif
......@@ -36,8 +36,8 @@
/** \author Jia Pan */
#ifndef FCL_BV_NODE_H
#define FCL_BV_NODE_H
#ifndef HPP_FCL_BV_NODE_H
#define HPP_FCL_BV_NODE_H
#include <hpp/fcl/math/vec_3f.h>
#include <hpp/fcl/math/matrix_3f.h>
......@@ -45,6 +45,8 @@
#include <hpp/fcl/BV/BV.h>
#include <iostream>
namespace hpp
{
namespace fcl
{
......@@ -130,4 +132,6 @@ inline const Matrix3f& BVNode<OBBRSS>::getOrientation() const
}
} // namespace hpp
#endif
......@@ -35,13 +35,15 @@
/** \author Jia Pan */
#ifndef FCL_OBB_H
#define FCL_OBB_H
#ifndef HPP_FCL_OBB_H
#define HPP_FCL_OBB_H
#include <hpp/fcl/math/vec_3f.h>
#include <hpp/fcl/math/matrix_3f.h>
namespace hpp
{
namespace fcl
{
class CollisionRequest;
......@@ -156,4 +158,6 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1,
bool obbDisjoint(const Matrix3f& B, const Vec3f& T, const Vec3f& a, const Vec3f& b);
}
} // namespace hpp
#endif
......@@ -35,13 +35,15 @@
/** \author Jia Pan */
#ifndef FCL_OBBRSS_H
#define FCL_OBBRSS_H
#ifndef HPP_FCL_OBBRSS_H
#define HPP_FCL_OBBRSS_H
#include <hpp/fcl/BV/OBB.h>
#include <hpp/fcl/BV/RSS.h>
namespace hpp
{
namespace fcl
{
class CollisionRequest;
......@@ -171,4 +173,6 @@ FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const OBBRSS& b1, const O
}
} // namespace hpp
#endif
......@@ -35,14 +35,16 @@
/** \author Jia Pan */
#ifndef FCL_RSS_H
#define FCL_RSS_H
#ifndef HPP_FCL_RSS_H
#define HPP_FCL_RSS_H
#include <stdexcept>
#include <hpp/fcl/math/vec_3f.h>
#include <hpp/fcl/math/matrix_3f.h>
#include <boost/math/constants/constants.hpp>
namespace hpp
{
namespace fcl
{
......@@ -157,4 +159,6 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2);
}
} // namespace hpp
#endif
......@@ -35,12 +35,14 @@
/** \author Jia Pan */
#ifndef FCL_KDOP_H
#define FCL_KDOP_H
#ifndef HPP_FCL_KDOP_H
#define HPP_FCL_KDOP_H
#include <stdexcept>
#include <hpp/fcl/math/vec_3f.h>
namespace hpp
{
namespace fcl
{
......@@ -181,4 +183,6 @@ KDOP<N> translate(const KDOP<N>& bv, const Vec3f& t);
}
} // namespace hpp
#endif
......@@ -35,12 +35,14 @@
/** \author Jia Pan */
#ifndef FCL_KIOS_H
#define FCL_KIOS_H
#ifndef HPP_FCL_KIOS_H
#define HPP_FCL_KIOS_H
#include <hpp/fcl/BV/OBB.h>
namespace hpp
{
namespace fcl
{
class CollisionRequest;
......@@ -161,4 +163,6 @@ FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIO
}
} // namespace hpp
#endif
......@@ -35,12 +35,14 @@
/** \author Jia Pan */
#ifndef FCL_BVH_FRONT_H
#define FCL_BVH_FRONT_H
#ifndef HPP_FCL_BVH_FRONT_H
#define HPP_FCL_BVH_FRONT_H
#include <list>
namespace hpp
{
namespace fcl
{
......@@ -75,4 +77,6 @@ inline void updateFrontList(BVHFrontList* front_list, int b1, int b2)
}
} // namespace hpp
#endif
......@@ -35,11 +35,13 @@
/** \author Jia Pan */
#ifndef FCL_BVH_INTERNAL_H
#define FCL_BVH_INTERNAL_H
#ifndef HPP_FCL_BVH_INTERNAL_H
#define HPP_FCL_BVH_INTERNAL_H
#include <hpp/fcl/data_types.h>
namespace hpp
{
namespace fcl
{
......@@ -82,4 +84,6 @@ enum BVHModelType
}
} // namespace hpp
#endif
......@@ -35,8 +35,8 @@
/** \author Jia Pan */
#ifndef FCL_BVH_MODEL_H
#define FCL_BVH_MODEL_H
#ifndef HPP_FCL_BVH_MODEL_H
#define HPP_FCL_BVH_MODEL_H
#include <hpp/fcl/collision_object.h>
#include <hpp/fcl/BVH/BVH_internal.h>
......@@ -47,6 +47,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
namespace hpp
{
namespace fcl
{
......@@ -354,4 +356,6 @@ NODE_TYPE BVHModel<KDOP<24> >::getNodeType() const;
}
} // namespace hpp
#endif
......@@ -36,12 +36,14 @@
/** \author Jia Pan */
#ifndef FCL_BVH_UTILITY_H
#define FCL_BVH_UTILITY_H
#ifndef HPP_FCL_BVH_UTILITY_H
#define HPP_FCL_BVH_UTILITY_H
#include <hpp/fcl/BVH/BVH_model.h>
namespace hpp
{
namespace fcl
{
/// @brief Expand the BVH bounding boxes according to the variance matrix corresponding to the data stored within each BV node
......@@ -100,4 +102,6 @@ FCL_REAL maximumDistance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indi
}
} // namespace hpp
#endif
......@@ -35,14 +35,16 @@
/** \author Jia Pan */
#ifndef FCL_BV_FITTER_H
#define FCL_BV_FITTER_H
#ifndef HPP_FCL_BV_FITTER_H
#define HPP_FCL_BV_FITTER_H
#include <hpp/fcl/BVH/BVH_internal.h>
#include <hpp/fcl/BV/kIOS.h>
#include <hpp/fcl/BV/OBBRSS.h>
#include <iostream>
namespace hpp
{
namespace fcl
{
......@@ -350,4 +352,6 @@ private:
}
} // namespace hpp
#endif
......@@ -35,8 +35,8 @@
/** \author Jia Pan */
#ifndef FCL_BV_SPLITTER_H
#define FCL_BV_SPLITTER_H
#ifndef HPP_FCL_BV_SPLITTER_H
#define HPP_FCL_BV_SPLITTER_H
#include <hpp/fcl/BVH/BVH_internal.h>
#include <hpp/fcl/BV/kIOS.h>
......@@ -44,6 +44,8 @@
#include <vector>
#include <iostream>
namespace hpp
{
namespace fcl
{
......@@ -286,4 +288,6 @@ void BVSplitter<OBBRSS>::computeRule_median(const OBBRSS& bv, unsigned int* prim
}
} // namespace hpp
#endif
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.hxx)
file(GLOB_RECURSE CONFIGURED_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/*.h ${CMAKE_CURRENT_BINARY_DIR}/*.hxx)
set(FCL_HEADERS ${HEADERS} ${CONFIGURED_HEADERS} PARENT_SCOPE)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" FCL_CONFIG_IN_DIR)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" FCL_CONFIG_OUT_DIR)
configure_file("${FCL_CONFIG_IN_DIR}/config.h.in" "${FCL_CONFIG_OUT_DIR}/config.h")
install(FILES "${FCL_CONFIG_OUT_DIR}/config.h" DESTINATION include/fcl)
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