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 | |
| 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>
| -rw-r--r-- | ports/ccd/CONTROL | 1 | ||||
| -rw-r--r-- | ports/ccd/fix-static.patch | 13 | ||||
| -rw-r--r-- | ports/ccd/portfile.cmake | 8 | ||||
| -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/portfile.cmake | 36 | ||||
| -rw-r--r-- | ports/omplapp/fix_boost_static_link.patch | 17 | ||||
| -rw-r--r-- | ports/omplapp/fix_dependency.patch (renamed from ports/ompl/fix_dependency.patch) | 0 | ||||
| -rw-r--r-- | ports/omplapp/portfile.cmake | 67 | ||||
| -rw-r--r-- | ports/omplapp/vcpkg.json | 11 | ||||
| -rw-r--r-- | versions/baseline.json | 6 | ||||
| -rw-r--r-- | versions/c-/ccd.json | 5 | ||||
| -rw-r--r-- | versions/o-/ompl.json | 5 | ||||
| -rw-r--r-- | versions/o-/omplapp.json | 9 |
15 files changed, 215 insertions, 35 deletions
diff --git a/ports/ccd/CONTROL b/ports/ccd/CONTROL index 5a5f59e28..6a7d5eeb0 100644 --- a/ports/ccd/CONTROL +++ b/ports/ccd/CONTROL @@ -1,4 +1,5 @@ Source: ccd Version: 2.1-4 +Port-Version: 1 Homepage: https://github.com/danfis/libccd Description: Library for collision detection between two convex shapes diff --git a/ports/ccd/fix-static.patch b/ports/ccd/fix-static.patch new file mode 100644 index 000000000..cfb4d388c --- /dev/null +++ b/ports/ccd/fix-static.patch @@ -0,0 +1,13 @@ +diff --git a/src/ccd/ccd_export.h b/src/ccd/ccd_export.h
+index e898d41..c6aa5fb 100644
+--- a/src/ccd/ccd_export.h
++++ b/src/ccd/ccd_export.h
+@@ -1,7 +1,7 @@
+ #ifndef CCD_EXPORT_H
+ #define CCD_EXPORT_H
+
+-#ifdef CCD_STATIC_DEFINE
++#if 1
+ # define CCD_EXPORT
+ #else
+ # ifdef _MSC_VER
diff --git a/ports/ccd/portfile.cmake b/ports/ccd/portfile.cmake index 29f0f9efa..a465560ca 100644 --- a/ports/ccd/portfile.cmake +++ b/ports/ccd/portfile.cmake @@ -1,3 +1,7 @@ +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(STATIC_PATCH fix-static.patch) +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danfis/libccd @@ -5,7 +9,9 @@ vcpkg_from_github( SHA512 ff037d9c4df50f09600cf9b3514b259b2850ff43f74817853f5665d22812891168f70bd3cc3969b2c9e3c706f6254991a65421476349607fbd04d894b217456d HEAD_REF master # Backport https://github.com/danfis/libccd/pull/70 to support Emscripten - PATCHES "support-emscripten.patch" + PATCHES + "support-emscripten.patch" + ${STATIC_PATCH} ) vcpkg_configure_cmake( 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/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")
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/ompl/fix_dependency.patch b/ports/omplapp/fix_dependency.patch index 4a19f81b8..4a19f81b8 100644 --- a/ports/ompl/fix_dependency.patch +++ b/ports/omplapp/fix_dependency.patch 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" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 8fea072f3..39d17150a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1158,7 +1158,7 @@ }, "ccd": { "baseline": "2.1-4", - "port-version": 0 + "port-version": 1 }, "ccfits": { "baseline": "2.5", @@ -4514,6 +4514,10 @@ }, "ompl": { "baseline": "1.5.1", + "port-version": 1 + }, + "omplapp": { + "baseline": "1.5.1", "port-version": 0 }, "onednn": { diff --git a/versions/c-/ccd.json b/versions/c-/ccd.json index da47a0a54..51d2ec8dd 100644 --- a/versions/c-/ccd.json +++ b/versions/c-/ccd.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "a720cc123c190c6b68e57e356c4937685eeb2faa", + "version-string": "2.1-4", + "port-version": 1 + }, + { "git-tree": "c5315a631ffcea9c2a158578e73c53d8455808de", "version-string": "2.1-4", "port-version": 0 diff --git a/versions/o-/ompl.json b/versions/o-/ompl.json index 485887ffe..801fcdea6 100644 --- a/versions/o-/ompl.json +++ b/versions/o-/ompl.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "f3812117c1ed1d4080155284f12908236dd797f5", + "version-string": "1.5.1", + "port-version": 1 + }, + { "git-tree": "2dc123683ef75002bd7252b252cc220a7a643066", "version-string": "1.5.1", "port-version": 0 diff --git a/versions/o-/omplapp.json b/versions/o-/omplapp.json new file mode 100644 index 000000000..4b8de5c30 --- /dev/null +++ b/versions/o-/omplapp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "590eb9956381e7ef47b780fbd9aee2c6e8da323c", + "version-string": "1.5.1", + "port-version": 0 + } + ] +} |
