2024-08-29 15:26:09 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
|
2020-04-22 04:29:35 +08:00
|
|
|
vcpkg_from_github(
|
2019-09-14 01:45:57 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO osrf/sdformat
|
|
|
|
REF sdformat6_6.2.0
|
2020-04-22 04:29:35 +08:00
|
|
|
SHA512 3d139ec4b4c9fbfd547ed8bfca0adb5cdca92c1b7cc4d4b554a7c51ccf755b9079c26a006ebfedc5bc5b1ba5e16ad950bb38c47ea97bf97e59a2fd7d12d60620
|
2019-09-14 01:45:57 +08:00
|
|
|
HEAD_REF sdf6
|
2021-04-29 22:39:04 +08:00
|
|
|
PATCHES
|
|
|
|
disable-unneeded-include-findboost.patch
|
2022-02-08 13:37:36 +08:00
|
|
|
fix-dependency-urdfdom.patch
|
|
|
|
disable-test.patch
|
2019-09-14 01:45:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Ruby is required by the sdformat build process
|
|
|
|
vcpkg_find_acquire_program(RUBY)
|
|
|
|
get_filename_component(RUBY_PATH ${RUBY} DIRECTORY)
|
|
|
|
set(_path $ENV{PATH})
|
|
|
|
vcpkg_add_to_path(${RUBY_PATH})
|
|
|
|
|
2021-11-12 05:36:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-02-08 13:37:36 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DUSE_INTERNAL_URDF=OFF
|
|
|
|
-DUSE_EXTERNAL_TINYXML=ON
|
2019-09-14 01:45:57 +08:00
|
|
|
)
|
|
|
|
|
2021-11-12 05:36:14 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-09-14 01:45:57 +08:00
|
|
|
|
|
|
|
# Restore original path
|
2024-03-12 11:39:47 +08:00
|
|
|
set(ENV{PATH} "${_path}")
|
2019-09-14 01:45:57 +08:00
|
|
|
|
|
|
|
# Move location of sdformat.dll from lib to bin
|
2021-11-12 05:36:14 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/sdformat.dll")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/sdformat.dll"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin/sdformat.dll")
|
2019-09-14 01:45:57 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-12 05:36:14 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/sdformat.dll")
|
2019-09-14 01:45:57 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Fix cmake targets location
|
2021-11-12 05:36:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/sdformat")
|
2019-09-14 01:45:57 +08:00
|
|
|
|
|
|
|
# Remove debug files
|
2021-11-12 05:36:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-09-14 01:45:57 +08:00
|
|
|
|
2021-11-12 05:36:14 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/ignition/sdformat6.yaml" "${CURRENT_PACKAGES_DIR}" "../..")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sdformat-6.2/sdf/sdf_config.h" "#define SDF_SHARE_PATH \"${CURRENT_PACKAGES_DIR}/share/\"" "")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sdformat-6.2/sdf/sdf_config.h" "#define SDF_VERSION_PATH \"${CURRENT_PACKAGES_DIR}/share/sdformat/\"" "")
|
2019-09-14 01:45:57 +08:00
|
|
|
# Handle copyright
|
2024-08-29 15:26:09 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
2021-10-28 06:19:28 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|