vcpkg/ports/opencc/portfile.cmake
Osyotr eb40ddf467
[opencc] Update to 1.1.4, fix x64-linux-dynamic build (#25821)
* [opencc] Update to 1.1.4, fix x64-linux-dynamic build

* Use vcpkg_copy_tools

* v db

Co-authored-by: Osyotr <8740768+Osyotr@users.noreply.github.com>
2022-08-04 17:54:38 -07:00

48 lines
1.4 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO BYVoid/OpenCC
REF ver.1.1.4
SHA512 ab8e7e6a0cc71106cf09eb32899fa8620b946a406f042d75a2444096e0b383cb1993d6c2d12cd7862e71854da4cd5893442bce51df84c32ed09fdfb4a2846f46
HEAD_REF master
)
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_DOCUMENTATION=OFF
-DENABLE_GTEST=OFF
)
vcpkg_cmake_install(
DISABLE_PARALLEL
)
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
set(tool_names "opencc" "opencc_dict" "opencc_phrase_extract")
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ${tool_names} AUTO_CLEAN)
endif()
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")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")