vcpkg/ports/ktx/portfile.cmake

82 lines
2.6 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/KTX-Software
REF "v${VERSION}"
SHA512 0077315fe2b4e676e97e3a158c2c6e1f6ba426e14ad23342592cd69be28cfce64c40614e0a84d58a9634877ab334e713b94d4c962132c98bfea308e91bc8a98a
HEAD_REF master
PATCHES
0001-Use-vcpkg-zstd.patch
0002-Fix-versioning.patch
0003-mkversion.patch
0004-quirks.patch
2024-02-08 14:45:01 +08:00
0005-no-vendored-libs.patch
0006-fix-ios-install.patch
)
file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h")
vcpkg_list(SET OPTIONS)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_acquire_msys(MSYS_ROOT
PACKAGES
bash
DIRECT_PACKAGES
# Required for "getopt"
"https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-3-x86_64.pkg.tar.zst"
da26540881cd5734072717133307e5d1a27a60468d3656885507833b80f24088c5382eaa0234b30bdd9e8484a6638b4514623f5327f10b19eed36f12158e8edb
# Required for "dos2unix"
"https://mirror.msys2.org/msys/x86_64/dos2unix-7.5.1-1-x86_64.pkg.tar.zst"
83d85e6ccea746ef9e8153a0d605e774dbe7efc0ee952804acfee4ffd7e3b0386a353b45ff989dd99bc3ce75968209fea3d246ad2af88bbb5c4eca12fc5a8f92
)
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
vcpkg_list(APPEND OPTIONS "-DBASH_EXECUTABLE=${MSYS_ROOT}/usr/bin/bash.exe")
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools KTX_FEATURE_TOOLS
vulkan KTX_FEATURE_VK_UPLOAD
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DKTX_VERSION_FULL=v${VERSION}
-DKTX_FEATURE_TESTS=OFF
-DKTX_FEATURE_LOADTEST_APPS=OFF
-DKTX_FEATURE_STATIC_LIBRARY=${ENABLE_STATIC}
${FEATURE_OPTIONS}
${OPTIONS}
DISABLE_PARALLEL_CONFIGURE
)
vcpkg_cmake_install()
if(tools IN_LIST FEATURES)
vcpkg_copy_tools(
TOOL_NAMES
ktx
toktx
ktxsc
ktxinfo
ktx2ktx2
ktx2check
AUTO_CLEAN
)
else()
vcpkg_copy_pdbs()
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ktx)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(GLOB LICENSE_FILES "${SOURCE_PATH}/LICENSES/*")
file(COPY ${LICENSE_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSES")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")