aboutsummaryrefslogtreecommitdiff
path: root/ports/libuvc
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2021-09-11 04:41:46 +0800
committerGitHub <noreply@github.com>2021-09-10 13:41:46 -0700
commite8e660a36c6aabc788d0cb03c5b38b7df6edbb22 (patch)
tree4efcd3b6e85e33e451321d39fe3229398aaf86d0 /ports/libuvc
parente0aee0ddcfdab86b4f7d28371f7923fa948599d3 (diff)
downloadvcpkg-e8e660a36c6aabc788d0cb03c5b38b7df6edbb22.tar.gz
vcpkg-e8e660a36c6aabc788d0cb03c5b38b7df6edbb22.zip
[vcpkg baseline][pangolin] Add features, fix dependency pybind11 (#20006)
* [vcpkg baseline][pangolin] Add features, fix dependency pybind11 * Fix dependency name realsense2 * Remove default-feature gles * Re-generated patch, add MAYBE_UNUSED_VARIABLES, fix build with core * version * Fix desc, add more MAYBE_UNUSED_VARIABLES * version * more MAYBE_UNUSED_VARIABLES * version * Remove some CMAKE_DISABLE_FIND_PACKAGE_* * version * Remove more CMAKE_DISABLE_FIND_* since they are disabled * Remove BUILD_FOR_GLES_2 * version * Restore BUILD_FOR_GLES_2 * version * Fix more dependencies * [libuvc]Fix build type, fix usage * version * Re-make patch * version * Use libjpeg macros instead of target name to avoid use `find_dependency` * version * Fix usage on non-Windows * version * commit suggestions * version * Apply suggestion * version * Re-fix JPEG * version * typo * format * version Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Diffstat (limited to 'ports/libuvc')
-rw-r--r--ports/libuvc/build_fix.patch25
-rw-r--r--ports/libuvc/portfile.cmake29
-rw-r--r--ports/libuvc/vcpkg.json16
3 files changed, 52 insertions, 18 deletions
diff --git a/ports/libuvc/build_fix.patch b/ports/libuvc/build_fix.patch
index 8ef3d9217..3c5bfcd44 100644
--- a/ports/libuvc/build_fix.patch
+++ b/ports/libuvc/build_fix.patch
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f3c8116..0da84a7 100644
+index f3c8116..b9a6d38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -39,7 +39,7 @@ set(SOURCES
+@@ -39,10 +39,10 @@ set(SOURCES
src/misc.c
)
@@ -10,7 +10,11 @@ index f3c8116..0da84a7 100644
+find_package(libusb CONFIG REQUIRED)
# JpegPkg name to differ from shipped with CMake
- find_package(JpegPkg QUIET)
+-find_package(JpegPkg QUIET)
++find_package(JPEG REQUIRED)
+ if(JPEG_FOUND)
+ message(STATUS "Building libuvc with JPEG support.")
+ set(LIBUVC_HAS_JPEG TRUE)
@@ -107,9 +107,10 @@ foreach(target_name IN LISTS UVC_TARGETS)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
@@ -23,3 +27,18 @@ index f3c8116..0da84a7 100644
)
if(JPEG_FOUND)
target_link_libraries(${target_name}
+diff --git a/libuvcConfig.cmake b/libuvcConfig.cmake
+index b9887ea..e8f09dc 100644
+--- a/libuvcConfig.cmake
++++ b/libuvcConfig.cmake
+@@ -10,8 +10,8 @@ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+ list(APPEND extraArgs REQUIRED)
+ endif()
+
+-find_package(JpegPkg ${extraArgs})
+-find_package(LibUSB ${extraArgs})
++include(CMakeFindDependencyMacro)
++find_dependency(JPEG ${extraArgs})
+ include("${CMAKE_CURRENT_LIST_DIR}/libuvcTargets.cmake")
+
+ set(libuvc_FOUND TRUE)
diff --git a/ports/libuvc/portfile.cmake b/ports/libuvc/portfile.cmake
index ab12966cd..1e76adcd9 100644
--- a/ports/libuvc/portfile.cmake
+++ b/ports/libuvc/portfile.cmake
@@ -4,23 +4,28 @@ vcpkg_from_github(
REF c612d4509eb0ff19ce414abc3dca18d0f6263a84
SHA512 df3f23463728e8ffd69dc52e251ea2610ea8df32b02f6d26dd2a6910cf217650245bb1a11e67be61df875c6992d592c9cb17675d914997bd72c9fe7eb5b65c32
HEAD_REF master
- PATCHES
- build_fix.patch
+ PATCHES build_fix.patch
)
-vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
- OPTIONS -DBUILD_EXAMPLE=OFF
-)
-vcpkg_install_cmake()
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(BUILD_TARGET "Shared")
+else()
+ set(BUILD_TARGET "Static")
+endif()
-vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libuvc)
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DCMAKE_BUILD_TARGET=${BUILD_TARGET}
+ -DBUILD_EXAMPLE=OFF
+)
+vcpkg_cmake_install()
vcpkg_copy_pdbs()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+vcpkg_cmake_config_fixup(PACKAGE_NAME libuvc CONFIG_PATH lib/cmake/libuvc)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
-file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/ports/libuvc/vcpkg.json b/ports/libuvc/vcpkg.json
index ce4a13b0a..ee9766b69 100644
--- a/ports/libuvc/vcpkg.json
+++ b/ports/libuvc/vcpkg.json
@@ -1,11 +1,21 @@
{
"name": "libuvc",
- "version-string": "2020-11-24",
- "port-version": 1,
+ "version-date": "2020-11-24",
+ "port-version": 2,
"description": "a cross-platform library for USB video devices",
"homepage": "https://github.com/libuvc/libuvc",
"supports": "linux",
"dependencies": [
- "libusb"
+ "libjpeg-turbo",
+ "libusb",
+ "libusb",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
]
}