aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/dartsim
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/dartsim')
-rw-r--r--vcpkg/ports/dartsim/add-cassert.patch111
-rw-r--r--vcpkg/ports/dartsim/dependencies.diff67
-rw-r--r--vcpkg/ports/dartsim/devendor-lodepng.diff50
-rw-r--r--vcpkg/ports/dartsim/disable_unit_tests_examples_and_tutorials.patch29
-rw-r--r--vcpkg/ports/dartsim/pkgconfig.diff12
-rw-r--r--vcpkg/ports/dartsim/portfile.cmake87
-rw-r--r--vcpkg/ports/dartsim/usage9
-rw-r--r--vcpkg/ports/dartsim/vcpkg.json104
8 files changed, 469 insertions, 0 deletions
diff --git a/vcpkg/ports/dartsim/add-cassert.patch b/vcpkg/ports/dartsim/add-cassert.patch
new file mode 100644
index 0000000..c18d7fc
--- /dev/null
+++ b/vcpkg/ports/dartsim/add-cassert.patch
@@ -0,0 +1,111 @@
+diff --git a/dart/optimizer/GenericMultiObjectiveProblem.cpp b/dart/optimizer/GenericMultiObjectiveProblem.cpp
+index e58a57aa97..d62515739d 100644
+--- a/dart/optimizer/GenericMultiObjectiveProblem.cpp
++++ b/dart/optimizer/GenericMultiObjectiveProblem.cpp
+@@ -37,6 +37,7 @@
+ #include "dart/optimizer/Function.hpp"
+
+ #include <algorithm>
++#include <cassert>
+ #include <limits>
+ #include <numeric>
+
+diff --git a/dart/optimizer/GradientDescentSolver.cpp b/dart/optimizer/GradientDescentSolver.cpp
+index 6c92a32c30..d4b858a6c0 100644
+--- a/dart/optimizer/GradientDescentSolver.cpp
++++ b/dart/optimizer/GradientDescentSolver.cpp
+@@ -36,6 +36,7 @@
+ #include "dart/math/Helpers.hpp"
+ #include "dart/optimizer/Problem.hpp"
+
++#include <cassert>
+ #include <iostream>
+
+ namespace dart {
+diff --git a/dart/optimizer/MultiObjectiveProblem.cpp b/dart/optimizer/MultiObjectiveProblem.cpp
+index 6e86f0ee1a..e55e0bf99b 100644
+--- a/dart/optimizer/MultiObjectiveProblem.cpp
++++ b/dart/optimizer/MultiObjectiveProblem.cpp
+@@ -37,6 +37,7 @@
+ #include "dart/optimizer/Function.hpp"
+
+ #include <algorithm>
++#include <cassert>
+ #include <limits>
+ #include <numeric>
+
+diff --git a/dart/optimizer/MultiObjectiveSolver.cpp b/dart/optimizer/MultiObjectiveSolver.cpp
+index 4215f78e14..c0edbb5dc6 100644
+--- a/dart/optimizer/MultiObjectiveSolver.cpp
++++ b/dart/optimizer/MultiObjectiveSolver.cpp
+@@ -35,6 +35,7 @@
+ #include "dart/common/Console.hpp"
+ #include "dart/optimizer/MultiObjectiveProblem.hpp"
+
++#include <cassert>
+ #include <fstream>
+
+ namespace dart {
+diff --git a/dart/optimizer/Population.cpp b/dart/optimizer/Population.cpp
+index 0469683434..69e4b65141 100644
+--- a/dart/optimizer/Population.cpp
++++ b/dart/optimizer/Population.cpp
+@@ -35,6 +35,8 @@
+ #include "dart/common/Console.hpp"
+ #include "dart/math/Random.hpp"
+
++#include <cassert>
++
+ namespace dart {
+ namespace optimizer {
+
+diff --git a/dart/optimizer/Problem.cpp b/dart/optimizer/Problem.cpp
+index 8bf3317777..7dc20a0cc5 100644
+--- a/dart/optimizer/Problem.cpp
++++ b/dart/optimizer/Problem.cpp
+@@ -37,6 +37,7 @@
+ #include "dart/optimizer/Function.hpp"
+
+ #include <algorithm>
++#include <cassert>
+ #include <limits>
+
+ namespace dart {
+diff --git a/dart/optimizer/ipopt/IpoptSolver.cpp b/dart/optimizer/ipopt/IpoptSolver.cpp
+index 0762e1efed..e21260113c 100644
+--- a/dart/optimizer/ipopt/IpoptSolver.cpp
++++ b/dart/optimizer/ipopt/IpoptSolver.cpp
+@@ -38,6 +38,8 @@
+ #include "dart/optimizer/Function.hpp"
+ #include "dart/optimizer/Problem.hpp"
+
++#include <cassert>
++
+ namespace dart {
+ namespace optimizer {
+
+diff --git a/dart/optimizer/nlopt/NloptSolver.cpp b/dart/optimizer/nlopt/NloptSolver.cpp
+index 0adb336fcd..b5dcba5745 100644
+--- a/dart/optimizer/nlopt/NloptSolver.cpp
++++ b/dart/optimizer/nlopt/NloptSolver.cpp
+@@ -39,6 +39,7 @@
+
+ #include <Eigen/Dense>
+
++#include <cassert>
+ #include <memory>
+
+ namespace dart {
+diff --git a/dart/optimizer/pagmo/PagmoMultiObjectiveProblemAdaptor.cpp b/dart/optimizer/pagmo/PagmoMultiObjectiveProblemAdaptor.cpp
+index aa3f5517c4..626955cbee 100644
+--- a/dart/optimizer/pagmo/PagmoMultiObjectiveProblemAdaptor.cpp
++++ b/dart/optimizer/pagmo/PagmoMultiObjectiveProblemAdaptor.cpp
+@@ -34,6 +34,8 @@
+
+ #include "dart/optimizer/pagmo/PagmoUtils.hpp"
+
++#include <cassert>
++
+ namespace dart {
+ namespace optimizer {
+
diff --git a/vcpkg/ports/dartsim/dependencies.diff b/vcpkg/ports/dartsim/dependencies.diff
new file mode 100644
index 0000000..e346050
--- /dev/null
+++ b/vcpkg/ports/dartsim/dependencies.diff
@@ -0,0 +1,67 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fc52494..9bc2db3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -64,7 +64,7 @@ string(REGEX REPLACE "^<version>([0-9]+)\\.([0-9]+)\\.([0-9]+)</version>$" "\\3"
+ set(DART_VERSION "${DART_MAJOR_VERSION}.${DART_MINOR_VERSION}.${DART_PATCH_VERSION}")
+
+ set(DART_PKG_DESC "Dynamic Animation and Robotics Toolkit.")
+-set(DART_PKG_EXTERNAL_DEPS "assimp, ccd, eigen3, fcl, octomap")
++set(DART_PKG_EXTERNAL_DEPS "assimp, eigen3, fcl, octomap")
+
+ #===============================================================================
+ # Build options
+diff --git a/cmake/DARTFindBullet.cmake b/cmake/DARTFindBullet.cmake
+index c2d3e63..fbcdd4d 100644
+--- a/cmake/DARTFindBullet.cmake
++++ b/cmake/DARTFindBullet.cmake
+@@ -9,7 +9,7 @@
+ # Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with
+ # CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed
+ # with Bullet, which uses relative paths and may break transitive dependencies.
+-find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)
++find_package(BULLET COMPONENTS LinearMath BulletCollision QUIET NAMES Bullet)
+
+ if((BULLET_FOUND OR Bullet_FOUND) AND NOT TARGET Bullet)
+ add_library(Bullet INTERFACE IMPORTED)
+diff --git a/cmake/Findassimp.cmake b/cmake/Findassimp.cmake
+index b5c1c66..099a3b4 100644
+--- a/cmake/Findassimp.cmake
++++ b/cmake/Findassimp.cmake
+@@ -25,7 +25,7 @@ find_path(ASSIMP_INCLUDE_DIRS assimp/scene.h
+ PATHS "${CMAKE_INSTALL_PREFIX}/include")
+
+ # Libraries
+-if(MSVC)
++if(1)
+ find_package(assimp QUIET CONFIG)
+ if(TARGET assimp::assimp)
+ set(ASSIMP_LIBRARIES "assimp::assimp")
+diff --git a/cmake/Findfcl.cmake b/cmake/Findfcl.cmake
+index 7be9d61..d082d4d 100644
+--- a/cmake/Findfcl.cmake
++++ b/cmake/Findfcl.cmake
+@@ -27,7 +27,7 @@ find_path(FCL_INCLUDE_DIRS
+ PATHS "${CMAKE_INSTALL_PREFIX}/include")
+
+ # Libraries
+-if(MSVC)
++if(1)
+ find_package(fcl QUIET CONFIG)
+ if(TARGET fcl)
+ set(FCL_LIBRARIES fcl)
+diff --git a/cmake/Findtinyxml2.cmake b/cmake/Findtinyxml2.cmake
+index 0552a8e..c731624 100644
+--- a/cmake/Findtinyxml2.cmake
++++ b/cmake/Findtinyxml2.cmake
+@@ -29,8 +29,8 @@ find_path(TINYXML2_INCLUDE_DIRS
+ PATHS "${CMAKE_INSTALL_PREFIX}/include")
+
+ # Libraries
+-if(MSVC)
+- set(TINYXML2_LIBRARIES "tinyxml2$<$<CONFIG:Debug>:d>")
++if(1)
++ set(TINYXML2_LIBRARIES tinyxml2::tinyxml2)
+ else()
+ find_library(TINYXML2_LIBRARIES
+ NAMES tinyxml2
diff --git a/vcpkg/ports/dartsim/devendor-lodepng.diff b/vcpkg/ports/dartsim/devendor-lodepng.diff
new file mode 100644
index 0000000..a902203
--- /dev/null
+++ b/vcpkg/ports/dartsim/devendor-lodepng.diff
@@ -0,0 +1,50 @@
+diff --git a/cmake/dart_Component.cmake.in b/cmake/dart_Component.cmake.in
+index 2a2d54e..a421adb 100644
+--- a/cmake/dart_Component.cmake.in
++++ b/cmake/dart_Component.cmake.in
+@@ -1,3 +1,7 @@
++if("@component@" STREQUAL "external-lodepng")
++ include(CMakeFindDependencyMacro)
++ find_dependency(lodepng)
++endif()
+ set("@PROJECT_NAME@_@component@_DEPENDENCIES" @internal_dependencies@)
+ set("@PROJECT_NAME@_@component@_LIBRARIES" @libraries@)
+
+diff --git a/dart/external/lodepng/CMakeLists.txt b/dart/external/lodepng/CMakeLists.txt
+index 93b4e73..5309d7b 100644
+--- a/dart/external/lodepng/CMakeLists.txt
++++ b/dart/external/lodepng/CMakeLists.txt
+@@ -6,10 +6,12 @@ file(GLOB srcs "*.cpp")
+ set(target_name ${PROJECT_NAME}-external-lodepng)
+ set(component_name external-lodepng)
+
++find_package(lodepng CONFIG)
++set(hdrs "")
++set(srcs "${CMAKE_CURRENT_BINARY_DIR}/empty.cpp")
++file(WRITE "${srcs}" "")
+ dart_add_library(${target_name} ${hdrs} ${srcs})
+-target_include_directories(${target_name}
+- PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+-)
++target_link_libraries(${target_name} PUBLIC $<IF:$<TARGET_EXISTS:lodepng>,lodepng,lodepng::NOTFOUND>)
+
+ # Component
+ add_component(${PROJECT_NAME} ${component_name})
+diff --git a/dart/external/lodepng/lodepng.h b/dart/external/lodepng/lodepng.h
+index fcf9f71..974d826 100644
+--- a/dart/external/lodepng/lodepng.h
++++ b/dart/external/lodepng/lodepng.h
+@@ -23,8 +23,11 @@ freely, subject to the following restrictions:
+ distribution.
+ */
+
+-#ifndef LODEPNG_H
+-#define LODEPNG_H
++#ifndef LODEPNG_H_DEVENDORED
++#define LODEPNG_H_DEVENDORED
++#include <lodepng.h>
++#endif
++#if 0
+
+ #include <string.h> /*for size_t*/
+
diff --git a/vcpkg/ports/dartsim/disable_unit_tests_examples_and_tutorials.patch b/vcpkg/ports/dartsim/disable_unit_tests_examples_and_tutorials.patch
new file mode 100644
index 0000000..a3b9af6
--- /dev/null
+++ b/vcpkg/ports/dartsim/disable_unit_tests_examples_and_tutorials.patch
@@ -0,0 +1,29 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fc5249444a5c..39c29e92bb33 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -376,7 +376,7 @@ add_subdirectory(dart)
+
+ set(DART_IN_SOURCE_BUILD TRUE)
+
+-if(TARGET dart)
++if(0)
+
+ # Add a "tests" target to build unit tests.
+ include(CTest)
+diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
+index 37cadf4f8de1..fcfbd13cf793 100644
+--- a/python/CMakeLists.txt
++++ b/python/CMakeLists.txt
+@@ -22,9 +22,11 @@ endif()
+ set(DART_DARTPY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/dartpy")
+
+ add_subdirectory(dartpy)
++if(0)
+ add_subdirectory(tests)
+ add_subdirectory(examples)
+ add_subdirectory(tutorials)
++endif()
+
+ message(STATUS "")
+ message(STATUS "[ dartpy ]")
diff --git a/vcpkg/ports/dartsim/pkgconfig.diff b/vcpkg/ports/dartsim/pkgconfig.diff
new file mode 100644
index 0000000..fadcd7a
--- /dev/null
+++ b/vcpkg/ports/dartsim/pkgconfig.diff
@@ -0,0 +1,12 @@
+diff --git a/cmake/dart.pc.in b/cmake/dart.pc.in
+index 402c496..9814576 100644
+--- a/cmake/dart.pc.in
++++ b/cmake/dart.pc.in
+@@ -8,5 +8,6 @@ Name: @PROJECT_NAME@
+ Description: @DART_PKG_DESC@
+ Version: @DART_VERSION@
+ Requires: @DART_PKG_EXTERNAL_DEPS@
+-Libs: -L${libdir} -ldart
++Libs: -L${libdir} -ldart@DART_PKG_DEBUG_POSTFIX@
++Libs.private: -ldart-external-odelcpsolver@DART_PKG_DEBUG_POSTFIX@
+ Cflags: @CMAKE_CXX_FLAGS@
diff --git a/vcpkg/ports/dartsim/portfile.cmake b/vcpkg/ports/dartsim/portfile.cmake
new file mode 100644
index 0000000..9c604de
--- /dev/null
+++ b/vcpkg/ports/dartsim/portfile.cmake
@@ -0,0 +1,87 @@
+# DLL support is broken upstream (https://github.com/dartsim/dart/issues/1005#issuecomment-375406260)
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO dartsim/dart
+ REF v${VERSION}
+ SHA512 3c621245c5dc1bf26932c33c940e2b09aaebd1a15f3620616c60296f18a67e1044728543b4f640f92caf8f98295e350679b70eb11aecadea9e4a28aaf370ea75
+ HEAD_REF main
+ PATCHES
+ dependencies.diff
+ devendor-lodepng.diff
+ disable_unit_tests_examples_and_tutorials.patch
+ pkgconfig.diff
+ add-cassert.patch
+)
+file(REMOVE_RECURSE "${SOURCE_PATH}/dart/external/imgui")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS options
+ FEATURES
+ collision-bullet CMAKE_REQUIRE_FIND_PACKAGE_BULLET
+ collision-ode CMAKE_REQUIRE_FIND_PACKAGE_ODE
+ gui CMAKE_REQUIRE_FIND_PACKAGE_GLUT
+ gui-osg DART_BUILD_GUI_OSG
+ spdlog CMAKE_REQUIRE_FIND_PACKAGE_spdlog
+ utils CMAKE_REQUIRE_FIND_PACKAGE_tinyxml2
+ utils-urdf CMAKE_REQUIRE_FIND_PACKAGE_urdfdom
+ INVERTED_FEATURES
+ collision-bullet CMAKE_DISABLE_FIND_PACKAGE_BULLET
+ collision-ode DART_SKIP_ODE
+ gui DART_SKIP_GLUT
+ gui DART_SKIP_OPENGL
+ spdlog DART_SKIP_spdlog
+ utils DART_SKIP_TINYXML2
+ utils-urdf CMAKE_DISABLE_FIND_PACKAGE_urdfdom
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${options}
+ -DDART_VERBOSE=ON
+ -DDART_TREAT_WARNINGS_AS_ERRORS=OFF
+ -DDART_MSVC_DEFAULT_OPTIONS=ON
+ -DDART_USE_SYSTEM_IMGUI=ON
+ -DDART_BUILD_DARTPY=OFF
+ -DDART_SKIP_DOXYGEN=ON
+ -DDART_SKIP_IPOPT=ON
+ -DDART_SKIP_NLOPT=ON
+ -DDART_SKIP_pagmo=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON
+ OPTIONS_DEBUG
+ -DDART_PKG_DEBUG_POSTFIX=d
+ MAYBE_UNUSED_VARIABLES
+ CMAKE_DISABLE_FIND_PACKAGE_urdfdom
+ CMAKE_REQUIRE_FIND_PACKAGE_GLUT
+ CMAKE_REQUIRE_FIND_PACKAGE_urdfdom
+ DART_MSVC_DEFAULT_OPTIONS
+ DART_SKIP_GLUT
+ DART_SKIP_OPENGL
+)
+
+vcpkg_cmake_install()
+vcpkg_fixup_pkgconfig()
+vcpkg_cmake_config_fixup(CONFIG_PATH share/dart/cmake)
+
+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 \\\n \"${CURRENT_PACKAGES_DIR}/share/doc/dart/data/\"" "")
+
+file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+file(COPY_FILE "${SOURCE_PATH}/dart/external/convhull_3d/convhull_3d.h" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/convhull_3d LICENSE")
+vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/convhull_3d LICENSE" [[[*]/.*]] [[*/]] REGEX)
+vcpkg_install_copyright(
+ FILE_LIST
+ "${SOURCE_PATH}/LICENSE"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/convhull_3d LICENSE"
+)
diff --git a/vcpkg/ports/dartsim/usage b/vcpkg/ports/dartsim/usage
new file mode 100644
index 0000000..0b3d0ef
--- /dev/null
+++ b/vcpkg/ports/dartsim/usage
@@ -0,0 +1,9 @@
+dartsim provides CMake targets:
+
+ find_package(DART CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE dart) # main library
+
+dartsim provides pkg-config modules:
+
+ # Dynamic Animation and Robotics Toolkit.
+ dart
diff --git a/vcpkg/ports/dartsim/vcpkg.json b/vcpkg/ports/dartsim/vcpkg.json
new file mode 100644
index 0000000..f2c69f3
--- /dev/null
+++ b/vcpkg/ports/dartsim/vcpkg.json
@@ -0,0 +1,104 @@
+{
+ "name": "dartsim",
+ "version": "6.15.0",
+ "port-version": 5,
+ "description": "Dynamic Animation and Robotics Toolkit",
+ "homepage": "https://dartsim.github.io/",
+ "license": "BSD-2-Clause",
+ "supports": "!x86 & !arm32",
+ "dependencies": [
+ "assimp",
+ "eigen3",
+ "fcl",
+ "fmt",
+ "lodepng",
+ "octomap",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "collision-bullet": {
+ "description": "Build dart-collision-bullet library",
+ "dependencies": [
+ "bullet3"
+ ]
+ },
+ "collision-ode": {
+ "description": "Build dart-collision-ode library",
+ "dependencies": [
+ "ode"
+ ]
+ },
+ "gui": {
+ "description": "Build dart-gui library",
+ "dependencies": [
+ {
+ "name": "dartsim",
+ "default-features": false,
+ "features": [
+ "utils"
+ ]
+ },
+ {
+ "name": "freeglut",
+ "platform": "!osx"
+ },
+ "opengl"
+ ]
+ },
+ "gui-osg": {
+ "description": "Build dart-gui-osg library",
+ "dependencies": [
+ {
+ "name": "dartsim",
+ "default-features": false,
+ "features": [
+ "gui"
+ ]
+ },
+ {
+ "name": "imgui",
+ "default-features": false,
+ "features": [
+ "opengl2-binding"
+ ]
+ },
+ {
+ "name": "osg",
+ "default-features": false
+ }
+ ]
+ },
+ "spdlog": {
+ "description": "Support spdlog as underlying logging framework",
+ "dependencies": [
+ "spdlog"
+ ]
+ },
+ "utils": {
+ "description": "Build dart-utils library",
+ "dependencies": [
+ "tinyxml2"
+ ]
+ },
+ "utils-urdf": {
+ "description": "Build dart-utils-urdf library",
+ "dependencies": [
+ {
+ "name": "dartsim",
+ "default-features": false,
+ "features": [
+ "utils"
+ ]
+ },
+ "urdfdom"
+ ]
+ }
+ }
+}