2020-03-25 04:00:09 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO FFmpeg/nv-codec-headers
|
2023-11-15 04:54:21 +08:00
|
|
|
REF "n${VERSION}"
|
2024-10-15 05:31:56 +08:00
|
|
|
SHA512 dd2f1c7ff54890016ab17500449620cdf3690aa1d34dec78f1b27bdc0d51ec1335a66fda5942ddb43e1a1310de95874aef5232a1e676c21882fae08472d17808
|
2020-03-25 04:00:09 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
# ====================================================
|
|
|
|
# Install the pkgconfig info for the `nvcodec` package
|
|
|
|
# ====================================================
|
|
|
|
|
|
|
|
# Windows
|
2020-10-07 15:23:23 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2020-03-25 04:00:09 +08:00
|
|
|
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}
|
|
|
|
)
|
2020-08-19 03:58:14 +08:00
|
|
|
|
2021-09-17 09:31:30 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
|
2020-03-25 04:00:09 +08:00
|
|
|
|
|
|
|
# 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.
|
2021-09-17 09:31:30 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/ffnvcodec.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
|
2020-03-25 04:00:09 +08:00
|
|
|
endif()
|
|
|
|
|
2020-08-19 03:58:14 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-09-17 09:31:30 +08:00
|
|
|
|
|
|
|
# Install the files to their default vcpkg locations
|
|
|
|
file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|