Skip to content

Commit

Permalink
[vcpkg baseline][many ports] Fix build failures (#22180)
Browse files Browse the repository at this point in the history
* [vcpkg baseline][omplapp] Fix dependencies, add features

* version

* [sdformat9] Add the required dependency urdfdom-headers

* [ignition-math6] Fix build error

* version

* [botan] Fix the pkgconfig again

* version
  • Loading branch information
JackBoosY authored Dec 28, 2021
1 parent ae91542 commit e1aaeb2
Show file tree
Hide file tree
Showing 16 changed files with 248 additions and 60 deletions.
12 changes: 12 additions & 0 deletions ports/botan/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-2/botan" "${CURRENT_PACKAGES_
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/botan-2.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/botan-2.pc")
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/botan-2.pc"
[[\lib]]
[[/lib]]
)
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/botan-2.pc"
[[${prefix}/include/botan-2]]
[[${prefix}/include]]
Expand All @@ -137,6 +143,12 @@ endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/botan-2.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/botan-2.pc")
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/botan-2.pc"
[[\lib]]
[[/lib]]
)
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/botan-2.pc"
[[${prefix}/include/botan-2]]
[[${prefix}/include]]
Expand Down
2 changes: 1 addition & 1 deletion ports/botan/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "botan",
"version": "2.18.1",
"port-version": 4,
"port-version": 5,
"description": "A cryptography library written in C++11",
"homepage": "https://botan.randombit.net",
"supports": "!(windows & arm)",
Expand Down
12 changes: 12 additions & 0 deletions ports/ignition-math6/fix-isspace.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/include/ignition/math/Color.hh b/include/ignition/math/Color.hh
index faf7a08..16758c5 100644
--- a/include/ignition/math/Color.hh
+++ b/include/ignition/math/Color.hh
@@ -18,6 +18,7 @@
#define IGNITION_MATH_COLOR_HH_

#include <iostream>
+#include <cctype>

