Skip to content

Commit

Permalink
[ompl] no absolute paths (#21104)
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort authored Nov 4, 2021
1 parent 0032024 commit 058dea0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
46 changes: 20 additions & 26 deletions ports/ompl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,23 @@ vcpkg_buildpath_length_warning(37)

set(OMPL_VERSION 1.5.1)

vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/ompl/ompl/archive/1.5.1.tar.gz"
FILENAME "ompl-${OMPL_VERSION}.tar.gz"
SHA512 2f28d29f32f3bb03e67b29ce251e4786364847a25e3c4cf66d7663ed38dca4da71d4e03cf9ce647710d9524a3907c76c09795e77f041cb8822f695d28f5ca570
)

vcpkg_extract_source_archive_ex(
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${OMPL_VERSION}
REPO ompl/ompl
REF 1.5.1
SHA512 2f28d29f32f3bb03e67b29ce251e4786364847a25e3c4cf66d7663ed38dca4da71d4e03cf9ce647710d9524a3907c76c09795e77f041cb8822f695d28f5ca570
HEAD_REF master
PATCHES
0001_Export_targets.patch
0002_Fix_config.patch
)

# Based on selected features different files get downloaded, so use the following command instead of patch.
file(READ ${SOURCE_PATH}/CMakeLists.txt _contents)
string(REPLACE "find_package(Eigen3 REQUIRED)" "find_package(Eigen3 REQUIRED CONFIG)" _contents "${_contents}")
string(REPLACE "find_package(ccd REQUIRED)" "find_package(ccd REQUIRED CONFIG)" _contents "${_contents}")
file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${_contents}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
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_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DOMPL_VERSIONED_INSTALL=OFF
Expand All @@ -36,23 +29,24 @@ vcpkg_configure_cmake(
-DOMPL_BUILD_PYTESTS=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/ompl/cmake)
vcpkg_cmake_config_fixup(CONFIG_PATH share/ompl/cmake)
vcpkg_fixup_pkgconfig()

# Remove debug distribution and other, move ompl_benchmark to tools/ dir
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/share/man
${CURRENT_PACKAGES_DIR}/share/ompl/demos
${CURRENT_PACKAGES_DIR}/share/ompl/ompl.conf
${CURRENT_PACKAGES_DIR}/share/ompl/plannerarena
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/man"
"${CURRENT_PACKAGES_DIR}/share/ompl/demos"
"${CURRENT_PACKAGES_DIR}/share/ompl/ompl.conf"
"${CURRENT_PACKAGES_DIR}/share/ompl/plannerarena"
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

# 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)
12 changes: 10 additions & 2 deletions ports/ompl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ompl",
"version-string": "1.5.1",
"port-version": 2,
"port-version": 3,
"description": "The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms",
"homepage": "https://ompl.kavrakilab.org/",
"dependencies": [
Expand All @@ -15,6 +15,14 @@
"boost-test",
"boost-timer",
"boost-ublas",
"eigen3"
"eigen3",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4802,7 +4802,7 @@
},
"ompl": {
"baseline": "1.5.1",
"port-version": 2
"port-version": 3
},
"omplapp": {
"baseline": "1.5.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/ompl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4385de7645c202d99bb25420d049f15cb54d9ed7",
"version-string": "1.5.1",
"port-version": 3
},
{
"git-tree": "87e475355f626557d8762d014c7f0efa2d2d488e",
"version-string": "1.5.1",
Expand Down

0 comments on commit 058dea0

Please sign in to comment.