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/omplapp | |
| 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/omplapp')
| -rw-r--r-- | ports/omplapp/fix_boost_static_link.patch | 17 | ||||
| -rw-r--r-- | ports/omplapp/fix_dependency.patch | 32 | ||||
| -rw-r--r-- | ports/omplapp/portfile.cmake | 67 | ||||
| -rw-r--r-- | ports/omplapp/vcpkg.json | 11 |
4 files changed, 127 insertions, 0 deletions
diff --git a/ports/omplapp/fix_boost_static_link.patch b/ports/omplapp/fix_boost_static_link.patch new file mode 100644 index 000000000..fd74fb8a7 --- /dev/null +++ b/ports/omplapp/fix_boost_static_link.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f5c3c88..3a4a7d4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,10 +36,10 @@ set(OMPL_DEMO_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/ompl/demos"
+ set(OMPL_CMAKE_UTIL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules"
+ CACHE FILEPATH "Path to directory with auxiliary CMake scripts for OMPL")
+
+-if(MSVC)
++if(false)
+ add_definitions(-DBOOST_ALL_NO_LIB)
+ add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
+-endif(MSVC)
++endif(false)
+ # Ensure dynamic linking with boost unit_test_framework
+ add_definitions(-DBOOST_TEST_DYN_LINK)
+ # Avoid valgrind error due to overflow error, cf. https://bitbucket.org/ompl/ompl/issues/543
diff --git a/ports/omplapp/fix_dependency.patch b/ports/omplapp/fix_dependency.patch new file mode 100644 index 000000000..4a19f81b8 --- /dev/null +++ b/ports/omplapp/fix_dependency.patch @@ -0,0 +1,32 @@ +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/omplapp/portfile.cmake b/ports/omplapp/portfile.cmake new file mode 100644 index 000000000..02da44945 --- /dev/null +++ b/ports/omplapp/portfile.cmake @@ -0,0 +1,67 @@ +vcpkg_buildpath_length_warning(37)
+
+set(OMPL_VERSION 1.5.1)
+
+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
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ set(STATIC_PATCH fix_boost_static_link.patch)
+endif()
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ REF ${OMPL_VERSION}
+ PATCHES
+ fix_dependency.patch
+ ${STATIC_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
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DOMPL_VERSIONED_INSTALL=OFF
+ -DOMPL_REGISTRATION=OFF
+ -DOMPL_BUILD_DEMOS=OFF
+ -DOMPL_BUILD_TESTS=OFF
+ -DOMPL_BUILD_PYBINDINGS=OFF
+ -DOMPL_BUILD_PYTESTS=OFF
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/ompl/cmake)
+
+# Remove debug distribution and other, move ompl_benchmark to tools/ dir
+vcpkg_copy_tools(TOOL_NAMES ompl_benchmark AUTO_CLEAN)
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/include/ompl"
+ "${CURRENT_PACKAGES_DIR}/bin"
+ "${CURRENT_PACKAGES_DIR}/include/omplapp/CMakeFiles"
+ "${CURRENT_PACKAGES_DIR}/lib/ompl.lib"
+ "${CURRENT_PACKAGES_DIR}/share/ompl"
+ "${CURRENT_PACKAGES_DIR}/share/man"
+ "${CURRENT_PACKAGES_DIR}/debug/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/lib/ompl.lib"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+
+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)
diff --git a/ports/omplapp/vcpkg.json b/ports/omplapp/vcpkg.json new file mode 100644 index 000000000..07ac2ba64 --- /dev/null +++ b/ports/omplapp/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "omplapp", + "version-string": "1.5.1", + "description": "Use OMPL for reading meshes and performing collision checking", + "homepage": "https://ompl.kavrakilab.org/", + "dependencies": [ + "assimp", + "fcl", + "ompl" + ] +} |