#include <ignition/math/Helpers.hh>
#include <ignition/math/Vector3.hh>
3 changes: 2 additions & 1 deletion ports/ignition-math6/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ include(${CURRENT_INSTALLED_DIR}/share/ignitionmodularscripts/ignition_modular_l

ignition_modular_library(NAME math
VERSION "6.6.0"
SHA512 1b5f59b45256daa81cbfb7da4727200d0d6cb4a75fbc3b83b512c18ec6307b5bd78b8ee7a84f0f8a8c334717a1480766f62658bd213e9021c09c0ed22caa921d)
SHA512 1b5f59b45256daa81cbfb7da4727200d0d6cb4a75fbc3b83b512c18ec6307b5bd78b8ee7a84f0f8a8c334717a1480766f62658bd213e9021c09c0ed22caa921d
PATCHES fix-isspace.patch)
2 changes: 1 addition & 1 deletion ports/ignition-math6/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ignition-math6",
"version-string": "6.6.0",
"port-version": 1,
"port-version": 2,
"description": "Math API for robotic applications",
"homepage": "https://ignitionrobotics.org/libs/math",
"dependencies": [
Expand Down
4 changes: 2 additions & 2 deletions ports/omplapp/fix_boost_static_link.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5c3c88..3a4a7d4 100644
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b391b5..24d2c66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,10 +36,10 @@ set(OMPL_DEMO_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/ompl/demos"
Expand Down
160 changes: 128 additions & 32 deletions ports/omplapp/fix_dependency.patch
Original file line number Diff line number Diff line change
@@ -1,32 +1,128 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c7e6901..a433b7da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,7 @@ find_package(Drawstuff QUIET)
set_package_properties(assimp PROPERTIES
URL "http://assimp.org"
PURPOSE "Used in ompl_app for reading meshes representing robots and environments.")
-find_package(assimp REQUIRED)
+find_package(assimp CONFIG REQUIRED)
set_package_properties(ccd PROPERTIES
URL "https://github.com/danfis/libccd"
PURPOSE "Collision detection library used by fcl.")
@@ -178,8 +178,7 @@ include_directories(
"${OMPLAPP_INCLUDE_DIRS}"
"${OMPL_INCLUDE_DIRS}"
"${EIGEN3_INCLUDE_DIR}"
- "${FCL_INCLUDE_DIRS}"
- "${ASSIMP_INCLUDE_DIRS}")
+ "${FCL_INCLUDE_DIRS}")

# ROS installs fcl in /usr. In /usr/include/fcl/config.h it says octomap was
# enabled. Octomap is installed in /opt/ros/${ROS_DISTRO}/include (most
@@ -195,7 +194,7 @@ set(OMPLAPP_MODULE_LIBRARIES
${FCL_LIBRARIES})
set(OMPLAPP_LIBRARIES
${OPENGL_LIBRARIES}
- ${ASSIMP_LIBRARIES}
+ assimp::assimp
${FCL_LIBRARIES})
link_directories(${ASSIMP_LIBRARY_DIRS} ${CCD_LIBRARY_DIRS} ${OCTOMAP_LIBRARY_DIRS} ${FCL_LIBRARY_DIRS})

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c7e690..4b391b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,12 +73,15 @@ set_package_properties(OpenGL PROPERTIES
URL "http://opengl.org"
PURPOSE "Used to render graphics in ompl_app.")
set(OpenGL_GL_PREFERENCE GLVND)
-find_package(OpenGL)
+if (OMPLAPP_WITH_OPENGL)
+find_package(OpenGL REQUIRED)
+endif()
set_package_properties(Python PROPERTIES
URL "http://python.org"
PURPOSE "Used for python bindings.")
# This includes our own FindPython.cmake in ompl/CMakeModules. It defines,
# among other things, the find_python_module() function used below.
+if (OMPLAPP_WITH_PYTHON)
find_package(Python)
find_boost_python()

@@ -105,55 +108,76 @@ find_python_module(OpenGL)
if (NOT OPENGL_FOUND OR NOT PY_OPENGL)
message(WARNING "Both OpenGL and the Python OpenGL module need to be installed to use the GUI")
endif()
+endif()
set_package_properties(Eigen3 PROPERTIES
URL "http://eigen.tuxfamily.org"
PURPOSE "A linear algebra library used throughout OMPL.")
-find_package(Eigen3 REQUIRED)
+find_package(Eigen3 CONFIG REQUIRED)
set_package_properties(Triangle PROPERTIES
URL "http://www.cs.cmu.edu/~quake/triangle.html"
PURPOSE "Used to create triangular decompositions of polygonal 2D environments.")
+if (OMPLAPP_WITH_TRIANGLE)
find_package(Triangle QUIET)
+endif()
set_package_properties(flann PROPERTIES
URL "https://github.com/mariusmuja/flann"
PURPOSE "If detetected, FLANN can be used for nearest neighbor queries by OMPL.")
+if (OMPLAPP_WITH_FLANN)
find_package(flann 1.8.3 QUIET)
+endif()
set_package_properties(spot PROPERTIES
URL "http://spot.lrde.epita.fr"
PURPOSE "Used for constructing finite automata from LTL formulae.")
+if (OMPLAPP_WITH_SPOT)
find_package(spot)
+endif()
set_package_properties(MORSE PROPERTIES
URL "https://www.openrobots.org/wiki/morse"
PURPOSE "OMPL includes a plugin for the MORSE Robot Simulation engine.")
+if (OMPLAPP_WITH_MORSE)
find_package(MORSE QUIET)
+endif()
set_package_properties(ODE PROPERTIES
URL "http://ode.org"
PURPOSE "The Open Dynamics Engine can be used as a \"black box\" for kinodynamic planning.")
-find_package(ODE QUIET)
+if (OMPLAPP_WITH_ODE)
+find_package(ODE CONFIG REQUIRED)
+set(ODE_LIBRARIES ODE::ODE)
+endif()
set_package_properties(Drawstuff PROPERTIES
URL "http://ode.org"
PURPOSE "Part of the ODE source distribution, used in one demo program.")
+if (OMPLAPP_WITH_DRAWSTUFF)
find_package(Drawstuff QUIET)
+endif()
set_package_properties(assimp PROPERTIES
URL "http://assimp.org"
PURPOSE "Used in ompl_app for reading meshes representing robots and environments.")
-find_package(assimp REQUIRED)
+find_package(assimp CONFIG REQUIRED)
+set(ASSIMP_LIBRARIES assimp::assimp)
set_package_properties(ccd PROPERTIES
URL "https://github.com/danfis/libccd"
PURPOSE "Collision detection library used by fcl.")
-find_package(ccd REQUIRED)
+find_package(ccd CONFIG REQUIRED)
set_package_properties(fcl PROPERTIES
URL "https://github.com/flexible-collision-library/fcl"
PURPOSE "The default collision checking library.")
+if (OMPLAPP_WITH_OCTOMAP)
find_package(octomap QUIET)
+endif()
find_package(fcl REQUIRED)
set_package_properties(Threads PROPERTIES
URL "https://en.wikipedia.org/wiki/POSIX_Threads"
PURPOSE "Pthreads is sometimes needed, depending on OS / compiler.")
+if (OMPLAPP_WITH_THREADS)
find_package(Threads QUIET)
+endif()
set_package_properties(Doxygen PROPERTIES
URL "http://doxygen.org"
PURPOSE "Used to create the OMPL documentation (i.e., http://ompl.kavrakilab.org).")
+if (OMPLAPP_WITH_DOXYGEN)
find_package(Doxygen)
+endif()

enable_testing()

@@ -177,9 +201,7 @@ include_directories(SYSTEM "${Boost_INCLUDE_DIR}")
include_directories(
"${OMPLAPP_INCLUDE_DIRS}"
"${OMPL_INCLUDE_DIRS}"
- "${EIGEN3_INCLUDE_DIR}"
- "${FCL_INCLUDE_DIRS}"
- "${ASSIMP_INCLUDE_DIRS}")
+ "${FCL_INCLUDE_DIRS}")

