vcpkg/ports/libxmp/portfile.cmake

42 lines
1.2 KiB
CMake
Raw Normal View History

2023-04-15 16:10:34 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libxmp/libxmp
2023-06-22 08:55:07 +08:00
REF libxmp-${VERSION}
SHA512 5f7690e274f3857bd6889cd2ba637473f4a85359a6ef87c76313f87d0c725e3880ba6e428b542dbbf0c8a7725a87b5019289b3f19d2c5bb49527b380f1b4f7e4
2023-04-15 16:10:34 +08:00
PATCHES
fix-cmake-config-dir.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
depackers LIBXMP_DISABLE_DEPACKERS
prowizard LIBXMP_DISABLE_PROWIZARD
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_STATIC=${BUILD_STATIC}
-DBUILD_SHARED=${BUILD_SHARED}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(
PACKAGE_NAME "libxmp"
CONFIG_PATH "lib/cmake/libxmp"
)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/docs/COPYING.LIB" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)