Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ompl,omplapp] Overhaul #43987

Merged
merged 8 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions ports/ompl/0001_Export_targets.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9bb05f..31fab8c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,6 +215,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake
COMPONENT ompl)
+install(EXPORT ompl
+ DESTINATION "share/ompl"
+ FILE ompl-targets.cmake
+)

# script to install ompl on Ubuntu
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/install-ompl-ubuntu.sh.in"
diff --git a/src/ompl/CMakeLists.txt b/src/ompl/CMakeLists.txt
index 9ea130e..6dda4df 100644
index 8e19b30..df38912 100644
--- a/src/ompl/CMakeLists.txt
+++ b/src/ompl/CMakeLists.txt
@@ -83,6 +83,7 @@ endif (MSVC)
@@ -84,9 +84,15 @@ else (MSVC)
endif (MSVC)

# install the library
+target_include_directories(ompl PUBLIC $<INSTALL_INTERFACE:include>)
install(TARGETS ompl
+ EXPORT ompl
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT ompl)
+install(EXPORT ompl
+ DESTINATION "share/ompl"
+ FILE ompl-targets.cmake
+)
if (NOT MSVC)
add_custom_command(TARGET ompl POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:ompl>"
36 changes: 25 additions & 11 deletions ports/ompl/0002_Fix_config.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
diff --git a/omplConfig.cmake.in b/omplConfig.cmake.in
index 465de25d..d1e91929 100644
diff --git a/omplConfig.cmake.in b/omplConfig.cmake.in
index 2d88251..c987fdc 100644
--- a/omplConfig.cmake.in
+++ b/omplConfig.cmake.in
@@ -18,8 +18,11 @@ set(OMPL_MAJOR_VERSION @PROJECT_VERSION_MAJOR@)
@@ -18,8 +18,16 @@ set(OMPL_MAJOR_VERSION @PROJECT_VERSION_MAJOR@)
set(OMPL_MINOR_VERSION @PROJECT_VERSION_MINOR@)
set(OMPL_PATCH_VERSION @PROJECT_VERSION_PATCH@)

+include(CMakeFindDependencyMacro)
+find_dependency(Boost 1.58 COMPONENTS serialization filesystem system program_options)
+find_dependency(Boost COMPONENTS @ALL_BOOST_COMPONENTS@)
+find_dependency(Eigen3)
+include("${CMAKE_CURRENT_LIST_DIR}/omplapp-dependencies.cmake" OPTIONAL)
+
+include("${CMAKE_CURRENT_LIST_DIR}/ompl-targets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/omplapp-targets.cmake" OPTIONAL)
+
set_and_check(OMPL_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-set(OMPL_INCLUDE_DIRS "${OMPL_INCLUDE_DIR};@Boost_INCLUDE_DIR@;@EIGEN3_INCLUDE_DIR@")
+set(OMPL_INCLUDE_DIRS "${OMPL_INCLUDE_DIR};${Boost_INCLUDE_DIR};${EIGEN3_INCLUDE_DIR}")
+set(OMPL_INCLUDE_DIRS "${OMPL_INCLUDE_DIR};${Boost_INCLUDE_DIRS};${EIGEN3_INCLUDE_DIRS}")
foreach(_dir @FLANN_INCLUDE_DIRS@;@ODE_INCLUDE_DIRS@;@SPOT_INCLUDE_DIRS@;@TRIANGLE_INCLUDE_DIR@;@FCL_INCLUDE_DIRS@;@PQP_INCLUDE_DIR@;@ASSIMP_INCLUDE_DIRS@;@OPENGL_INCLUDE_DIR@)
if(_dir)
list(APPEND OMPL_INCLUDE_DIRS "${_dir}")
@@ -29,7 +32,7 @@ list(REMOVE_DUPLICATES OMPL_INCLUDE_DIRS)
@@ -29,7 +37,7 @@ list(REMOVE_DUPLICATES OMPL_INCLUDE_DIRS)
set(OMPL_INCLUDE_DIRS "${OMPL_INCLUDE_DIRS}" CACHE STRING "Include path for OMPL and its dependencies")

set_and_check(OMPL_LIBRARY_DIR @PACKAGE_LIB_INSTALL_DIR@)
Expand All @@ -24,7 +29,7 @@ index 465de25d..d1e91929 100644
foreach(_dir @FLANN_LIBRARY_DIRS@;@ODE_LIBRARY_DIRS@;@SPOT_LIBRARY_DIRS@;@FCL_LIBRARY_DIRS@;@ASSIMP_LIBRARY_DIRS@)
if(_dir)
list(APPEND OMPL_LIBRARY_DIRS "${_dir}")
@@ -40,7 +43,7 @@ set(OMPL_LIBRARY_DIRS "${OMPL_LIBRARY_DIRS}" CACHE STRING "Library path for OMPL
@@ -40,7 +48,7 @@ set(OMPL_LIBRARY_DIRS "${OMPL_LIBRARY_DIRS}" CACHE STRING "Library path for OMPL

find_library(OMPL_LIBRARIES NAMES ompl.${OMPL_VERSION} ompl
PATHS ${OMPL_LIBRARY_DIR} NO_DEFAULT_PATH)
Expand All @@ -33,8 +38,17 @@ index 465de25d..d1e91929 100644
if(_lib)
list(APPEND OMPL_LIBRARIES "${_lib}")
endif()
@@ -61,3 +64,4 @@ endif()
diff --git a/src/ompl/CMakeLists.txt b/src/ompl/CMakeLists.txt
index df38912..5166568 100644
--- a/src/ompl/CMakeLists.txt
+++ b/src/ompl/CMakeLists.txt
@@ -60,6 +60,9 @@ target_link_libraries(ompl
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT})
+set(ALL_BOOST_COMPONENTS "serialization filesystem system" CACHE INTERNAL
+ "Components for Boost link libs as used above this line"
+)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ompl DEFAULT_MSG OMPL_INCLUDE_DIRS OMPL_LIBRARY_DIRS OMPL_LIBRARIES)
+include(${CMAKE_CURRENT_LIST_DIR}/ompl-targets.cmake)
if (OMPL_EXTENSION_ODE)
if (NOT CMAKE_VERSION VERSION_LESS 3.13)
13 changes: 13 additions & 0 deletions ports/ompl/0003_disable-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc81419..88046b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,7 +183,7 @@ add_subdirectory(demos)
add_subdirectory(scripts)
add_subdirectory(doc)

-if(NOT MSVC)
+if(0)
target_link_flags(ompl)
set(PKG_NAME "ompl")
set(PKG_DESC "The Open Motion Planning Library")
25 changes: 0 additions & 25 deletions ports/ompl/0003_fix_dep.patch

This file was deleted.

6 changes: 6 additions & 0 deletions ports/ompl/FindPython.cmake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be changed to CMAKE_DISABLE_FIND_PACKAGE_ ?

Copy link
Contributor Author

@dg0yt dg0yt Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. ompl and omplapp rely on extra functions and macros being added by its own FindPython.cmake. This is solved by the noop module vendored into the port.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function(find_python_module)
endfunction()
macro(find_boost_python)
endmacro()
macro(install_python)
endmacro()
42 changes: 24 additions & 18 deletions ports/ompl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
vcpkg_buildpath_length_warning(37)

# See https://github.com/ompl/ompl/blob/main/src/ompl/CMakeLists.txt#L49-L54
# See https://github.com/ompl/ompl/blob/1.6.0/src/ompl/CMakeLists.txt#L52-L56
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
else()
Expand All @@ -10,20 +10,21 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ompl/ompl
REF "${VERSION}"
SHA512 d1024d7cc8e309a1df94a950be67eefae1e66abaccd6b6b8980939559aee3d73c05c838ab24c818b6b57ce6c4b3181fde7595d3d1dd36d6cd0c6d125338084ac
HEAD_REF master
REF "${VERSION}"
SHA512 d1024d7cc8e309a1df94a950be67eefae1e66abaccd6b6b8980939559aee3d73c05c838ab24c818b6b57ce6c4b3181fde7595d3d1dd36d6cd0c6d125338084ac
HEAD_REF main
PATCHES
0001_Export_targets.patch
0002_Fix_config.patch
0003_fix_dep.patch
0003_disable-pkgconfig.patch
0004_include_chrono.patch # https://github.com/ompl/ompl/pull/1201
)
file(GLOB find_modules "${SOURCE_PATH}/CMakeModules/Find*.cmake")
file(REMOVE_RECURSE "${SOURCE_PATH}/src/external" ${find_modules})
# The ompl/omplapp ports don't support python features.
file(COPY "${CURRENT_PORT_DIR}/FindPython.cmake" DESTINATION "${SOURCE_PATH}/CMakeModules")

# 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)" IGNORE_UNCHANGED)

set(ENV{PYTHON_EXEC} "PYTHON_EXEC-NOTFOUND")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
Expand All @@ -34,25 +35,30 @@ vcpkg_cmake_configure(
-DOMPL_BUILD_TESTS=OFF
-DOMPL_BUILD_PYBINDINGS=OFF
-DOMPL_BUILD_PYTESTS=OFF
-DR_EXEC=R_EXEC-NOTFOUND
-DCMAKE_POLICY_DEFAULT_CMP0167=OLD
-DCMAKE_DISABLE_FIND_PACKAGE_castxml=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
-DCMAKE_DISABLE_FIND_PACKAGE_flann=ON
-DCMAKE_DISABLE_FIND_PACKAGE_MORSE=ON
-DCMAKE_DISABLE_FIND_PACKAGE_ODE=ON
-DCMAKE_DISABLE_FIND_PACKAGE_spot=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Triangle=ON
)

vcpkg_cmake_install()

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

# 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"
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
# Used by port omplapp
file(GLOB cmake_modules "${SOURCE_PATH}/CMakeModules/*.cmake")
file(COPY ${cmake_modules} DESTINATION "${CURRENT_PACKAGES_DIR}/share/ompl/CMakeModules")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
18 changes: 14 additions & 4 deletions ports/ompl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
{
"name": "ompl",
"version": "1.6.0",
"port-version": 3,
"port-version": 4,
"description": "The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms",
"homepage": "https://ompl.kavrakilab.org/",
"supports": "!(static & staticcrt) | (windows & !mingw)",
"dependencies": [
"boost-algorithm",
"boost-assert",
"boost-concept-check",
"boost-config",
"boost-container-hash",
"boost-dynamic-bitset",
"boost-filesystem",
"boost-foreach",
"boost-graph",
"boost-math",
"boost-odeint",
"boost-program-options",
"boost-property-map",
"boost-range",
"boost-serialization",
"boost-smart-ptr",
"boost-system",
"boost-test",
"boost-timer",
"boost-ublas",
"boost-thread",
"boost-type-traits",
"eigen3",
{
"name": "vcpkg-cmake",
Expand Down
12 changes: 0 additions & 12 deletions ports/omplapp/add-include-chrono.patch

This file was deleted.

12 changes: 12 additions & 0 deletions ports/omplapp/boost-program-options.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34bf0b4..b49b47f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,7 +38,6 @@ set(OMPL_CMAKE_UTIL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules"

if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
- add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
endif(MSVC)
# Ensure dynamic linking with boost unit_test_framework
add_definitions(-DBOOST_TEST_DYN_LINK)
21 changes: 21 additions & 0 deletions ports/omplapp/export-targets.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/src/omplapp/CMakeLists.txt b/src/omplapp/CMakeLists.txt
index 2d0c8e5..9cd902f 100644
--- a/src/omplapp/CMakeLists.txt
+++ b/src/omplapp/CMakeLists.txt
@@ -39,6 +39,7 @@ foreach(_target ${OMPLAPP_TARGETS})
endif(WIN32)

install(TARGETS ${_target}
+ EXPORT omplapp
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT omplapp)
if(NOT MSVC)
@@ -54,3 +55,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/config.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/omplapp"
COMPONENT omplapp)
+
+install(EXPORT omplapp
+ FILE omplapp-targets.cmake
+ DESTINATION "share/ompl"
+)
17 changes: 0 additions & 17 deletions ports/omplapp/fix_boost_static_link.patch

This file was deleted.

Loading
Loading