diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/omplapp | |
Diffstat (limited to 'vcpkg/ports/omplapp')
| -rw-r--r-- | vcpkg/ports/omplapp/0001-use-external-libs.patch | 147 | ||||
| -rw-r--r-- | vcpkg/ports/omplapp/portfile.cmake | 64 | ||||
| -rw-r--r-- | vcpkg/ports/omplapp/vcpkg.json | 35 |
3 files changed, 246 insertions, 0 deletions
diff --git a/vcpkg/ports/omplapp/0001-use-external-libs.patch b/vcpkg/ports/omplapp/0001-use-external-libs.patch new file mode 100644 index 0000000..4bfb084 --- /dev/null +++ b/vcpkg/ports/omplapp/0001-use-external-libs.patch @@ -0,0 +1,147 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index edca49a..0dd0f51 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,7 +21,9 @@ endif() + + message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") + +-set(_ompl_cmake_modules_path "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules") ++find_package(ompl CONFIG REQUIRED) ++ ++set(_ompl_cmake_modules_path "${ompl_DIR}/CMakeModules") + if(NOT EXISTS "${_ompl_cmake_modules_path}") + message(FATAL_ERROR "Missing ${_ompl_cmake_modules_path}. Did you check out the submodules (\"git submodule update --init --recursive\"?") + endif() +@@ -49,7 +51,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) +@@ -157,12 +158,7 @@ find_package(Doxygen) + enable_testing() + + include_directories(SYSTEM "${Boost_INCLUDE_DIR}") +-include_directories( +- "${OMPLAPP_INCLUDE_DIRS}" +- "${OMPL_INCLUDE_DIRS}" +- "${EIGEN3_INCLUDE_DIR}" +- "${FCL_INCLUDE_DIRS}" +- "${ASSIMP_INCLUDE_DIRS}") ++include_directories("${OMPLAPP_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 +@@ -174,13 +170,19 @@ endif() + + set(OMPLAPP_MODULE_LIBRARIES + ${OPENGL_LIBRARIES} +- ${ASSIMP_LIBRARY} +- ${FCL_LIBRARIES}) ++ ccd ++ ompl::ompl ++ Eigen3::Eigen ++ assimp::assimp ++ fcl) + set(OMPLAPP_LIBRARIES + ${OPENGL_LIBRARIES} +- ${ASSIMP_LIBRARIES} +- ${FCL_LIBRARIES}) +-link_directories(${ASSIMP_LIBRARY_DIRS} ${CCD_LIBRARY_DIRS} ${OCTOMAP_LIBRARY_DIRS} ${FCL_LIBRARY_DIRS}) ++ ccd ++ ompl::ompl ++ Eigen3::Eigen ++ assimp::assimp ++ fcl) ++link_directories(${OCTOMAP_LIBRARY_DIRS}) + + if (OPENGL_INCLUDE_DIR) + include_directories("${OPENGL_INCLUDE_DIR}") +@@ -221,18 +223,15 @@ if(PQP_FOUND) + set(OMPLAPP_LIBRARIES ${OMPLAPP_LIBRARIES} ${PQP_LIBRARY}) + endif() + +-add_subdirectory(ompl/doc) +-add_subdirectory(ompl/src) +-add_subdirectory(ompl/py-bindings) +-add_subdirectory(ompl/tests) +-add_subdirectory(ompl/demos) +-add_subdirectory(ompl/scripts) + add_subdirectory(gui) + add_subdirectory(doc) + add_subdirectory(src) + add_subdirectory(demos) + add_subdirectory(benchmark) +-add_subdirectory(py-bindings) ++ ++if(OMPL_BUILD_PYBINDINGS) ++ add_subdirectory(py-bindings) ++endif() + + install(DIRECTORY resources + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl" +@@ -259,6 +258,8 @@ if(OMPL_BUILD_PYBINDINGS) + endif() + endif() + ++return() ++ + if(OPENGL_FOUND AND NOT MSVC) + target_link_flags(ompl ompl_app_base ompl_app) + set(PKG_NAME "ompl") +diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt +index 7da2b7f..d7397c4 100644 +--- a/benchmark/CMakeLists.txt ++++ b/benchmark/CMakeLists.txt +@@ -1,6 +1,6 @@ + add_executable(ompl_benchmark + CFGBenchmark.cpp BenchmarkOptions.cpp BenchmarkTypes.cpp benchmark.cpp) +-target_link_libraries(ompl_benchmark ${OMPLAPP_LIBRARIES} ompl ompl_app_base ${Boost_PROGRAM_OPTIONS_LIBRARY}) ++target_link_libraries(ompl_benchmark ${OMPLAPP_LIBRARIES} ompl_app_base ${Boost_PROGRAM_OPTIONS_LIBRARY}) + install(TARGETS ompl_benchmark + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT omplapp +diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt +index 9c50d41..750aaee 100644 +--- a/demos/CMakeLists.txt ++++ b/demos/CMakeLists.txt +@@ -1,5 +1,5 @@ + if (OMPL_BUILD_DEMOS) +- set(OMPLAPP_DEMO_LIBRARIES ${OMPLAPP_LIBRARIES} ompl ompl_app_base) ++ set(OMPLAPP_DEMO_LIBRARIES ${OMPLAPP_LIBRARIES} ompl_app_base) + + macro(add_omplapp_demo demo_name) + add_executable(${ARGV}) +diff --git a/src/omplapp/CMakeLists.txt b/src/omplapp/CMakeLists.txt +index 2d0c8e5..d95567f 100644 +--- a/src/omplapp/CMakeLists.txt ++++ b/src/omplapp/CMakeLists.txt +@@ -23,7 +23,7 @@ foreach(_target ${OMPLAPP_TARGETS}) + add_library(${_target} SHARED ${${_target}_SRC}) + endif(MSVC) + +- target_link_libraries(${_target} ompl ${OMPLAPP_LIBRARIES}) ++ target_link_libraries(${_target} ${OMPLAPP_LIBRARIES}) + if(_target STREQUAL ompl_app) + target_compile_definitions(ompl_app PRIVATE -DGL_SILENCE_DEPRECATION) + target_link_libraries(ompl_app ompl_app_base) +@@ -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" ++) diff --git a/vcpkg/ports/omplapp/portfile.cmake b/vcpkg/ports/omplapp/portfile.cmake new file mode 100644 index 0000000..e2c4bbe --- /dev/null +++ b/vcpkg/ports/omplapp/portfile.cmake @@ -0,0 +1,64 @@ +vcpkg_buildpath_length_warning(37)
+
+# See https://github.com/ompl/omplapp/blob/1.7.0/src/omplapp/CMakeLists.txt#L20-L24
+if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+else()
+ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ompl/omplapp
+ REF "${VERSION}"
+ SHA512 cb68791c39b6b2aceb4204c72b7678f2f0d895f0ae2500803f93dab0918f85c322d62c28693c60b50c6b7bc0fb4c448a33e3951c608a68befe21227c1c68a7ec
+ HEAD_REF main
+ PATCHES
+ 0001-use-external-libs.patch
+)
+
+# Remove internal find module files
+file(GLOB find_modules "${SOURCE_PATH}/CMakeModules/Find*.cmake")
+file(REMOVE_RECURSE ${find_modules})
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ opengl CMAKE_REQUIRE_FIND_PACKAGE_OpenGL
+ INVERTED_FEATURES
+ opengl CMAKE_DISABLE_FIND_PACKAGE_OpenGL
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DOMPL_VERSIONED_INSTALL=OFF
+ -DOMPL_BUILD_DEMOS=OFF
+ -DOMPL_BUILD_PYBINDINGS=OFF
+ -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_flann=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_PQP=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_spot=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Triangle=ON
+)
+
+vcpkg_cmake_install()
+
+# Extending the ompl CMake package
+vcpkg_cmake_config_fixup(PACKAGE_NAME ompl)
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/omplapp/config.h" "#define OMPLAPP_RESOURCE_DIR \"${CURRENT_PACKAGES_DIR}/share/ompl/resources\"" "")
+
+vcpkg_copy_tools(TOOL_NAMES ompl_benchmark AUTO_CLEAN)
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/include/omplapp/CMakeFiles"
+ "${CURRENT_PACKAGES_DIR}/share/man"
+ "${CURRENT_PACKAGES_DIR}/share/ompl/demos"
+ "${CURRENT_PACKAGES_DIR}/share/ompl/resources"
+)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/omplapp/vcpkg.json b/vcpkg/ports/omplapp/vcpkg.json new file mode 100644 index 0000000..e20e738 --- /dev/null +++ b/vcpkg/ports/omplapp/vcpkg.json @@ -0,0 +1,35 @@ +{ + "name": "omplapp", + "version": "1.7.0", + "description": "Use OMPL for reading meshes and performing collision checking", + "homepage": "https://ompl.kavrakilab.org/", + "license": null, + "dependencies": [ + "assimp", + "boost-filesystem", + "boost-math", + "boost-program-options", + "boost-serialization", + "boost-system", + "ccd", + "eigen3", + "fcl", + "ompl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "opengl": { + "description": "Build with OpenGL support", + "dependencies": [ + "opengl" + ] + } + } +} |