diff options
| author | Akash <Ace314159@users.noreply.github.com> | 2021-07-22 17:00:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-22 15:00:49 -0700 |
| commit | d12cbb40ed3eb0eb60b844585f57a5d0b6ed0c23 (patch) | |
| tree | 47742301a5fbd2501a0a657105dd0cbb35184a72 /ports/ompl | |
| parent | 2a0c48a32dc82fe4416605fae8ac897bc2dab4da (diff) | |
| download | vcpkg-d12cbb40ed3eb0eb60b844585f57a5d0b6ed0c23.tar.gz vcpkg-d12cbb40ed3eb0eb60b844585f57a5d0b6ed0c23.zip | |
[ompl] Fix linking using ${OMPL_LIBRARIES} (#18908)
* Fix _IMPORT_PREFIX
* Export cmake targets file
* Fix config
* Make separate omplapp port
* Run x-add-version for omplapp
* Fix versions
* Fix omplapp static builds
* Run x-add-version
* Update ports/omplapp/portfile.cmake
Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
* Update ports/omplapp/portfile.cmake
Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
* Put files in quotes
* Run x-add-version
Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
Diffstat (limited to 'ports/ompl')
| -rw-r--r-- | ports/ompl/0001_Export_targets.patch | 27 | ||||
| -rw-r--r-- | ports/ompl/0002_Fix_config.patch | 39 | ||||
| -rw-r--r-- | ports/ompl/CONTROL | 6 | ||||
| -rw-r--r-- | ports/ompl/fix_dependency.patch | 32 | ||||
| -rw-r--r-- | ports/ompl/portfile.cmake | 36 |
5 files changed, 75 insertions, 65 deletions
diff --git a/ports/ompl/0001_Export_targets.patch b/ports/ompl/0001_Export_targets.patch new file mode 100644 index 000000000..6d599aec3 --- /dev/null +++ b/ports/ompl/0001_Export_targets.patch @@ -0,0 +1,27 @@ +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
+--- a/src/ompl/CMakeLists.txt
++++ b/src/ompl/CMakeLists.txt
+@@ -83,6 +83,7 @@ endif (MSVC)
+
+ # install the library
+ install(TARGETS ompl
++ EXPORT ompl
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ COMPONENT ompl)
+ if (NOT MSVC)
diff --git a/ports/ompl/0002_Fix_config.patch b/ports/ompl/0002_Fix_config.patch new file mode 100644 index 000000000..974b1b6ad --- /dev/null +++ b/ports/ompl/0002_Fix_config.patch @@ -0,0 +1,39 @@ +diff --git a/omplConfig.cmake.in b/omplConfig.cmake.in
+index 465de25..ad373fa 100644
+--- a/omplConfig.cmake.in
++++ b/omplConfig.cmake.in
+@@ -18,8 +18,10 @@ set(OMPL_MAJOR_VERSION @PROJECT_VERSION_MAJOR@)
+ set(OMPL_MINOR_VERSION @PROJECT_VERSION_MINOR@)
+ set(OMPL_PATCH_VERSION @PROJECT_VERSION_PATCH@)
+
++find_dependency(Boost 1.58 COMPONENTS serialization filesystem system program_options)
++find_dependency(Eigen3)
+ 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}")
+ 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 +31,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@)
+-set(OMPL_LIBRARY_DIRS "${OMPL_LIBRARY_DIR};@Boost_LIBRARY_DIRS@")
++set(OMPL_LIBRARY_DIRS "${OMPL_LIBRARY_DIR};${Boost_LIBRARY_DIRS}")
+ 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 +42,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)
+-foreach(_lib @Boost_SERIALIZATION_LIBRARY@;@Boost_FILESYSTEM_LIBRARY@;@Boost_SYSTEM_LIBRARY@;@ODE_LIBRARIES@;@SPOT_LIBRARIES@)
++foreach(_lib ${Boost_SERIALIZATION_LIBRARY};${Boost_FILESYSTEM_LIBRARY};${Boost_SYSTEM_LIBRARY};@ODE_LIBRARIES@;@SPOT_LIBRARIES@)
+ if(_lib)
+ list(APPEND OMPL_LIBRARIES "${_lib}")
+ endif()
+@@ -61,3 +63,4 @@ endif()
+
+ 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)
diff --git a/ports/ompl/CONTROL b/ports/ompl/CONTROL index e608b16d8..259006c2c 100644 --- a/ports/ompl/CONTROL +++ b/ports/ompl/CONTROL @@ -1,10 +1,6 @@ Source: ompl
Version: 1.5.1
-Port-Version: 0
+Port-Version: 1
Homepage: https://ompl.kavrakilab.org/
Description: The Open Motion Planning Library, consists of many state-of-the-art sampling-based motion planning algorithms
Build-Depends: boost-dynamic-bitset, boost-filesystem, boost-graph, boost-odeint, boost-program-options, boost-serialization, boost-system, boost-test, boost-ublas, boost-timer, eigen3
-
-Feature: app
-Description: Add support for reading meshes and performing collision checking
-Build-Depends: assimp, fcl
diff --git a/ports/ompl/fix_dependency.patch b/ports/ompl/fix_dependency.patch deleted file mode 100644 index 4a19f81b8..000000000 --- a/ports/ompl/fix_dependency.patch +++ /dev/null @@ -1,32 +0,0 @@ -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/ports/ompl/portfile.cmake b/ports/ompl/portfile.cmake index e15cb560d..ab02eba31 100644 --- a/ports/ompl/portfile.cmake +++ b/ports/ompl/portfile.cmake @@ -2,28 +2,19 @@ vcpkg_buildpath_length_warning(37) set(OMPL_VERSION 1.5.1)
-set(FEATURE_PATCHES)
-
-if("app" IN_LIST FEATURES)
- vcpkg_download_distfile(ARCHIVE
- URLS "https://github.com/ompl/omplapp/releases/download/1.5.1/omplapp-1.5.1-Source.tar.gz"
- FILENAME "omplapp-${OMPL_VERSION}.tar.gz"
- SHA512 83b1b09d6be776f7e15a748402f0c2f072459921de61a92731daf5171bd1f91a829fbeb6e10a489b92fba0297f6272e7bb6b8f07830c387bb29ccdbc7b3731f3
- )
- list(APPEND FEATURE_PATCHES fix_dependency.patch)
-else()
- vcpkg_download_distfile(ARCHIVE
- URLS "https://github.com/ompl/ompl/archive/1.5.1.tar.gz"
- FILENAME "ompl-${OMPL_VERSION}.tar.gz"
- SHA512 2f28d29f32f3bb03e67b29ce251e4786364847a25e3c4cf66d7663ed38dca4da71d4e03cf9ce647710d9524a3907c76c09795e77f041cb8822f695d28f5ca570
- )
-endif()
+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(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${OMPL_VERSION}
- PATCHES ${FEATURE_PATCHES}
+ 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.
@@ -58,17 +49,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/ompl/ompl.conf
${CURRENT_PACKAGES_DIR}/share/ompl/plannerarena
)
-if ("app" IN_LIST FEATURES)
- file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/ompl)
- file(RENAME ${CURRENT_PACKAGES_DIR}/bin/ompl_benchmark.exe ${CURRENT_PACKAGES_DIR}/tools/ompl/ompl_benchmark.exe)
- file(REMOVE_RECURSE
- ${CURRENT_PACKAGES_DIR}/bin
- ${CURRENT_PACKAGES_DIR}/debug/bin
- ${CURRENT_PACKAGES_DIR}/include/omplapp/CMakeFiles
- ${CURRENT_PACKAGES_DIR}/share/ompl/resources
- ${CURRENT_PACKAGES_DIR}/share/ompl/webapp
- )
-endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
