2023-12-05 08:38:12 +08:00
|
|
|
|
2018-04-20 07:17:35 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2020-06-05 03:20:25 +08:00
|
|
|
REPO eProsima/Fast-DDS
|
2024-10-01 01:10:47 +08:00
|
|
|
REF "v${VERSION}"
|
2024-10-18 13:16:10 +08:00
|
|
|
SHA512 c2b22f6355fc38ccf49d41f7fe074092c6962d2fa759351b37d83af863c60839d9579bfef0f96540276229bcdb2d3d218e18777db89cf16092d09c26f2e24533
|
2018-04-20 07:17:35 +08:00
|
|
|
HEAD_REF master
|
2021-10-14 05:39:39 +08:00
|
|
|
PATCHES
|
|
|
|
fix-find-package-asio.patch
|
|
|
|
disable-symlink.patch
|
2024-10-01 01:10:47 +08:00
|
|
|
pdb-file.patch
|
2018-04-20 07:17:35 +08:00
|
|
|
)
|
|
|
|
|
2024-05-23 14:41:28 +08:00
|
|
|
set(extra_opts "")
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
# when cross-compiling, try_run will not work.
|
|
|
|
set(extra_opts
|
|
|
|
-DSM_RUN_RESULT=TRUE
|
|
|
|
-DSM_RUN_RESULT__TRYRUN_OUTPUT=
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-10-14 05:39:39 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2024-05-23 14:41:28 +08:00
|
|
|
OPTIONS
|
|
|
|
${extra_opts}
|
2018-04-20 07:17:35 +08:00
|
|
|
)
|
|
|
|
|
2021-10-14 05:39:39 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-04-20 07:17:35 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2024-10-01 01:10:47 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH share/fastdds/cmake)
|
2018-04-20 07:17:35 +08:00
|
|
|
|
2021-10-14 05:39:39 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
# copy tools from "bin" to "tools" folder
|
2024-05-23 14:41:28 +08:00
|
|
|
foreach(TOOL "fast-discovery-server-1.0.1.exe" "fast-discovery-server.bat" "fastdds.bat" "ros-discovery.bat")
|
2021-10-14 05:39:39 +08:00
|
|
|
file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${TOOL}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${TOOL}")
|
|
|
|
endforeach()
|
2018-04-20 07:17:35 +08:00
|
|
|
|
2021-10-14 05:39:39 +08:00
|
|
|
# remove tools from debug builds
|
2024-05-23 14:41:28 +08:00
|
|
|
foreach(TOOL "fast-discovery-serverd-1.0.1.exe" "fast-discovery-server.bat" "fastdds.bat" "ros-discovery.bat")
|
2021-10-14 05:39:39 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# adjust paths in batch files
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/fastdds.bat" "%dir%\\..\\tools\\fastdds\\fastdds.py" "%dir%\\..\\fastdds\\fastdds.py")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/ros-discovery.bat" "%dir%\\..\\tools\\fastdds\\fastdds.py" "%dir%\\..\\fastdds\\fastdds.py")
|
|
|
|
|
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
elseif(VCPKG_TARGET_IS_LINUX)
|
|
|
|
# copy tools from "bin" to "tools" folder
|
2024-05-23 14:41:28 +08:00
|
|
|
foreach(TOOL "fast-discovery-server-1.0.1" "fast-discovery-server" "fastdds" "ros-discovery")
|
2021-10-14 05:39:39 +08:00
|
|
|
file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${TOOL}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${TOOL}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# replace symlink by a copy because symlinks do not work well together with vcpkg binary caching
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/fast-discovery-server")
|
2024-05-23 14:41:28 +08:00
|
|
|
file(INSTALL "${CURRENT_PACKAGES_DIR}/tools/${PORT}/fast-discovery-server-1.0.1" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}" RENAME "fast-discovery-server")
|
2021-10-14 05:39:39 +08:00
|
|
|
|
|
|
|
# remove tools from debug builds
|
2024-05-23 14:41:28 +08:00
|
|
|
foreach(TOOL "fast-discovery-serverd-1.0.1" "fast-discovery-server" "fastdds" "ros-discovery")
|
2021-10-14 05:39:39 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# adjust paths in batch files
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/fastdds" "$dir/../tools/fastdds/fastdds.py" "$dir/../fastdds/fastdds.py")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/ros-discovery" "$dir/../tools/fastdds/fastdds.py" "$dir/../fastdds/fastdds.py")
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 07:08:31 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/fastdds/discovery/parser.py" "tool_path / '../../../bin'" "tool_path / '../../${PORT}'")
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
2021-10-14 05:39:39 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2022-07-12 07:08:31 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
|
2021-10-14 05:39:39 +08:00
|
|
|
|
2023-04-14 12:48:43 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|