Skip to content

Commit

Permalink
Import dartsim from 2023-03-21 tag in vcpkg
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Mar 21, 2023
1 parent 48d3cdb commit ecc6d26
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dartsim/disable_unit_tests_examples_and_tutorials.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9940065eb8..b25fa4919a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -298,7 +298,7 @@ add_subdirectory(dart)

set(DART_IN_SOURCE_BUILD TRUE)

-if(TARGET dart)
+if(false)

# Add a "tests" target to build unit tests.
enable_testing()
45 changes: 45 additions & 0 deletions dartsim/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Shared library support is broken upstream (https://github.com/dartsim/dart/issues/1005#issuecomment-375406260)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO dartsim/dart
REF v6.11.0
SHA512 01fbff039bcec71d41334db2d07d0973b1ba58d30d05b29e35e1e3cee853917753b64e1101881113a33adb801559855d38d274fbb3383cfb24d85565254d112d
HEAD_REF main
PATCHES
disable_unit_tests_examples_and_tutorials.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DDART_VERBOSE=ON
-DDART_MSVC_DEFAULT_OPTIONS=ON
-DDART_SKIP_DOXYGEN=ON
-DDART_SKIP_FLANN=ON
-DDART_SKIP_IPOPT=ON
-DDART_SKIP_NLOPT=ON
-DDART_SKIP_OPENGL=ON
-DDART_SKIP_pagmo=ON
-Durdfdom_headers_VERSION_MAJOR=1
-Durdfdom_headers_VERSION_MINOR=0
-Durdfdom_headers_VERSION_PATCH=4
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH share/dart/cmake PACKAGE_NAME dart)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# only used for tests and examples (we removed the examples in share/doc above):
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dart/config.hpp" "#define DART_ROOT_PATH \"${SOURCE_PATH}/\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dart/config.hpp" "#define DART_DATA_PATH \"${SOURCE_PATH}/data/\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dart/config.hpp" "#define DART_DATA_LOCAL_PATH \"${SOURCE_PATH}/data/\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dart/config.hpp" "#define DART_DATA_GLOBAL_PATH \"${CURRENT_PACKAGES_DIR}/share/doc/dart/data/\"" "")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
34 changes: 34 additions & 0 deletions dartsim/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "dartsim",
"version": "6.11.0",
"port-version": 3,
"description": "Dynamic Animation and Robotics Toolkit",
"homepage": "https://dartsim.github.io/",
"dependencies": [
"assimp",
"boost-algorithm",
"boost-filesystem",
"boost-functional",
"boost-lexical-cast",
"boost-math",
"boost-optional",
"boost-regex",
"boost-system",
"bullet3",
"ccd",
"eigen3",
"fcl",
"octomap",
"ode",
"tinyxml2",
"urdfdom",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

0 comments on commit ecc6d26

Please sign in to comment.