aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ffnvcodec/portfile.cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ffnvcodec/portfile.cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/ffnvcodec/portfile.cmake')
-rw-r--r--vcpkg/ports/ffnvcodec/portfile.cmake61
1 files changed, 61 insertions, 0 deletions
diff --git a/vcpkg/ports/ffnvcodec/portfile.cmake b/vcpkg/ports/ffnvcodec/portfile.cmake
new file mode 100644
index 0000000..4dc7f31
--- /dev/null
+++ b/vcpkg/ports/ffnvcodec/portfile.cmake
@@ -0,0 +1,61 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO FFmpeg/nv-codec-headers
+ REF "n${VERSION}"
+ SHA512 dd2f1c7ff54890016ab17500449620cdf3690aa1d34dec78f1b27bdc0d51ec1335a66fda5942ddb43e1a1310de95874aef5232a1e676c21882fae08472d17808
+ HEAD_REF master
+)
+
+# ====================================================
+# Install the pkgconfig info for the `nvcodec` package
+# ====================================================
+
+# Windows
+if(VCPKG_HOST_IS_WINDOWS)
+ set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES make pkg-config)
+ set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
+
+ message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
+ file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
+
+ # Make and deploy the ffnvcodec.pc file using MSYS
+ # (so that FFmpeg can find it in the MSYS rootfs)
+ vcpkg_execute_required_process(
+ COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}"
+ "${SOURCE_PATH}"
+ "${CURRENT_PACKAGES_DIR}"
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}
+ LOGNAME build-${TARGET_TRIPLET}
+ )
+
+ if(NOT VCPKG_BUILD_TYPE)
+ file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
+ endif()
+
+# Linux, etc.
+else()
+ FIND_PROGRAM(MAKE make)
+ IF (NOT MAKE)
+ MESSAGE(FATAL_ERROR "MAKE not found")
+ ENDIF ()
+
+ vcpkg_execute_required_process(
+ COMMAND make PREFIX=$${CURRENT_PACKAGES_DIR}
+ WORKING_DIRECTORY ${SOURCE_PATH}
+ LOGNAME make-${TARGET_TRIPLET}
+ )
+
+ # FFmpeg uses pkgconfig to find ffnvcodec.pc, so install it where
+ # FFMpeg's call to pkgconfig expects to find it.
+ file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
+ if(NOT VCPKG_BUILD_TYPE)
+ file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
+ endif()
+endif()
+
+vcpkg_fixup_pkgconfig()
+
+# Install the files to their default vcpkg locations
+file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
+vcpkg_install_copyright(FILE_LIST "${CURRENT_PORT_DIR}/copyright")