2020-04-29 04:14:11 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO BYVoid/OpenCC
|
2023-02-24 03:11:11 +08:00
|
|
|
REF "ver.${VERSION}"
|
2024-10-17 18:02:21 +08:00
|
|
|
SHA512 713cf00931d7616994eb455eef3bc893096b5cd6d42b346aa1130591752d9612891ea3ed035bd7bd4ec7df1c90425e86375f5b3337fac11663c656c79a8f33e9
|
2020-04-29 04:14:11 +08:00
|
|
|
HEAD_REF master
|
2022-08-13 06:46:15 +08:00
|
|
|
PATCHES
|
|
|
|
fix-dependencies.patch
|
2020-04-29 04:14:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
2022-08-05 08:54:38 +08:00
|
|
|
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${PYTHON3_DIR}")
|
2020-04-29 04:14:11 +08:00
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-04-29 04:14:11 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_DOCUMENTATION=OFF
|
|
|
|
-DENABLE_GTEST=OFF
|
2022-08-13 06:46:15 +08:00
|
|
|
-DUSE_SYSTEM_RAPIDJSON=ON
|
2022-08-27 03:11:07 +08:00
|
|
|
-DUSE_SYSTEM_TCLAP=ON
|
2022-08-30 02:33:30 +08:00
|
|
|
-DUSE_SYSTEM_DARTS=ON
|
2023-03-14 03:04:42 +08:00
|
|
|
-DUSE_SYSTEM_MARISA=ON
|
|
|
|
-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf
|
2020-04-29 04:14:11 +08:00
|
|
|
)
|
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
vcpkg_cmake_install(
|
2020-07-07 03:20:02 +08:00
|
|
|
DISABLE_PARALLEL
|
|
|
|
)
|
2020-04-29 04:14:11 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2024-10-17 18:02:21 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencc)
|
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-04-29 04:14:11 +08:00
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
set(tool_names "opencc" "opencc_dict" "opencc_phrase_extract")
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${tool_names} AUTO_CLEAN)
|
2020-04-29 04:14:11 +08:00
|
|
|
endif()
|
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
foreach(opencc_tool IN LISTS tool_names)
|
|
|
|
file(REMOVE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin/${opencc_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/${opencc_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2020-04-29 04:14:11 +08:00
|
|
|
endif()
|
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2020-04-29 04:14:11 +08:00
|
|
|
|
2022-08-05 08:54:38 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|