vcpkg/ports/rtabmap-res-tool/portfile.cmake
Kai Pastor c5b5b4ea11
[rtabmap] Fix platform and linkage support (#37651)
`rtabmap-res_tool` is moved to a separate port because it is a host
dependency, and actual dependencies of `rtabmap` are heavy and non
opt-out. Only minimal patching needed.

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
2024-04-01 13:32:08 -07:00

31 lines
1015 B
CMake

# Only the standalone tool
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
set(VCPKG_BUILD_TYPE release)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO introlab/rtabmap
REF ${VERSION}
SHA512 2b424f5b6458cf0f976e711985708f104b56d11921c9c43c6a837f9d3dc9e9e802308f1aa2b6d0e7e6ddf13623ff1ad2922b5f54254d16ee5811e786d27b9f98
HEAD_REF master
)
file(COPY "${CURRENT_PORT_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DINSTALL_INCLUDE_DIR=include
-DINSTALL_CMAKE_DIR=lib/cmake
-DRTABMAP_VERSION=${VERSION}
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")