Skip to content

Commit

Permalink
[build] Remove support for CMake < 3.22.1 and Eigen < 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Mar 22, 2024
1 parent 09cad4a commit 93ce579
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 160 deletions.
11 changes: 2 additions & 9 deletions cmake/DARTFindBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)

if((BULLET_FOUND OR Bullet_FOUND) AND NOT TARGET Bullet)
add_library(Bullet INTERFACE IMPORTED)
if(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(Bullet PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${BULLET_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${BULLET_LIBRARIES}"
)
else()
target_include_directories(Bullet INTERFACE ${BULLET_INCLUDE_DIRS})
target_link_libraries(Bullet INTERFACE ${BULLET_LIBRARIES})
endif()
target_include_directories(Bullet INTERFACE ${BULLET_INCLUDE_DIRS})
target_link_libraries(Bullet INTERFACE ${BULLET_LIBRARIES})
endif()
20 changes: 2 additions & 18 deletions cmake/DARTFindOpenSceneGraph.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@
#
# This file is provided under the "BSD-style" License

if (CMAKE_VERSION VERSION_LESS 3.12)
get_property(old_find_library_use_lib64_paths GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
endif()

find_package(OpenSceneGraph 3.0 QUIET
COMPONENTS osg osgViewer osgManipulator osgGA osgDB osgShadow osgUtil
)

if (CMAKE_VERSION VERSION_LESS 3.12)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ${old_find_library_use_lib64_paths})
endif()

# It seems that OPENSCENEGRAPH_FOUND will inadvertently get set to true when
# OpenThreads is found, even if OpenSceneGraph is not installed. This is quite
# possibly a bug in OSG's cmake configuration file. For now, it seems that
Expand Down Expand Up @@ -56,13 +47,6 @@ endif()
# where the system that DART is built and where the system that consumes DART.
if((OPENSCENEGRAPH_FOUND OR OpenSceneGraph_FOUND) AND NOT TARGET osg::osg)
add_library(osg::osg INTERFACE IMPORTED)
if(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(osg::osg PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSCENEGRAPH_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${OPENSCENEGRAPH_LIBRARIES}"
)
else()
target_include_directories(osg::osg INTERFACE ${OPENSCENEGRAPH_INCLUDE_DIRS})
target_link_libraries(osg::osg INTERFACE ${OPENSCENEGRAPH_LIBRARIES})
endif()
target_include_directories(osg::osg INTERFACE ${OPENSCENEGRAPH_INCLUDE_DIRS})
target_link_libraries(osg::osg INTERFACE ${OPENSCENEGRAPH_LIBRARIES})
endif()
3 changes: 0 additions & 3 deletions dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ endif()

# C++ standard settings
target_compile_features(dart PUBLIC cxx_std_17)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
target_link_libraries(dart PUBLIC "stdc++fs")
endif()

# Build DART with all available SIMD instructions
if(DART_ENABLE_SIMD)
Expand Down
18 changes: 0 additions & 18 deletions dart/common/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <dart/config.hpp>

#include <dart/common/Deprecated.hpp>
#include <dart/common/detail/AlignedAllocator.hpp>

#include <map>
#include <memory>
Expand All @@ -53,21 +52,6 @@ template <typename T, typename... Args>
DART_DEPRECATED(6.9)
std::unique_ptr<T> make_unique(Args&&... args);

#if EIGEN_VERSION_AT_LEAST(3, 2, 1) && EIGEN_VERSION_AT_MOST(3, 2, 8)

template <typename _Tp>
using aligned_vector
= std::vector<_Tp, dart::common::detail::aligned_allocator_cpp11<_Tp>>;

template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>>
using aligned_map = std::map<
_Key,
_Tp,
_Compare,
dart::common::detail::aligned_allocator_cpp11<std::pair<const _Key, _Tp>>>;

#else

template <typename _Tp>
using aligned_vector = std::vector<_Tp, Eigen::aligned_allocator<_Tp>>;

Expand All @@ -78,8 +62,6 @@ using aligned_map = std::map<
_Compare,
Eigen::aligned_allocator<std::pair<const _Key, _Tp>>>;

#endif

} // namespace common
} // namespace dart

Expand Down
106 changes: 0 additions & 106 deletions dart/common/detail/AlignedAllocator.hpp

This file was deleted.

7 changes: 1 addition & 6 deletions dart/common/detail/Memory-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@
#include <dart/config.hpp>

#include <Eigen/Core>
#include <Eigen/StdVector>

#include <memory>

#if EIGEN_VERSION_AT_LEAST(3, 2, 1) && EIGEN_VERSION_AT_MOST(3, 2, 8)
#include <dart/common/detail/AlignedAllocator.hpp>
#else
#include <Eigen/StdVector>
#endif

namespace dart {
namespace common {

Expand Down
13 changes: 13 additions & 0 deletions docs/readthedocs/developer_guide/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ FreeBSD (experimental)

TODO

Dependency Info
~~~~~~~~~~~~~~~

Here's a summary of the dependencies required to build DART (WIP):

+------------+----------+---------+--------------+-------+
| Dependency | Required | Type | Min. Version | Notes |
+============+==========+=========+==============+=======+
| CMake | Yes | Build | 3.22.1 | |
+------------+----------+---------+--------------+-------+
| Eigen | Yes | Runtime | 3.4.0 | |
+------------+----------+---------+--------------+-------+

Clone the DART Repository
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 93ce579

Please sign in to comment.