mirror of
https://github.com/cemu-project/vcpkg.git
synced 2024-11-24 03:39:45 +00:00
[libyuv] Add libyuv (#7486)
* [libyuv] Add libyuv Add libyuv * [libyuv] change to provide libyuv-config.cmake
This commit is contained in:
parent
b4a0c8d574
commit
b41a4fa161
4
ports/libyuv/CONTROL
Normal file
4
ports/libyuv/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: libyuv
|
||||
Version: fec9121
|
||||
Build-Depends: libjpeg-turbo
|
||||
Description: libyuv is an open source project that includes YUV scaling and conversion functionality.
|
53
ports/libyuv/fix_cmakelists.patch
Normal file
53
ports/libyuv/fix_cmakelists.patch
Normal file
@ -0,0 +1,53 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ed4948f0..aee019be 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -2,10 +2,14 @@
|
||||
# Originally created for "roxlu build system" to compile libyuv on windows
|
||||
# Run with -DTEST=ON to build unit tests
|
||||
|
||||
-PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
+CMAKE_POLICY( SET CMP0022 NEW )
|
||||
+
|
||||
+PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
|
||||
OPTION( TEST "Built unit tests" OFF )
|
||||
|
||||
+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
|
||||
+
|
||||
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
|
||||
SET ( ly_src_dir ${ly_base_dir}/source )
|
||||
SET ( ly_inc_dir ${ly_base_dir}/include )
|
||||
@@ -24,6 +28,8 @@ INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
|
||||
|
||||
# this creates the static library (.a)
|
||||
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
|
||||
+SET_TARGET_PROPERTIES( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
|
||||
+
|
||||
|
||||
# this creates the shared library (.so)
|
||||
ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
|
||||
@@ -38,6 +44,7 @@ TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
INCLUDE ( FindJPEG )
|
||||
if (JPEG_FOUND)
|
||||
include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
+ target_link_libraries( ${ly_lib_shared} PUBLIC ${JPEG_LIBRARY} )
|
||||
target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
|
||||
add_definitions( -DHAVE_JPEG )
|
||||
endif()
|
||||
@@ -81,10 +88,11 @@ endif()
|
||||
|
||||
|
||||
# install the conversion tool, .so, .a, and all the header files
|
||||
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
|
||||
-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
|
||||
-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
-INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
||||
+INSTALL ( TARGETS yuvconvert DESTINATION bin )
|
||||
+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-export DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
|
||||
+INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-export LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
+
|
||||
+INSTALL( EXPORT libyuv-export FILE libyuv-config.cmake DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
|
||||
|
||||
# create the .deb and .rpm packages using cpack
|
||||
INCLUDE ( CM_linux_packages.cmake )
|
48
ports/libyuv/portfile.cmake
Normal file
48
ports/libyuv/portfile.cmake
Normal file
@ -0,0 +1,48 @@
|
||||
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)
|
Loading…
Reference in New Issue
Block a user