mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-02 18:59:31 +08:00
b41a4fa161
* [libyuv] Add libyuv Add libyuv * [libyuv] change to provide libyuv-config.cmake
49 lines
1.7 KiB
CMake
49 lines
1.7 KiB
CMake
include(vcpkg_common_functions)
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_git(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
URL https://chromium.googlesource.com/libyuv/libyuv
|
|
REF fec9121b676eccd9acea2460aec7d6ae219701b9
|
|
PATCHES
|
|
fix_cmakelists.patch
|
|
)
|
|
|
|
set(POSTFIX d)
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
OPTIONS_DEBUG
|
|
-DCMAKE_DEBUG_POSTFIX="${POSTFIX}"
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/yuv)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/yuvconvert.exe ${CURRENT_PACKAGES_DIR}/tools/yuv/yuvconvert.exe)
|
|
endif()
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/yuvconvert.exe)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
endif()
|
|
|
|
set(LIBRARY_TYPE SHARED)
|
|
set(IMPORT_TYPE IMPLIB)
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
set(LIBRARY_TYPE STATIC)
|
|
set(IMPORT_TYPE LOCATION)
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/libyuv.dll)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
endif()
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/libyuvd.dll)
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
endif()
|
|
endif()
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libyuv RENAME copyright)
|