2020-08-22 00:25:48 +08:00
|
|
|
vcpkg_from_github(
|
2018-02-23 00:24:51 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2020-08-22 00:25:48 +08:00
|
|
|
REPO videolan/x265
|
|
|
|
REF 07295ba7ab551bb9c1580fdaee3200f1b45711b7 #v3.4
|
|
|
|
SHA512 21a4ef8733a9011eec8b336106c835fbe04689e3a1b820acb11205e35d2baba8c786d9d8cf5f395e78277f921857e4eb8622cf2ef3597bce952d374f7fe9ec29
|
2018-02-23 00:24:51 +08:00
|
|
|
HEAD_REF master
|
2019-10-08 01:35:13 +08:00
|
|
|
PATCHES
|
|
|
|
disable-install-pdb.patch
|
2022-08-19 04:01:55 +08:00
|
|
|
fix-pkgconfig-version.patch
|
2018-02-28 02:36:28 +08:00
|
|
|
)
|
|
|
|
|
2022-07-14 04:17:56 +08:00
|
|
|
set(ASSEMBLY_OPTIONS "-DENABLE_ASSEMBLY=OFF")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2019-02-22 09:05:19 +08:00
|
|
|
vcpkg_find_acquire_program(NASM)
|
2022-07-14 04:17:56 +08:00
|
|
|
set(ASSEMBLY_OPTIONS "-DENABLE_ASSEMBLY=ON" "-DNASM_EXECUTABLE=${NASM}")
|
|
|
|
endif()
|
2019-02-22 09:05:19 +08:00
|
|
|
|
2018-02-28 02:36:28 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED)
|
|
|
|
|
2022-07-14 04:17:56 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}/source"
|
2019-02-22 09:05:19 +08:00
|
|
|
OPTIONS
|
2022-07-14 04:17:56 +08:00
|
|
|
${ASSEMBLY_OPTIONS}
|
2019-02-22 09:05:19 +08:00
|
|
|
-DENABLE_SHARED=${ENABLE_SHARED}
|
2022-07-14 04:17:56 +08:00
|
|
|
-DENABLE_LIBNUMA=OFF
|
2022-08-19 04:01:55 +08:00
|
|
|
-DX265_LATEST_TAG=3.4
|
2019-02-22 09:05:19 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DENABLE_CLI=OFF
|
2022-07-14 04:17:56 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
ENABLE_LIBNUMA
|
2018-02-23 00:24:51 +08:00
|
|
|
)
|
|
|
|
|
2022-07-14 04:17:56 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-02-23 00:24:51 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-07-14 04:17:56 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2020-08-22 00:25:48 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES x265 AUTO_CLEAN)
|
2018-02-28 02:36:28 +08:00
|
|
|
|
2020-12-02 06:13:58 +08:00
|
|
|
if(VCPKG_TARGET_IS_MINGW AND ENABLE_SHARED)
|
2022-07-14 04:17:56 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libx265.a")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libx265.a")
|
2020-12-02 06:13:58 +08:00
|
|
|
endif()
|
|
|
|
|
2022-07-14 04:17:56 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2023-09-01 04:06:37 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND ENABLE_SHARED)
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/x265-static.lib")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/x265-static.lib")
|
|
|
|
endif()
|
2022-07-14 04:17:56 +08:00
|
|
|
vcpkg_list(SET pc_files "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_list(APPEND pc_files "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc")
|
2020-08-19 03:58:14 +08:00
|
|
|
endif()
|
2022-07-14 04:17:56 +08:00
|
|
|
foreach(FILE IN LISTS pc_files)
|
|
|
|
file(READ "${FILE}" _contents)
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
2023-09-01 04:06:37 +08:00
|
|
|
if (NOT ENABLE_SHARED)
|
|
|
|
string(REPLACE "-lx265" "-lx265-static" _contents "${_contents}")
|
|
|
|
endif()
|
2022-07-14 04:17:56 +08:00
|
|
|
else()
|
|
|
|
string(REPLACE " -lgcc_s" "" _contents "${_contents}")
|
|
|
|
string(REPLACE " -lgcc" "" _contents "${_contents}")
|
|
|
|
endif()
|
|
|
|
file(WRITE "${FILE}" "${_contents}")
|
|
|
|
endforeach()
|
2020-08-19 03:58:14 +08:00
|
|
|
|
2018-02-23 00:24:51 +08:00
|
|
|
# Handle copyright
|
2022-07-14 04:17:56 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|