diff options
| author | Phoebe <20694052+PhoebeHui@users.noreply.github.com> | 2020-07-07 03:58:52 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-06 12:58:52 -0700 |
| commit | e0f0dc5fa10a54ca3d5803d08406d7ceee95f0f9 (patch) | |
| tree | b79bf545e7450f23f461b29ea2bf131704dc90c1 | |
| parent | 63cd5bf5600874c668560afaae7875a5b77259d0 (diff) | |
| download | vcpkg-e0f0dc5fa10a54ca3d5803d08406d7ceee95f0f9.tar.gz vcpkg-e0f0dc5fa10a54ca3d5803d08406d7ceee95f0f9.zip | |
[libyuv] Find dependency port libjpeg-turbo (#12213)
| -rw-r--r-- | ports/libyuv/CONTROL | 2 | ||||
| -rw-r--r-- | ports/libyuv/fix-build-type.patch | 10 | ||||
| -rw-r--r-- | ports/libyuv/fix_cmakelists.patch | 122 | ||||
| -rw-r--r-- | ports/libyuv/libyuv-config.cmake | 5 | ||||
| -rw-r--r-- | ports/libyuv/portfile.cmake | 4 |
5 files changed, 75 insertions, 68 deletions
diff --git a/ports/libyuv/CONTROL b/ports/libyuv/CONTROL index 63dfda401..2b0189798 100644 --- a/ports/libyuv/CONTROL +++ b/ports/libyuv/CONTROL @@ -1,4 +1,4 @@ Source: libyuv
-Version: fec9121-1
+Version: fec9121-2
Build-Depends: libjpeg-turbo
Description: libyuv is an open source project that includes YUV scaling and conversion functionality.
diff --git a/ports/libyuv/fix-build-type.patch b/ports/libyuv/fix-build-type.patch index 984a1253f..cb3ffdec8 100644 --- a/ports/libyuv/fix-build-type.patch +++ b/ports/libyuv/fix-build-type.patch @@ -40,14 +40,14 @@ index 097434b..8f8864f 100644 -INSTALL ( TARGETS yuvconvert DESTINATION bin ) +INSTALL ( TARGETS yuvconvert DESTINATION tools ) INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) --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 ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) +-INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) - +if (NOT BUILD_SHARED_LIBS) -+ INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-export DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) ++ INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) +else() -+ INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-export LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++ INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) +endif() - INSTALL( EXPORT libyuv-export FILE libyuv-config.cmake DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) + INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) # create the .deb and .rpm packages using cpack diff --git a/ports/libyuv/fix_cmakelists.patch b/ports/libyuv/fix_cmakelists.patch index bebfe7155..00cc50599 100644 --- a/ports/libyuv/fix_cmakelists.patch +++ b/ports/libyuv/fix_cmakelists.patch @@ -1,61 +1,61 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ed4948f0..9f48ebde 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 ) -@@ -14,6 +18,7 @@ SET ( ly_lib_name yuv ) - SET ( ly_lib_static ${ly_lib_name} ) - SET ( ly_lib_shared ${ly_lib_name}_shared ) - -+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h ) - FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) - LIST ( SORT ly_source_files ) - -@@ -24,6 +29,7 @@ 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,12 @@ 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 ( FILES ${ly_include_files} DESTINATION include/libyuv ) -+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 ) +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ed4948f..5b4e112 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 )
+@@ -14,6 +18,7 @@ SET ( ly_lib_name yuv )
+ SET ( ly_lib_static ${ly_lib_name} )
+ SET ( ly_lib_shared ${ly_lib_name}_shared )
+
++FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h )
+ FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
+ LIST ( SORT ly_source_files )
+
+@@ -24,6 +29,7 @@ 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,12 @@ 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 ( FILES ${ly_include_files} DESTINATION include/libyuv )
++INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
++INSTALL ( TARGETS ${ly_lib_shared} EXPORT libyuv-targets LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
++
++INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
+
+ # create the .deb and .rpm packages using cpack
+ INCLUDE ( CM_linux_packages.cmake )
diff --git a/ports/libyuv/libyuv-config.cmake b/ports/libyuv/libyuv-config.cmake new file mode 100644 index 000000000..357a95f99 --- /dev/null +++ b/ports/libyuv/libyuv-config.cmake @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro)
+find_dependency(JPEG REQUIRED)
+
+set(libyuv_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include")
+include("${CMAKE_CURRENT_LIST_DIR}/libyuv-targets.cmake")
diff --git a/ports/libyuv/portfile.cmake b/ports/libyuv/portfile.cmake index 1e955c185..ad856f9de 100644 --- a/ports/libyuv/portfile.cmake +++ b/ports/libyuv/portfile.cmake @@ -23,5 +23,7 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/libyuv)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libyuv RENAME copyright)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake ${CURRENT_PACKAGES_DIR}/share/libyuv COPYONLY)
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