# ROS installs fcl in /usr. In /usr/include/fcl/config.h it says octomap was
# enabled. Octomap is installed in /opt/ros/${ROS_DISTRO}/include (most
@@ -242,12 +264,14 @@ endif()
set_package_properties(PQP PROPERTIES
URL "http://gamma.cs.unc.edu/SSV/"
PURPOSE "Used as an alternative, additional collision checking library (the default is FCL).")
+IF (OMPLAPP_WITH_PQP)
find_package(PQP QUIET)
if(PQP_FOUND)
include_directories("${PQP_INCLUDE_DIR}")
set(OMPLAPP_MODULE_LIBRARIES ${OMPLAPP_MODULE_LIBRARIES} ${PQP_LIBRARY})
set(OMPLAPP_LIBRARIES ${OMPLAPP_LIBRARIES} ${PQP_LIBRARY})
endif()
+endif()

add_subdirectory(ompl/doc)
add_subdirectory(ompl/src)
21 changes: 18 additions & 3 deletions ports/omplapp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,35 @@ vcpkg_extract_source_archive_ex(
${STATIC_PATCH}
)

# Based on selected features different files get downloaded, so use the following command instead of patch.
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "find_package(Eigen3 REQUIRED)" "find_package(Eigen3 REQUIRED CONFIG)")
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "find_package(ccd REQUIRED)" "find_package(ccd REQUIRED CONFIG)")
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ode OMPLAPP_WITH_ODE
opengl OMPLAPP_WITH_OPENGL
threads OMPLAPP_WITH_THREADS
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${FEATURE_OPTIONS}
-DOMPL_VERSIONED_INSTALL=OFF
-DOMPL_REGISTRATION=OFF
-DOMPL_BUILD_DEMOS=OFF
-DOMPL_BUILD_TESTS=OFF
-DOMPL_BUILD_PYBINDINGS=OFF
-DOMPL_BUILD_PYTESTS=OFF
# Not implement
-DOMPLAPP_WITH_PYTHON=OFF
-DOMPLAPP_WITH_TRIANGLE=OFF
-DOMPLAPP_WITH_OCTOMAP=OFF
-DOMPLAPP_WITH_FLANN=OFF # Requires 1.8.3
# Missing dependencies in vcpkg
-DOMPLAPP_WITH_SPOT=OFF
-DOMPLAPP_WITH_MORSE=OFF
-DOMPLAPP_WITH_DRAWSTUFF=OFF
-DOMPLAPP_WITH_PQP=OFF
-DOMPLAPP_WITH_DOXYGEN=OFF
)

vcpkg_cmake_install()
Expand Down
30 changes: 28 additions & 2 deletions ports/omplapp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"name": "omplapp",
"version": "1.5.1",
"port-version": 2,
"port-version": 3,
"description": "Use OMPL for reading meshes and performing collision checking",
"homepage": "https://ompl.kavrakilab.org/",
"dependencies": [
"assimp",
"boost-filesystem",
"boost-program-options",
"boost-serialization",
"boost-system",
"ccd",
"eigen3",
"fcl",
"ompl",
{
Expand All @@ -16,5 +22,25 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"ode": {
"description": "Build with Open Dynamics Engine support",
"dependencies": [
"ode"
]
},
"opengl": {
"description": "Build with OpenGL support",
"dependencies": [
"opengl"
]
},
"threads": {
"description": "Build with Threads support",
"dependencies": [
"pthreads"
]
}
}
}
21 changes: 9 additions & 12 deletions ports/sdformat9/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(ON_TARGET "linux" "uwp")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO osrf/sdformat
Expand All @@ -14,30 +12,29 @@ vcpkg_from_github(
vcpkg_find_acquire_program(RUBY)
get_filename_component(RUBY_PATH ${RUBY} DIRECTORY)
set(_path $ENV{PATH})
vcpkg_add_to_path(${RUBY_PATH})
vcpkg_add_to_path("${RUBY_PATH}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DUSE_EXTERNAL_URDF=ON
-DUSE_EXTERNAL_TINYXML=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# Restore original path
set(ENV{PATH} ${_path})

# Fix cmake targets and pkg-config file location
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/sdformat9")
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/sdformat9")
vcpkg_fixup_pkgconfig()

# Remove debug files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
"${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 11 additions & 2 deletions ports/sdformat9/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"name": "sdformat9",
"version-string": "9.4.0",
"port-version": 1,
"port-version": 2,
"description": "Simulation Description Format (SDF) parser and description files.",
"homepage": "http://sdformat.org/",
"supports": "!(linux | uwp)",
"dependencies": [
"ignition-math6",
"tinyxml",
"urdfdom"
"urdfdom",
"urdfdom-headers",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
5 changes: 5 additions & 0 deletions versions/b-/botan.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7a800cf24fcc51e57dedfb8782753c50305880e1",
"version": "2.18.1",
"port-version": 5
},
{
"git-tree": "477e259691b81a016da459532f616b5fca230a91",
"version": "2.18.1",
Expand Down
Loading

0 comments on commit e1aaeb2

Please sign in to comment.